Whitespace is a stack machine with a heap store, control flow by labeled jumps and a call stack, and mixed eager and lazy evaluation.
The stack size is control-flow-dependent.
I first solved this in Nebula, then adapted it for lazy operations in lazy-wspace.
There is no strict definition of a function. A function could be defined as a
CFG, entered with a call
and exited with a ret
or by diverging. However,
this breaks down when considering that other labels within the “function“ could
also be called, which means that its ret
s could be paired with multiple
entrypoints.
Similarly to how Graal handles irreducible loops (those with multiple entries), I could duplicate bodies, for each entry, to have clearly-demarcated functions, but I’m wondering if there’s a better way.
List problems and how I solved them or why they’re not solved.
Write out instructions and their IR mappings.