Fantom is an actively used programming language created in 2005.

14Years Old 2,425Users 2Jobs

Example code from Linguist:

/*
 * Author: Robert Koeninger
 * License: WTFPL (http://www.wtfpl.net/)
 */

mixin Expr
{
  abstract Obj? eval()
}

class Constant : Expr
{
  Obj? value

  new make(Obj? value) { this.value = value }
  override Obj? eval() { value }
}

enum class Op
{
  plus,
  minus
}

class Infix : Expr
{
  Op op
  Expr left
  Expr right

  new make(Op op, Expr left, Expr right)
  {
    this.op = op
    this.left = left
    this.right = right
  }

  override Obj? eval()
  {
    switch (op)
    {
      case Op.plus:
        return (Int)left.eval() + (Int)right.eval()
      case Op.minus:
        return (Int)left.eval() - (Int)right.eval()
      default:
        throw Err("undefined Op")
    }
  }
}

Example code from Wikipedia:

// Hello from Fantom!
class HelloWorld
{
  static Void main()
  {
    echo("Hello, World!")
  }
}
Edit

Last updated February 11th, 2019