Previous implementation was directly including primops into the
generated intermediate code, which involved unboxed literal arguments.
These fake builtins allow for generating boxed literals so that no
unboxed data is on the surface stack.
I believe this was the last source of unboxed data on captured stacks.
This covers values that are stored as pseudo data types in the Haskell
runtime, which would otherwise need to be serialized using unboxed data
in the byte format.
The implementation was producing Maybe, but the calling convention just
called the primop in tail position. This would leave the Just tag on the
unboxed stack afterwards.
The goal of these changes is to remove unboxed details from the
interchange formats, and instead exchange values that somewhat resemble
surface level unison values. In some cases, the way this works is
obvious. For instance, the MatchNumeric/NMatch and BLit constructs avoid
having unboxed details in code. However, what might not be so obvious is
the request/data matching constructs. These prevent unboxed values from
occurring on the stack in normal unison functions, which means they no
longer end up in captured continuations.
The unboxed details were originally intended to support optimizations
that would turn surface unison functions into more efficient versions
that operate without any boxing. However, that didn't materialize, and
it seems unlikely that we'll implement it for the Haskell end of things
(we aren't really obliged to do this ourselves for good performance in
scheme). So, some of these new methods of doing things might actually be
more efficient than what was happening previously.
Replaced some macro-generated stuff with a racket match. At the same
time, factored out part of the monolithing definition.
This was necessary because the dynamic code loading doesn't use the
unison function to generate an entire module, and instead uses the
functions to generate individual definitions and such. So, the decoder
for the individual pieces needs to be available.
Also filled in some missing reflection cases revealed by new tests, and
implemented some expected functionality from unison code changes.