A denotational semantic based interpreter for the REC
programming language described in the 9th chapter of the book “The formal semantics of programming languages” by G. Winskel, The MIT Press, 1993.
.
It relies on the Kleene-Knaster-Tarski fixpoint iteration sequence for evaluating programs.
The interpreter can perform lazy and strict evaluation of programs.
A programs consists of many function declaration and constants:
myFunction(param1, param2) = param1 + param2
pi = 3
And a main expression a the bottom:
myFunction(1, 2)
You can find some example programs in the directory examples
.
stack build
Then add the rec-exe
binary in your path.
Run a program:
rec-exe path/to/src
Run a program using lazy evaluation:
rec-exe -- path/to/src -l
You can force the strict evaluation with the flag -s
but it's already the default.
(You can also just replace the rec-exe
command with stack run --
if you are in the root directory of the project)
None.