Fantom (programming Language)
   HOME

TheInfoList



OR:

Fantom is a general purpose
object-oriented programming language Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of pro ...
created by Brian and Andy Frank that runs on the
Java Runtime Environment Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cros ...
(JRE),
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
, and the .NET Common Language Runtime (CLR) (.NET support is considered "prototype" status). Its primary design goal is to provide a standard library application programming interface, API that abstracts away the question of whether the code will ultimately run on the JRE or CLR. Like C Sharp (programming language), C# and Java (programming language), Java, Fantom uses a curly brace programming language, curly brace syntax. The language supports functional programming through closures and concurrency through the Actor model. Fantom takes a "middle of the road" approach to its type system, blending together aspects of both Type system#Static type checking, static and Type system#Dynamic type checking and runtime type information, dynamic typing.


Typing

Fantom's type system is simple by design. All variables are statically typed, as they are in C Sharp (programming language), C# and Java (programming language), Java. Fantom rejects Generic programming, generic types due to their complexity, but it does have a set of built-in generic types: List, Map, and Func. Fantom can also take on the feel of a dynamically typed language through dynamic calls and automatic downcasting. Fantom has an easy to use Reflection (computer science), reflection API and metaprogramming capabilities. Fantom is open source under the Academic Free License 3.0 and is available for Windows and Unix-like platforms (including Mac OS X).


IDE and Tools

F4 is the main publicly available IDE for the Fantom language, officially supported by one of the main open source contributors to the language
Steve Eynon
The F4 IDE is available on GitHub https://github.com/xored/f4 More free tools and information are also available on https://fantom-lang.org/


Pods

In Fantom, the unit of deployment is called a ''pod''. Pods take on the role of namespaces, Java package, packages, and Modular programming, modules. They are stored as .pod files, which are ZIP (file format), zip files containing the FCode (the Fantom bytecode), the documentation, and Resource (Java), resource files necessary to run the pod. A pod can define any number of types for use in other libraries and applications. A pod name fully qualifies a type name. For example, fwt::Widget is distinct from webapp::Widget. If a pod contains a type named Main, then it can be executed on the command line with: fan <podName> The Fantom build system can package a set of Pods into a JAR (file format), JAR archive through build::JarDist.


Fantom Widget Toolkit

Fantom ships with a standard Widget toolkit, windowing toolkit called the Fantom Widget Toolkit, or FWT for short. Like Fantom, FWT was designed to be portable across several platforms. It is currently implemented on the JVM using the Standard Widget Toolkit as a backend. The JavaScript implementation is backed by the canvas element and JavaFX, allowing FWT applications to be run in a web browser. There are plans for a CLR implementation using Windows Forms.


"Hello World" example

Here is the classic Hello world program written in Fantom: // Hello from Fantom! class HelloWorld Notice that "Void" is capitalized. This is because Void is a class, not a primitive type in Fantom.


Name change

The original name of the Fantom programming language was Fan, named after the Fan district, neighborhood where the creators live in Richmond, Virginia. After the language gained some popularity, members of the community raised concerns about the Search engine optimization, searchability of the name. In November 2009, the name of the project was officially changed from Fan to Fantom.Fan is officially now Fantom
/ref>


Other features

Fantom has other useful features: * Fantom supports imports of Java Classes and modules with some limitations. * Integer is 64-bit. Unlike Java and C#, Fantom does not have Long or Short integer types. * Serialization and deserialization of classes to/from strings. * Fantom does ''not'' support tuples (that is, types which are the Cartesian product of other types)Tuples question at Fantom official page
/ref>


A game - in Fantom?

'
Escape the Mainframe
'' is a browser game (just like the Google t-rex dinosaur) completely written in Fantom b
Steve Eynon
http://escape.fantomfactory.org/


See also

* Boo (programming language), Boo * Ceylon (programming language), Ceylon * Gosu (programming language), Gosu * Groovy (programming language), Apache Groovy * Kotlin (programming language), Kotlin * Ruby (programming language), Ruby


References


Further reading

* *


External links

*
Open source website: https://fantom-lang.org/download
* Open source repository for Fantom libraries https://eggbox.fantomfactory.org/ * Fantom portfolio https://fantom-lang.org/portfolio
Not a Fan of Scala? An Evolutionary Approach , Ajaxonomy
- blog post discussing ''Fan''
Fan of a New Language , SD Times

Re: Fan Programming Language (jvm-languages@googlegroups.com mailing list)
a forum post by one of Fantom's authors.

a conversation with Stephen Colebourne by Bill Venners.
Language reference page at LangRef.org
{{DEFAULTSORT:Fantom (Programming Language) Object-oriented programming languages Statically typed programming languages JVM programming languages .NET programming languages Programming languages created in 2005 Software using the Academic Free License