working version (It runs these tests and these fairly complex programs.) The program uses several language features beyond official C but found in recent gcc compilers.

The recursive routine compile compiles an expression into a coded form described here. It is your typical ugly ad-hoc parser. It cannot be expanded much beyond its current state. It is, however, small and does not depend on external state of the art of parsing. compile uses stack space proportional to the maximum depth of the input. There is no garbage collection and you can exhaust the working space of worksize (=100000) environ units or stack space. The compiled code must fit in codesize (=5000) bytes. Lexical scoping may not exceed a depth of md (=100).

The recursive routine eval evaluates a coded expression. Its two arguments are:

cp x
which locates the code compiled from the corresponding expression,
env * e
which provides the environment which gives values to all of the free variables within the code body.
eval uses stack space proportional to the number functions dynamically called.

On the Mac the library routine getchar() returns the next 8 bit byte from a utf-8 coded stream of unicode characters, which might be coming from a file or from terminal input via a paste operation.

Hasseling with recursive types in C
Reads utf-8 input
Optional printing for debugging.

In lieu of make: source comp