Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Byte code stack versus three address

When designing a byte code interpreter, is there a consensus these days on whether stack or three address format (or something else?) is better? I'm looking at these considerations:

  1. The objective language is a dynamic language fairly similar to Javascript.

  2. Performance is important, but development speed and portability are more so for the moment.

  3. Therefore the implementation will be strictly an interpreter for the time being; a JIT compiler may come later, resources permitting.

  4. The interpreter will be written in C.

like image 482
rwallace Avatar asked Jun 16 '11 00:06

rwallace


1 Answers

Read The evolution of Lua and The implementation of Lua 5.0 for how Lua changed from a stack-based virtual machine to a register-based virtual machine and why it gained performance doing it.

like image 52
lhf Avatar answered Sep 22 '22 02:09

lhf