I'm thinking of writing a toy language based on lambda calculus. I want it to be lazily evaluated. I/O is not a concern for now;
main will be a pure function that converts some input to some output (e.g.
main :: int -> int will take an integer from stdin, apply the function on it, and print the result to stdout).
I have done some research on how to run a lazy lambda calculus, but all of my search efforts ended at:
- G-machine or TIM, as in this "tutorial" which is nice and well documented but from 1990s, or
- STG which is famous for being the model of GHC Haskell, but with hardly any material that talks about what it really is and how it can be implemented.
Requirements for my language are:
- I want it to run arbitrary lambda terms. This rules out HVM for example (issue #44).
- Being able to use integer values and/or data constructors would be nice (as in the Core language as defined in the "tutorial" above).
Are there any other kinds of backends or runtimes for lazily evaluated lambda calculus, developed in 2000s or later and satisfying the requirements?