A toy implementation of SECD machine in OCaml
- View SourceHi there,
I guess this is better posted here rather than the official list.
I just made a toy implementation of Landin's SECD machine in OCaml. You can
get the src and doc at http://www.pps.jussieu.fr/~li/software/index.html#secd
It's coded in quite a hurry. I haven't got time to test it thoroughly, but so
far it works fine over the examples I fed.
SECD is a toy implementation of SECD machine in OCaml. It tries to follow the
original definitions in Landin's seminal paper . The main purpose is just
"for fun". Features include:
* Type safe: SECD terms are typed
* Inter-operation: any OCaml value can be wrapped as a SECD term, and any
SECD term can be evaluated (through the machine) to its corresponding OCaml
* Two evaluation strategies: call-by-value/call-by-name optional
* Simple: ~100 LOC
 Peter J. Landin. The mechanical evaluation of expressions. Computer
Journal, 6(4):308-320, January 1964.