- This is necessary for dynamically loading intermediate code during
execution. Local assignments of various code are now stored in
transactional variables that can be mutated as necessary.
- Various functions for adding to this cache have naturally been moved
to the machine implementation rather than the interface. The interface
mainly retains functions for keeping track of mappings between the
surface and intermediate levels, which won't be updated during
execution.
- Helper functions for finding references in intermediate code have been
added, since we may not have surface terms for some intermediate code
we're dealing with.
- Terms have been monomorphized to Symbol for this caching, just for
simplicity.
- A let may be classified as either Direct or Indirect. Indirect lets
contain a number, so that we can represent their return location in a
continuation. Direct indicates that this is not necessary.
- Currently, only simple direct lets are allowed, which may be turned
into individual instructions. This is because anything else still
requires stack/continuation management, and would require additional
code forms to represent compound expressions that involve only local
instructions.
- This obviates generating these numbers in the MCode translation.
Instead, the relevant lets are numbered with Word16s, and each section
gets 48 bits for numbering, while their lets use the low 16 bits for
identification.
I was puzzled about the change to the blocks.md transcript at first. What's happening: the previous version of the transcript was going through TDNR, and was failing the cycle check for mutually recursive lambdas. The new version isn't going through TDNR at all, it's just doing ordinary typechecking of a cycle, and cycles don't have access to any abilities so it's failing with the expected error now. Arguably, the example should have used the FQN so TDNR wasn't involved in the previous example.
- Previously we were ensuring that a `let` does not immediately contain
another `let`. However, there is actually no need for this from the
perspective of the machine code. Removing this requirement makes the
definition somewhat less complicated.
- Includes some preparation for numbering lets for continuation
serialization.