Machine-Code Reflection (RFC)

Joseph Bowers
Mon, 05 Jun 2000 20:44:58 +0000

This is just a request for comment/maybe something I've
missed in the review project...

Someone recently brought up a problem with Squeak on this
mailing list- the squeak core is compiled from Smalltalk to
C, and then from C to machine code, and isn't really accessable
from the squeak environment anymore- I've never messed with
squeak (or written a compiler) but this seems to speak to
a pretty big general problem- something of some kind, a VM/Kernel
or whatever (even a Tunes/LLL interpreter) is going to be written
in Assembler, or compiled, or somehow end up represented as
a bitstring interpretable by some chip. This seems to want to
be pretty opaque.

How might reflexive machine code be handled? There is going
to have to be a little bit present, and it seems kind of sad
to have some involate core at the center of the system. I suppose
something like

some code...
JMP past_comment
metadata here
past_comment: more code

is reasonable, as is accompanying all code segments with descriptor
segments or something, but I haven't a clue as to the details of
how this has been done in the past, or how it might be done, or
how to get out of having to do it without sacraficing some important

How has this been approached?