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. The source code is released under the BSD open source license (see accompanying file COPYRIGHT.txt).
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 assistants Iztok Kavkler and Matija Pretnar 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.
The PL Zoo is now available through at PL Zoo repository (Mercurial).
errorvalue. Division by zero results in
error, which then acts as an exception. There is no way to intercept
erroror to throw it directly.
See also Poly, which is an extension of MiniHaskell with polymorphic types and type inference.
Poly is very similar to MiniHaskell. The only difference is that it infers polymorphic types.
Sub is an extension of MiniML.
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.
example.levyfile for details about syntax.