Fantom (programming language)

{{About|a programming language||Fantom (disambiguation)}}

{{multiple issues|

{{Tone|date=March 2012}}

{{primary sources|date=June 2018}}

}}

{{Infobox programming language

| name = Fantom

| logo = File:Fantom-logo.png

| paradigm = multi-paradigm

| year = 2005[http://fantom.org/sidewalk/topic/355 Blog post about history of Fantom]

| designer =

| developer = Brian Frank, Andy Frank

| latest_release_version = 1.0.81

| latest_release_date = {{Start date and age|2024|12|06}}{{cite web | url = https://fantom.org/forum/topic/2932 | title = Build 1.0.81 - Fantom | date = 6 December 2024}}

| typing = static, dynamic

| implementations =

| dialects =

| influenced_by = C#, Java, Scala, Ruby, Erlang

| influenced =

| license = Academic Free License version 3.0[http://fantom.org/doc/docIntro/Faq.html FAQ of Fandoc language website]

| file ext = .fan, .fwt, .pod

| website = {{URL|www.fantom.org}}

}}

Fantom is a general-purpose object-oriented programming language, created by Brian Frank and Andy Frank.[http://fantom.org/doc/docIntro/Faq.html#contact Fantom FAQ: Contact Us] It runs on the Java Runtime Environment (JRE), JavaScript, and the .NET Common Language Runtime (CLR) (.NET support is considered "prototype"{{Cite web |url=http://fantom.org/doc/docIntro/Roadmap.html |title=Fantom FAQ: Roadmap |access-date=2012-03-29 |archive-date=2015-12-11 |archive-url=https://web.archive.org/web/20151211122808/http://fantom.org/doc/docIntro/Roadmap.html |url-status=dead }} status). Its stated goal is to provide a standard library API.[http://fantom.org/doc/docIntro/WhyFantom.html Fantom FAQ: Why Fantom?] Fantom uses a curly brace syntax, supports functional programming through closures and concurrency through the Actor model, and blends aspects of both static and dynamic typing.

The original name of the Fantom programming language was Fan, named after the neighborhood in which the creators live in Richmond, Virginia. In November 2009,[http://es.scribd.com/doc/47962182/scala-haskell-and-fantom-programming-language History of Fantom programming language] the name of the project was officially changed from Fan to Fantom due to searchability concerns raised by its community.[http://fantom.org/sidewalk/topic/821 Fan is officially now Fantom]

Fantom is open source under Academic Free License 3.0 and is available for Windows and Unix-like platforms (including Mac OS X).{{cite web |last=McAllister |first=Neil |date=2012-01-03 |title=10 programming languages that could shake up IT |url=http://www.infoworld.com/d/application-development/10-programming-languages-could-shake-it-181548?page=0,2 |accessdate=2015-10-30 |publisher=InfoWorld}}

Features and systems

All variables in Fantom are statically typed, as it does not have generic types, but it does have a set of built-in generic types: List, Map, and Func. Fantom also supports dynamic calls and automatic downcasting. Fantom has a reflection API and metaprogramming capabilities.

Fantom supports imports of Java Classes and modules with some limitations.[http://fantom.org/doc/docLang/JavaFFI.html Java FFI at Fantom home page] Its integer is 64-bit. Unlike Java and C#, Fantom does not have Long or Short integer types. Fantom also does not support tuples.[http://fantom.org/sidewalk/topic/1815 Tuples question at Fantom official page]

In Fantom, the unit of deployment is called a pod. Pods take on the role of namespaces, packages, and modules. They are stored as .pod files, which are zip files containing the FCode (the Fantom bytecode), the documentation, and resource files necessary to run the pod. The Fantom build system can package a set of pods into a JAR archive through build::JarDist.

Integrated development environment

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.{{Cite web |title=Steve Eynon (MEng MIET) - Fantom Factory {{!}} LinkedIn |url=https://uk.linkedin.com/in/steveneynon |access-date=2023-12-14 |website=uk.linkedin.com |language=en}} The F4 IDE is available on GitHub.

Fantom Widget Toolkit

Fantom ships with a standard windowing toolkit called the Fantom Widget Toolkit, or FWT for short.{{cite web |url=http://fantom.org/doc/fwt/pod-doc.html |title=fwt – Fantom |publisher=Fantom.org |date=2015-01-08 |accessdate=2015-10-30 |archive-date=2011-08-16 |archive-url=https://web.archive.org/web/20110816013612/http://fantom.org/doc/fwt/pod-doc.html |url-status=dead }} 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.

Usage

Escape the Mainframe is a browser game (just like the Google t-rex dinosaur) completely written in Fantom by Steve Eynon.{{Cite web |title=Escape the Mainframe! |url=http://escape.fantomfactory.org/ |access-date=2023-12-14 |website=escape.fantomfactory.org |language=en}}

See also

{{Portal|Free and open-source software}}

References

{{Reflist}}

Further reading

  • {{cite web |last=Binstock |first=Andrew |title=Top five scripting languages on the JVM: Groovy and JRuby lead a strong field, with Scala, Fantom, and Jython following behind |url=http://www.infoworld.com/article/2627426/application-development/top-five-scripting-languages-on-the-jvm.html?page=4 |publisher=Dr. Dobb's |date=2010-07-14 |accessdate=2015-10-30}}
  • {{cite web |last=Frank |first=Brian |title=Fantom |url=http://www.drdobbs.com/tools/fantom/229218754?pgno=1 |publisher=Dr. Dobb's |date=2011-02-18 |accessdate=2015-10-30}}