3 ms·
It's worth noting that Python uses bytecode just like Java does. Even the original Ruby implementation created an abstract syntax tree instead of interpreting
by panic 10y ago
It's worth noting that Python uses bytecode just like Java does. Even the original Ruby implementation created an abstract syntax tree instead of interpreting the text directly.
To answer the question in the title, maybe the reason nobody's writing runtimes is that the JVM is just too good? What impact does all the "baggage" have in practice?
- jesserayadkins2 10y agoWhile that first part is true, what's important when trying to target someone's vm is how easily that I can use it. Suppose I want to write a new language that uses Python's vm as the backend. * What files do I need to copy to get just the vm parts? * How do I prepare functions and objects for the vm to use? * What advantages do I get to targeting Python/Ruby/etc's vm? * Will I be able to embed the vm, or is the vm defined in a way that it depends on global data. Lua, for example, wraps everything into a state object. So if I extend Lua (which, if I recall correctly, Terra does), I can provide the same functionality upward. But if the vm relies on global data, then I can't provide an embeddable language that extends off of that.
- _RPM 10y agoI was about to say this. Thank you for clearing it up.
- gwright 10y agoJust a quick clarification regarding Ruby. All the major Ruby implementations (MRI, JRuby, Rubinius) use virtual machines in their current incarnations.
- panic 10y agoThanks, I clearly haven't used Ruby for a while. I edited the post to be clearer.
- steveklabnik 10y agoThis was one of the largest differences between 1.8 and 1.9, to give context for when this change happened in MRI. During the split, the original interpreter was "MRI" and the bytecode VM was "YARV", but once 1.9 shipped, YARV became MRI, even though it was basically rewritten. Yay naming!