@@TITLE DGD Driver Details@@

Miscellaneous DGD Driver Details

There are always a few mixed bits in any bag that don't fit anywhere very exactly. These are random details about how the DGD Driver does what it does that don't seem particularly relevant anywhere else.

In the original DGD, the interpreter had only 32 instructions. Kfuns were not part of the interpreter proper. I don't know if that's still true.

Mappings are partially hashed. If a mapping grows by assigning to an index that doesn't exist yet, the index-value pair is stored in a hash table. Mappings are converted to sorted arrays of index-value pairs when swapped out.

The compiler is two-pass. In the first pass, the function is typechecked and a parse tree is constructed. Constant folding and removal of dead code is done. In the second pass, code for a virtual stackmachine is generated. Jumps to jumps are optimized. Optionally, the second pass may generate C code.

String hash table sizes are powers of two. They used to be primes, which is fairly pointless in this implementation.

Divided allocated memory into 'static' and 'dynamic' memory. Static memory is used for things which need to be kept when everything is swapped out, and dynamic memory is used for the rest.

@@INCLUDE another_brief_question@@