X-Git-Url: https://git.lukelau.me/?p=scheme.git;a=blobdiff_plain;f=typecheck.md;fp=typecheck.md;h=c892a597eb7a75eb7790caebf0afd62c252ca858;hp=0000000000000000000000000000000000000000;hb=05682b323f3365dba3f7f0192016f1d05152b418;hpb=ab0b66e68a85e8e71442ee70a81c16d04e66145d diff --git a/typecheck.md b/typecheck.md new file mode 100644 index 0000000..c892a59 --- /dev/null +++ b/typecheck.md @@ -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