Skip to content

Comment on Virtual Machine Showdown: Stack Versus Registersparent

Comments

It's still harder to write compilers for them. Stack based forms are easy, you push the data onto the stack and pop it again when you need it, and the VM's compiler handles the heavy lifting. With a register form, specifically where you have an infinite number of registers, you are effectively doing SSA in your compiler to map onto 'registers' (SSA variables) and writing out the raw intermediary form. Stack based forms are simply easier to write front-end compilers for.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.