11 ms·
This is the case only if the new interpreter does not simply include the layer that the old interpreter has for translating bytecode to native instructions. On
by SJC_Hacker 6mo ago
This is the case only if the new interpreter does not simply include the layer that the old interpreter has for translating bytecode to native instructions. Once you have that, you can simply bootstrap any new interpreters from previous ones. Even in the case of supporting new architectures, you can still work at the Python level to produce the necessary binary, although the initial build would have to be done on an already supported architechture.
- direwolf20 6mo agoInterpreters don't translate bytecode to native instructions.
- SJC_Hacker 6mo agoThe usual understanding of "interpreter" in a CS context is program that executes source code directly without a compilation step. However the binary that translates an intermediate bytecode to native machine code is at least sometimes called a "bytecode interpreter". https://doc.pypy.org/en/latest/interpreter.html https://doc.pypy.org/en/latest/interpreter.html
- ghusbands 6mo agoThis is still incorrect. A bytecode interpreter, as its name indicates, interprets a bytecode. Typically, compiling a bytecode to native machine code is the work of a JIT compiler.
- genxy 6mo agoThey do now https://github.com/bytecodealliance/weval https://github.com/bytecodealliance/weval
- ghusbands 6mo agoThat's a partial evaluator, not an interpreter, and it converts an interpreter into compiler, which are different things.
- genxy 6mo ago> Interpreters don't translate bytecode to native instructions. > That's a partial evaluator, not an interpreter, and it converts an interpreter into compiler, which are different things. https://old.reddit.com/r/Compilers/comments/1sm90x5/retrofitting_jit_compilers_into_c_interpreters/ https://old.reddit.com/r/Compilers/comments/1sm90x5/retrofit...
- ghusbands 6mo agoYes, that's another great example of the same kind of thing - creating a JIT from an interpreter. It remains true that interpreters do not directly generate machine code.
- genxy 6mo agoThe author of weval is the top comment. Reading the comments and understanding that transitively, weval turns interpreters into compilers, allowing interpreters to generate machine code.
- direwolf20 6mo agoIf you turn milk into cheese it isn't milk any more, and it doesn't prove that milk is a yellow solid.
- genxy 6mo agoWe lost the plot here. What are your goals, to let everyone know that interpreters, definitionally don't generate code? This isn't debate club. I dropped a cool link that shows we have a machine that turns interpreters into compilers. I am talking about the machine. You are talking about the definition. We aren't talking about the same thing.
- ghusbands 6mo agoPartly, it's simply that words matter. An interpreter is not a compiler, even if partial evaluators and Futamura transforms are very cool. Posting about them in a context that isn't a confusion about what interpreters are may have been more fruitful.