5 ms·
I guess the difference is that the bytecode is executed by the interpreter and an intermediate representation typically isn’t executable?
by meheleventyone 5y ago
I guess the difference is that the bytecode is executed by the interpreter and an intermediate representation typically isn’t executable?
- SigmundA 5y agoWell some processors can execute Java byte code directly, and most of the time its jitted, however originally it was just interpreted.
- Twirrim 5y agoDoes anyone actually do that other than Transmeta back at the turn of the millenium?
- SigmundA 5y agoNot really anymore but many phones had Jazelle capable processors in the mid 2000's: https://en.wikipedia.org/wiki/Java_processor https://en.wikipedia.org/wiki/Java_processor
- deleted 5y ago[deleted]
- KMag 5y agoI think the most useful definition is that a program representation is an intermediate representation if its primary raison d'etre is as a starting point for building other program representations. (We assume source code has dual purposes of being edited/reviewed and also as the starting point for later program representations, so human-edited source code wouldn't be considered intermediate. On the other hand, JavaScript used as an implementation detail for some high-level language compiled to WASM would be considered an intermediate representation.) In this case, if they didn't have an interpreter, they'd probably use an abstract syntax tree or control flow graph as their common source of truth for their two compilers. So, the primary reason the bytecode exists is to be interpreted by the interpreter and therefore isn't intermediate.