I came across an interesting talk by Stephen Colebourne on Fantom, from 2011. The talk looks at some features of Fantom, and discusses their novelty in comparison with Scala. I'm not interested in the Scala comparisons, as much as the highlighted parts of Fantom, several of which resonated with me:1. The pod system.
A pod is the unit of compilation, meaning that, when you run the Fantom compiler, it will compile an entire collection of classes. This is different to, say, Java, which works on a class-by-class basis. The pod is a single unit, which can be distributed and included in a larger system. The pod carries along some meta-data, such as its version, which gives useful information when including pods in a larger system.2. Types.
The combination of static typing with a dynamic option is one of my favourite Fantom features. Dynamic method calls, checked at runtime, give the feel of a dynamic language, such as Ruby. The type system will infer types for variables, and provide the comfort of static checks before compiling, as with Java.3. Null safety.
Fantom tackles null safety in two ways. First, the type system allows us to specify whether a field/variable or return value can be null or not. Second, for variables that may hold null, the "safe invoke" and "elvis operator" enable us to write code without some of the usual null tests.4. Immutability, for concurrency.
Fantom has an actor-based concurrency framework, which relies on immutability of classes. Having this as a fundamental part of the language forces a particular style of writing concurrent programs. A style that promises to remove a certain class of problems in putting together concurrent software.
Whether or not you agree with the premise of Stephen's talk, I found the analysis interesting, and the talk prompted a closer look at why I had chosen to work with Fantom in the first place.