How to think about compiling
uptointerpretation.com
uptointerpretation.com
Edit: anything targeting PDP-8 native code could be considered to target a reduced ISA, but I don't think any of those were really mainstream. PDP-7 as a target looks like a pretty vanilla ISA to me?
And what do you mean that the PDP-8 had a "reduced ISA"?
I'm utterly puzzled here.
PDP-8 I was just guessing at trying to figure out what you meant, not realising we were talking about different implementations. (thinking you might have meant ISAs were simpler back then — IIRC PDP-8 ISA is not very different from the very small bytecode Wirth's mini Pascal interpreted [edit 2: cf infra], but PDP-7 ISA, while simpler than modern ones, is in my eyes only quantitatively and not qualitatively so)
In any case, the biggest transformation is from a tree-structured AST down to a linear (associative) sequence of data and ops, and if one has learned how to do that for an interpreted bytecode, it's plug-and-chug to do the same for a native ISA.
[0] https://www.cl.cam.ac.uk/~mr10/BCPL.html
Edit: [1] sorry, got my names confused. Wirth's is PL/0. See bottom of page at http://pascal.hansotten.com/niklaus-wirth/pl0/
also, I just realised the confusion with the other concept of virtual machine in terms of guest supervisor levels. I was using the virtual machine which was virtual in the sense that it is program, not machine, interpreted and hence usually designed to be an easy target.
Edit 2: eg the PL/0 virtual machine ops:
lit 0,a : load constant a
opr 0,a : execute operation a
lod l,a : load varible l,a
sto l,a : store varible l,a
cal l,a : call procedure a at level l
int 0,a : increment t-register by a
jmp 0,a : jump to a
jpc 0,a : jump conditional to aEven trivial compilers like that are fun to work on, as reminders of the low-level facilities available.
Here's the neat part: you don't!
JVM is built on C syscalls.
Ahh, it's a work of parody. :)