Fantom is an object / functional hybrid with strong typing or dynamic typing depending how you are feeling.
foo.bar(zarjazz) // This is static
foo->bar(zarjazz) // This is dynamic
If you go with the static typing you get some type inference and nice errors from the compiler, and if you go dynamic you can write your own despatch mechanism for your class and pretend you’re writing Smalltalk or Ruby. You may even be able to go really crazy and add methods that don’t exist as they are called using closures but I haven’t tried that yet.
It has some other nice features inspired by Ruby such as mixin inheritance and passing closures to the methods on its collection libraries so you never have to write a for loop again. Additionally it has a simple build tool, logging and unit testing baked into its core libraries.
So far so good! But the thing that really caught my interest was Nullable types. C# has nullable value types, this has always seemed stupid to me – you take my int which can never generate a NullReference exception, you replace it with an int? which can either contain a null or an int, now NullReference is free to roam your code at will. In Fantom types can only contain null if you let them; by default Fantom types can’t contain a null, however if you add a ‘?’ to the type name it becomes a nullable type – which is like a Maybe in Haskell but just using null as its value for None. This is exactly what I want in my code, if I say I want a Foo the compiler will make sure that I get a Foo and not a null pretending to be a Foo, and if you see a method returning a Foo? you know that you will need to check for nulls before proceeding to use its result or get an error – unlike in Java where really everything that isn’t a primitive type maybe null. The paranoid part of my brain is now thinking, “Oh my! I should null check every parameter, in every method, forever!”
To summarize: so far I like Fantom, it is a nicer and simpler Java / C# and is nowhere near as complicated as Scala. Programming in Fantom feels a lot like programming in Ruby but with the added benefit of having a simple type system present to catch some of your errors.