An Interface to LFPL Prototype Compiler by Nick Brown
This form allows you to try out Nick Brown's prototype
implementation of the programming language described in Martin
A type system for bounded space
and functional in-place update
presented at ESOP'00.
Things to note
Type a program
or start with the
(reverse, quick, treesort, flatten, breadth, bad, io)
For the concrete syntax see page 18 of Nick Brown's
The generated code consists of C-functions between integers,
lists, binary trees. To get a C executable these must contain
a function named main of type ()int. In order to get useful
standalone programs the following built-in primitives have
See file io in the examples directory for an application.
new : ()diamond . Generates a "diamond"
disp : (diamond)int . Frees one diamond,
read_int : ()[int,int] . Reads an integer x
from stdin. Returns [1,x] if successful and [0,?]
print_int : (int)int . Prints an integer to
stdout. Returns 0.
). Prints a
The semicolon operator: e1;e2 evaluates e1, then e2,
returns value of e2.
The generated code represents lists as structures containing a
field kind. The empty list is represented as a structure with
kind field equal to NIL. The generated code thus does not use
the optimisation which represents the empty list as a NULL
The implementation does not check that all functions declared
This is experimental code and likely to be changed.
Other compilers available:
by Robert Atkey
Back to the main project page.
Last modified: Fri Feb 21 14:30:18 GMT 2003