Skip to content
David Jeske edited this page May 9, 2017 · 67 revisions

The Irken Language

Irken is a simplified, statically-typed dialect of Scheme. It uses an ML-like type system supporting parametric polymorphism (i.e., "let polymorphism"), algebraic datatypes, and row polymorphism (a form of structural types). With type inference and a pattern-matching syntax, it could be considered ML with a lisp/scheme syntax. For the motivation behind Irken, see History.

If you prefer to jump right to the action, skip to the Simple Code Examples

We think Irken is cool because:

  • type-declarations are not required -- like in Python, Ruby, Javascript, or Clojure
  • type errors are reported at compile time -- like in Haskell, Java, C#, or C++
  • objects are compatible because of their structure -- like OCaml or Google Go
  • null values are not allowed -- like in Haskell, ML, OCaml, or Rust
  • it has exhaustive pattern matching -- like Haskell, ML, OCaml, or Rust
  • it uses heap allocated stack frames -- like Scheme, Google Go, or Stackless Python

The compiler and libraries are distributed under a simplified BSD License.

Features

Syntax

Irken's syntax is nearly identical to Scheme's. The main differences are:

  • postfix array-indexing (e.g., (+ x[i] y[i]))
  • record literals and field access, e.g. {field0=10 field1="foo" field2="bar"}, a.field1
  • colon (:) is a reserved character, it identifies constructors.
  • pattern-matching expressions and function definitions, which use ->

[A few other discrepancies will remain undocumented in the hope that they will someday be fixed]

Restrictions

  • Lists are monomorphic, all elements must be of the same type
  • No function overloading or multi-methods. Each function has a single type signature.
  • No runtime dynamic casting. It's not possible for a function to take any type.
  • No unified type system. Immediate types such as number, char, and string are not objects.
  • (Currently) No runtime reflection information. Information can be built and saved by macros.
  • (Currently) No REPL loop. All programs are compiled.

Next: Simple Code Examples


References

Clone this wiki locally