Fantom (programming language)

Last updated
Fantom
Fantom-logo.png
Paradigm multi-paradigm
Developer Brian Frank, Andy Frank
First appeared2005 [1]
Stable release
1.0.79 / July 17, 2023;7 months ago (2023-07-17) [2]
Typing discipline static, dynamic
License Academic Free License version 3.0 [3]
Filename extensions .fan, .fwt, .pod
Website www.fantom.org
Influenced by
C#, Java, Scala, Ruby, Erlang

Fantom is a general-purpose object-oriented programming language, created by Brian Frank and Andy Frank. [4] It runs on the Java Runtime Environment (JRE), JavaScript, and the .NET Common Language Runtime (CLR) (.NET support is considered "prototype" [5] status). Its stated goal is to provide a standard library API. [6] 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.

Contents

The original name of the Fantom programming language was Fan, named after the neighborhood where the creators live in Richmond, Virginia. In November 2009, [7] the name of the project was officially changed from Fan to Fantom due to searchability concern raised by its community. [8]

Fantom is open source under Academic Free License 3.0 and is available for Windows and Unix-like platforms (including Mac OS X). [9]

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. [10] Its integer is 64-bit. Unlike Java and C#, Fantom does not have Long or Short integer types. Fantom also does not support tuples. [11]

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. [12] 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. [13] 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. [14]

See also

Related Research Articles

<span class="mw-page-title-main">Java virtual machine</span> Virtual machine that runs Java programs

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

Java Platform, Standard Edition is a computing platform for development and deployment of portable code for desktop and server environments. Java SE was formerly known as Java 2 Platform, Standard Edition (J2SE).

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

<span class="mw-page-title-main">Eclipse (software)</span> Software development environment

Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development, and, until 2016, was the most popular. Eclipse is written mostly in Java and its primary use is for developing Java applications, but it may also be used to develop applications in other programming languages via plug-ins, including Ada, ABAP, C, C++, C#, Clojure, COBOL, D, Erlang, Fortran, Groovy, Haskell, JavaScript, Julia, Lasso, Lua, NATURAL, Perl, PHP, Prolog, Python, R, Ruby, Rust, Scala, and Scheme. It can also be used to develop documents with LaTeX and packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java and Scala, Eclipse CDT for C/C++, and Eclipse PDT for PHP, among others.

<span class="mw-page-title-main">Standard Widget Toolkit</span> Graphical widget toolkit for use with the Java platform

The Standard Widget Toolkit (SWT) is a graphical widget toolkit for use with the Java platform. It was originally developed by Stephen Northover at IBM and is now maintained by the Eclipse Foundation in tandem with the Eclipse IDE. It is an alternative to the Abstract Window Toolkit (AWT) and Swing Java graphical user interface (GUI) toolkits provided by Sun Microsystems as part of the Java Platform, Standard Edition (J2SE).

<span class="mw-page-title-main">Apache Groovy</span> Programming language

Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. Groovy uses a curly-bracket syntax similar to Java's. Groovy supports closures, multiline strings, and expressions embedded in strings. Much of Groovy's power lies in its AST transformations, triggered through annotations.

Jikes Research Virtual Machine is a mature virtual machine that runs programs written for the Java platform. Unlike most other Java virtual machines (JVMs), it is written in the programming language Java, in a style of implementation termed meta-circular. It is free and open source software released under an Eclipse Public License.

<span class="mw-page-title-main">Scala (programming language)</span> General-purpose programming language

Scala is a strong statically typed high-level general-purpose programming language that supports both object-oriented programming and functional programming. Designed to be concise, many of Scala's design decisions are intended to address criticisms of Java.

<span class="mw-page-title-main">Google Web Toolkit</span> Free Java library

Google Web Toolkit, or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. It is licensed under Apache License 2.0.

Google Developers is Google's site for software development tools and platforms, application programming interfaces (APIs), and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers using Google's developer products.

In software development, the programming language Java was historically considered slower than the fastest third-generation typed languages such as C and C++. In contrast to those languages, Java compiles by default to a Java Virtual Machine (JVM) with operations distinct from those of the actual computer hardware. Early JVM implementations were interpreters; they simulated the virtual operations one-by-one rather than translating them into machine code for direct hardware execution.

The Dynamic Language Runtime (DLR) from Microsoft runs on top of the Common Language Runtime (CLR) and provides computer language services for dynamic languages. These services include:

NekoVM is a virtual machine developed by Nicolas Cannasse as part of research and development (R&D) efforts at two independent video game developers in Bordeaux, France: first at Motion Twin and then at Shiro Games. NekoVM's native language is the bytecode for a high-level dynamically typed programming language called Neko. This pairing allows Neko to be used directly as an embedded scripting language, or to target NekoVM by compiling another language to NekoVM bytecode.

Griffon is an open source rich client platform framework which uses the Java, Apache Groovy, and/or Kotlin programming languages. Griffon is intended to be a high-productivity framework by rewarding use of the Model-View-Controller paradigm, providing a stand-alone development environment and hiding much of the configuration detail from the developer.

Mirah has been a programming language based on Ruby language syntax, local type inference, hybrid static–dynamic type system, and a pluggable compiler toolchain. Mirah was created by Charles Oliver Nutter to be "a 'Ruby-like' language, probably a subset of Ruby syntax, that [could] compile to solid, fast, idiomatic JVM bytecode." The word mirah refers to the gemstone ruby in the Javanese language, a play on the concept of Ruby in Java.

Gosu is a statically typed general-purpose programming language that runs on the Java Virtual Machine. Its influences include Java, C#, and ECMAScript. Development of Gosu began in 2002 internally for Guidewire Software, and the language saw its first community release in 2010 under the Apache 2 license.

References

  1. Blog post about history of Fantom
  2. "Fantom". 17 July 2023.
  3. FAQ of Fandoc language website
  4. Fantom FAQ: Contact Us
  5. "Fantom FAQ: Roadmap". Archived from the original on 2015-12-11. Retrieved 2012-03-29.
  6. Fantom FAQ: Why Fantom?
  7. History of Fantom programming language
  8. Fan is officially now Fantom
  9. McAllister, Neil (2012-01-03). "10 programming languages that could shake up IT". InfoWorld. Retrieved 2015-10-30.
  10. Java FFI at Fantom home page
  11. Tuples question at Fantom official page
  12. "Steve Eynon (MEng MIET) - Fantom Factory | LinkedIn". uk.linkedin.com. Retrieved 2023-12-14.
  13. "fwt – Fantom". Fantom.org. 2015-01-08. Retrieved 2015-10-30.
  14. "Escape the Mainframe!". escape.fantomfactory.org. Retrieved 2023-12-14.

Further reading