|
5 | 5 | **Clo**sure **calc**ulus is an interpreted functional programming language. |
6 | 6 | See [test/](test/) for code examples (`*.clo`). |
7 | 7 |
|
8 | | -## syntax, semantics, and implementation |
| 8 | +## syntax |
9 | 9 |
|
10 | 10 | ``` |
11 | 11 | <comment> := #[^\n]*\n |
@@ -33,32 +33,9 @@ See [test/](test/) for code examples (`*.clo`). |
33 | 33 | | @ <variable> <expr> // accesses a closure's environment variable |
34 | 34 | ``` |
35 | 35 |
|
36 | | -+ AST-traversal based interpreter; no bytecode. |
37 | | -+ 4 object types: Void, Integer, String, Closure. |
38 | | - Structs can be realized by closures and `@`. |
39 | | -+ Variables are references to objects, |
40 | | - but behave like values because objects are immutable. |
41 | | - Variables cannot be re-bound. |
42 | | -+ `letrec` and `( <callee> <expr>* )` evaluate from left to right |
43 | | - and use pass-by-reference for variables. |
44 | | -+ Threshold-based tracing garbage collection with memory compaction. |
45 | | -+ Tail-call optimization, |
46 | | - closure size optimization (omitting unused environment variables), |
47 | | - literal object pre-allocation. |
48 | | - Note: for better error messages during debugging, |
49 | | - use `letrec` to rewrite tail calls to |
50 | | - preserve stack frames. |
51 | | -+ The runtime state (including stack, heap, etc.) |
52 | | - is copyable and movable, and can be executed step-by-step. |
53 | | - So it's easy to suspend/resume executions. |
54 | | - |
55 | 36 | ## dependencies |
56 | 37 |
|
57 | | -The debug mode uses Clang-specific flags, |
58 | | -so we use Make instead of CMake. |
59 | | -This project was tested on Linux and macOS, |
60 | | -but should also compile on Windows |
61 | | -if you adjust the build tools. |
| 38 | +This project was tested on macOS. |
62 | 39 |
|
63 | 40 | + `clang++` with C++20 support |
64 | 41 | + `make` |
|
0 commit comments