EmbeddedML

This SourceForge project allows functional programmers to compile functional programs that can be run on small hobbyist class machines. This compiler was initially developed by the Principles of Programming Group at Carnegie Mellon University by the folks who brought you the 2006 ICFP programming contest. Two new backend code generators for C and Forth allow the compiler to take on a new role for functional programmers wanting to target small machines. The compiler can only currently target 32-bit machines; however it has been used to compile several fairly large applications, including:

If you're interested in using the compiler, follow these instructions to obtain and compile it. Building the compiler is hopefully not terribly painful, but it does require that you have the MLton SML compiler installed, as well as Subversion and the GNU C Compiler (gcc).

It is easy to compile functional programs for small hobbyist class machines as long as the cross compilation tools are available.

The following steps can be used to compile the compiler.

  1. Get MLton installed on your machine. The instructions for doing this are provided by the MLton folks. It is also a package within many GNU/Linux distributions.
  2. Make a working directory on your machine called "mlhacking" or something similar.
  3. cd mlhacking
  4. Check out (via subversion) tom7's sml-lib Standard ML library routines using the following command:
  5. svn co https://tom7misc.svn.sourceforge.net/svnroot/tom7misc/trunk/sml-lib sml-lib
  6. Check out (via subversion) the EmbeddedML project:
  7. svn co https://embeddedml.svn.sourceforge.net/svnroot/embeddedml/trunk embeddedml
  8. cd embeddedml
  9. Compile the EmbeddedML compiler using the following command:
  10. make

The compiler has been built, and it is named "mlc.exe". Now, following a link below to see an example for various platforms.