Skip to content

dvanhorn/ubik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Small Scheme interpreter and compiler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published