The Programming Language Zoo

On this page you will find on display a number of mini languages which demonstrate various techniques in design and implementation of programming languages. The languages are implemented in Objective Caml.

I teach Theory of Programming Languages (page in Slovene) at the Faculty of Mathematics and Physics of University of Ljubljana. For the course I implemented languages which demonstrate basic concepts such as parsing, type checking, type inference, dynamic types, evaluation strategies, and compilation. My teaching assistant Iztok Kavkler contributed to the source code as well.

The languages are not meant to compete in speed or complexity with their bigger cousins from the real world. On the contrary, they are deliberately very simple, as each language introduces only one or two new basic ideas. You should find the source code useful if you want to learn how things are done.

Visit the PL Zoo discussion at my Mathematics and Computation blog to ask a question or leave a comment.

Andrej Bauer

calc

Last update: 2008-05-06
A simple arithmetic calculator. It handles addition, subtraction, negation, multiplication and division of integers.
Download source: calc.zip
View source online (126 lines)

miniml

Last update: 2008-05-06
A simple eager purely functional language with integers and booleans as base types. Functions can be recursive so the language is Turing complete. Programs are compiled and executed by an abstract machine, akin to Landin's SECD machine.
Download source: miniml.zip
View source online (608 lines)

minihaskell

Last update: 2008-05-06
A simple lazy purely functional language. The implementation contains a parser, type-checker, and an efficient interpreter. The language has integers, booleans, lists, pairs, functions, and a general fixpoint operator.
Download source: minihaskell.zip
View source online (698 lines)

boa

Last update: 2008-05-07

An object-oriented language with eager evaluation, first-class functions, and dynamic types. It is based on a notion of objects as mutable and extensible records. There are no classes.

An interesting feature of the language is that, since "everything is an object", a value may behave simultaneously as an integer, boolean, function, and a record. This is reminiscent of intersection types.

Download source: boa.zip
View source online (512 lines)