Add notes on typechecking
authorLuke Lau <luke_lau@icloud.com>
Tue, 30 Jul 2019 21:25:31 +0000 (22:25 +0100)
committerLuke Lau <luke_lau@icloud.com>
Tue, 30 Jul 2019 21:25:31 +0000 (22:25 +0100)
typecheck.md [new file with mode: 0644]

diff --git a/typecheck.md b/typecheck.md
new file mode 100644 (file)
index 0000000..c892a59
--- /dev/null
@@ -0,0 +1,12 @@
+# lets
+
+Lets bindings are recursive, and so to handle this the typechecker
+first creates a dependency graph of the bindings with `graph`.
+
+The strongly connected components are then computed with `scss`, and
+then when creating the environment for the let body:
+
+1. For each strongly connected component (scc) 
+2. Insert the offsets of each component in the scc into the environment
+3. Codegen the bindings in the scc
+4. Pass on the environment to the next scc