M
Marco Devillers
Hi all, this must be one of the oldest questions in the book, but the
following:
I wrote a compiler. Values are either pointers or -opaque to the
compiler- series of size tagged bits. It works, it's slow, it's hardly
portable since the compiler needs to know the C bit representation of
values, I want to get rid of that.
So, I want more portable code, and, as most compiler writers, I want
to represent possible values as a type tagged sum, a variant record
where each concrete value is represented with a minimal number of bits
run-time.
What is the best portable manner for that? I thought overlaying
structures? Which compilers allow for initial segments of structures
to overlap unambiguously?
Cheers, Marco
following:
I wrote a compiler. Values are either pointers or -opaque to the
compiler- series of size tagged bits. It works, it's slow, it's hardly
portable since the compiler needs to know the C bit representation of
values, I want to get rid of that.
So, I want more portable code, and, as most compiler writers, I want
to represent possible values as a type tagged sum, a variant record
where each concrete value is represented with a minimal number of bits
run-time.
What is the best portable manner for that? I thought overlaying
structures? Which compilers allow for initial segments of structures
to overlap unambiguously?
Cheers, Marco