Description #
Fantom is a cross-platform, object-oriented programming language designed to run on the Java Virtual Machine (JVM), .NET CLR, and its own runtime (Fantom VM), with a strong focus on portability and simplicity.
History #
Fantom was created in 2005 by Brian and Andy Frank at SkyFoundry. It was originally developed as a platform-agnostic alternative to Java and C#, aiming to unify features from both while simplifying language design.
Hello World Code #
class HelloWorld {
static Void main() {
echo("Hello, World!")
}
}
How to Run #
Option 1: Online
https://try.fantom.org/
Option 2: Local
Install from https://fantom.org/
To run:
fan HelloWorld.fan
Key Concepts #
- Object-oriented and class-based
- Portable across JVM, .NET, and native runtimes
- Interpreted via Fantom VM or compiled to bytecode
- Uses
echo()
instead ofprint
- Has built-in concurrency (actors)
- Unified type system with null safety
- Simplified syntax compared to Java/C#
- Includes Fantom Pod packages (.pod files)
- Strong emphasis on tooling and documentation
- Targets IoT, web apps, and enterprise systems
Try It Online #
Fun Facts #
- Fantom introduced “pods” long before containerization became mainstream (used for packaging libraries).
- Originally called Fan, the name was changed to Fantom due to trademark concerns.
- Fantom can also be used for web frontends through FWT, a cross-platform GUI toolkit.