On Wednesday, April 27, 2022 at 10:47:55 PM UTC-5, luserdroog wrote:
Darnitall. It's pretty. But I think it's not going to work.
I can't mutate suspensions into other types behind
the scene because the type is coupled into the handle.
If the handle is just a pointer to a tagged union, then
I can swap the unions in memory to change the
suspension object into some other object and this
works no matter how many times the suspension
is referenced.
With the tag pulled out to the front, then the tag may
exist in multiple places in memory, one coupled to
every reference. But I don't have an easy list of those
to patch. Some may be in automatic memory in the
call stack. Some could have already been virtualized
and disappeared.
Such a pretty design, sigh. I guess it's back to pointers.
I'm not sure how I can implement lazy evaluation
without mutating the memory representation behind
the scenes.