-
Notifications
You must be signed in to change notification settings - Fork 17
Home
David Jeske edited this page May 9, 2017
·
67 revisions
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.
- Strongly Static Typed, with Global Type Inference
- Garbage Collected, currently with a Cheney two-space copying collector
- Parametric types (Generics) and Row Polymorphism (Structural Typing), see Datatypes
- First Class Continuations, enabling many features, including very lightweight concurrency
- Exceptions
- No NULL pointer exceptions, see Type Recursion and null
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]
- 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
- Scheme on Wikipedia
- R6RS - Revised 6 Report on the Algorithmic Language Scheme
- Racket PLAI Typed - another typed scheme variant