[Best viewed with any browser]

The Epigram Supercombinator Compiler

Introduction | Where to get it | Documentation

Introduction

ESC, the Epigram Supercombinator Compiler, is a simple functional language which compiles to efficient (well, maybe!) C code. The primary aim is to develop a back end for Epigram, but it will (I hope, eventually) be useful to anyone looking for a back end for a functional language.

Programs consist of a number of supercombinator definitions, e.g. the canonical factorial example or this list program. The main function is evaluated when the program is run. Some important language features to note:

Future plans are, in no particular order: optimisations (tail calls especially), reduction under lambdas (a la Gregoire & Leroy), more primitive types, dynamic loading of compiled code, unboxed values, control of evaluation order, arbitrary precision arithmetic, better C API, etc ...

Where to get it

For now, just a darcs repository, with the usual warnings about research quality code, etc:

To build it:

You'll need GHC 6.4, happy, the Boehm garbage collector library and the GNU MP arithmetic library. You'll also need gcc, since the compiler outputs C code. Please let me know how you get on! I've tested this on Linux (Debian sarge) and Mac OS X 10.4. Packages for all the required libraries are available for both.

Documentation

There is an API (haddock generated documentation) and a command line tool. The API is currently minimal, but will eventually be extended to allow building of syntax trees from Haskell programs, rather than requiring an ASCII source file.

The command line tool, esc takes a source file and produces executable code, via C. Separate compilation is supported, in a fairly simple way, e.g. to compile a main program main.e which includes some functions defined in lib.e:


Edwin Brady -- eb@cs.st-andrews.ac.uk -- 23rd July 2006