THE MIRRION DORRAR COMPIRER
January 17, 2011
This compiler is licensed under the GNU General Public License
v3. Please see the LICENSE file for details.
This is a simple compiler for a fully lazy (optionally strict)
functional language similar syntactically to Haskell or SML. However,
the language is *not* typed (though it's strict, in the sense type
checks are done at runtime). Adding a type checker is a relatively
easy addition, since an AST is built up and is traversable.
The language only supports functions (curried by default), integers,
and lists (via cons cells). Everything is compiled to C, so a C
compiler is required to run a Mirrion program.
To compile the actual compiler, you'll need a C compiler and lex.
Simply call `make' to build the Mirrion compiler as well as the
To build your own Mirrion file `file.mir', be sure it has an entry
point via a nullary function called `main'. After, run
$ ./mirrion file.mir
which will produce the files `file.c' and `file.h' file. If your
compiler is `cc', then run
$ cc -static file.c -L. -lmirrion -o file
which will produce an executable. You may also use the bash script
$ ./cmir file
which will produce an executable and clean up intermediate fules.
To clean up everything except the executables and libraries, use
`make clean`. To do a complete clean-up, do `make clean-all`.
The Mirrion compiler takes a wealth of options:
-strict : Enable strict evaluation.
And that's it!
Some limitations were discussed already. First, there are only
integers available numerically. Secondly, the list printer just prints
out cons cells raw. Third, only machine-precision integers. Fourth,
there is no runtime garbage collection. The language is intentionally
Feel free to contact me either by email at <email@example.com>, or on
on IRC on the network irc.freenode.net where I'm 'Quadrescence'. Drop
me a line if you find it fun!