All Projects → dvanhorn → ubik

dvanhorn / ubik

Licence: other
Small Scheme interpreter and compiler

Programming Languages

ocaml
1615 projects
Makefile
30231 projects
scheme
763 projects
Standard ML
205 projects

Ubik

Build Status

A small Scheme interpreter and compiler, written in OCaml, for illustrative purposes.

Programs are of the form:

<prog> ::= <defn>* <expr>
<defn> ::= (define <id> <expr>)
        |  (define (<id>+) <expr>)
        |  (struct <id> (<id>*))
<expr> ::= <int>
        |  #t
        |  #f
        |  <id>
        |  (<expr>+)
        |  (lambda (<id>*) <expr>)
        |  (if <expr> <expr> <expr>)
        |  (match <expr> (<pat> <expr>)*)
<pat>  ::= (<id>+)

The implementation supports: arbitrary precision integers, higher-order functions, structures, simple pattern matching, some arithmetic operations (+, add1, sub1, =, expt), and list operations (list, cons, car, cdr, null, null?, pair?).

To build and run:

   make
   ./ubik
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].