Description #
Fantom is a portable, object-oriented programming language designed to run on the JVM, .NET CLR, and JavaScript environments. It emphasizes cross-platform compatibility with a concise syntax, strong typing, and native support for concurrency and asynchronous programming.
History #
Fantom was created by Brian Frank and first released in 2005. It was designed to address the challenges of developing software that can run seamlessly across multiple platforms, combining features from both static and dynamic languages. Its unique multi-runtime capability makes it suitable for diverse application domains.
Hello World Code #
class HelloWorld {
static Void main() {
echo("Hello, World!")
}
}
How to Run #
Option 1: Online
Use Fantom Online REPL to run code snippets.
Option 2: Local
- Install Fantom SDK from https://fantom.org/download
- Run with command:
fan HelloWorld.fan
Key Concepts #
- Statically typed with type inference
- Runs on JVM, .NET CLR, and JavaScript engines
- Portable runtime with a common set of APIs
- Supports concurrency and asynchronous programming
- Mix of functional and object-oriented paradigms
- Includes built-in collections and reflection APIs
- Allows extension via native libraries
- Supports code modularity with packages and modules
- Command-line tools for compiling and running code
- Growing but niche developer community
Try It Online #
Fun Facts #
- Fantom’s multi-runtime approach lets you write code once and run it anywhere JVM, .NET, or JS is supported.
- Its syntax combines Java’s familiarity with Python-style terseness.
- Designed with enterprise and cross-platform mobile app development in mind.
- Fantom was created by Brian Frank, who has a background at BEA Systems and is known for software design and modeling.
- The language supports advanced concurrency features inspired by functional programming.