The New Wave book that is free online. I’d do it (I have even bought the Kindle version) but since @rickcarlino mentioned it, I wouldn’t want to “steal” any upvotes.
I also own the Nisan book, but I’ve never found time to seriously go through it.
The main thing people should learn about stack-based virtual machines is that you should never build a stack-based virtual machine. Register-based VMs are far more amenable to analysis and therefore to optimisation. Dalvik showed that the one advantage of stack-based VMs (code density) holds only when comparing naive implementations and a well-designed register-based instruction set can provide greater density than a stack-based one (Dalvik’s register-based encoding is smaller than the input stack-based JVM bytecode).
If you want to dive deeper on the subject of stack-based computation, a good free resource is Philip Koopman’s Stack Computers: The New Wave.
The whole thing is available online for free. Although it is dated, it has some good information still.
Thanks for the suggestion! I’ll take a look.
I’ve also been looking at Nisan and Schocken’s The Elements of Computing Systems.
Incredible book, highly recommended
I think you should post the link to the book as a submission by itself.
OK, I will. Thanks for the suggestion.
EDIT: It looks like it was posted 5 months ago. It seems that we crustaceans have an insatiable appetite for stack machines.
Are you referring to the Koopman text or The Elements of Computing Systems here?
The New Wave book that is free online. I’d do it (I have even bought the Kindle version) but since @rickcarlino mentioned it, I wouldn’t want to “steal” any upvotes.
I also own the Nisan book, but I’ve never found time to seriously go through it.
Thanks for the clarification! Probably better to have it posted by someone who’s read it – can’t say I’ve gotten there yet ;)
FYI, looks like the Koopman text has an existing story submission here (albeit from 2 years ago): https://lobste.rs/s/sxassm/stack_computers_new_wave_survey
The main thing people should learn about stack-based virtual machines is that you should never build a stack-based virtual machine. Register-based VMs are far more amenable to analysis and therefore to optimisation. Dalvik showed that the one advantage of stack-based VMs (code density) holds only when comparing naive implementations and a well-designed register-based instruction set can provide greater density than a stack-based one (Dalvik’s register-based encoding is smaller than the input stack-based JVM bytecode).