About the zoo
The Programming Languages Zoo is a collection of miniature programming languages which demonstrates various concepts and techniques used in programming language design and implementation. It is a good starting point for those who would like to implement their own programming language, or just learn how it is done.
The following features are demonstrated:
- functional, declarative, object-oriented, and procedural languages
- source code parsing with a parser generator
- recoding of source code positions
- pretty-printing of values
- interactive shell (REPL) and non-interactive file processing
- untyped, statically and dynamically typed languages
- type checking and type inference
- subtyping, parametric polymorphism, and other kinds of type systems
- eager and lazy evaluation strategies
- recursive definitions
- interpreters and compilers
- abstract machine
See the installation & compilation instructions.
The following languages are on display:
- like miniml that can also abort execution
- lazy, functional, integers, booleans, lists, recursion, statically typed
- logic programming, Horn clauses, unification
- call-by-push value, statically typed
- A procedural language with integer arithmetic, local variables, conditional statements,
- integer arithmetic
- eager, mutable records, statically typed, subtyping
- object-oriented, eager, first-class functions, dynamic types, extensible objects
- untyped λ-calculus, several evaluation strategies
- integer arithmetic
- eager, functional, recursive functions, statically typed, compiler, abstract machine
- lazy, functional, statically typed, parametric polymorphism, type inference
The languages are not really meant to be used. Rather, you should read and study the
source code, which is decorated
with ample comments. Also, each language
lang has its own
example.lang in the subdirectory
Nevertheless, all the language are fully functioning miniature versions of real languages
and can be executed. For each language
lang you can:
see what command-line options are available with
run the toplevel with
run files non-interactively with
./lang.native <file> <file> ...`
load files and enter the toplevel
./lang.native -l <file> -l <file> ...`
The project is open source and released under the permissive MIT license.
New contributions are very welcome. If you would like to contribute to the project, please contact us through the GitHub project page:
- If you discover a problem, open an issue.
- Even better, fix the problem and submit a pull request!
- If you would like to help but do not know how, have a look at open issues and volunteer to resolve one.
- If you have an idea for a new language, we will be happy to take it in. Please note that all the languages are purposely kept simple for educational purposes.
Before you contibute a new langauge, please read these guidelines for contributing.