4 ms·
Trying to optimize parsing binary interpretation is a lost cause. The problem with pure virtual machines is they're basically meta-macrocode are mappable back t
by tinglymintyfrsh 4y ago
Trying to optimize parsing binary interpretation is a lost cause.
The problem with pure virtual machines is they're basically meta-macrocode are mappable back to the ISA macrocode without the overhead.
JIT is the way out performance-wise while the boundaries of the VM are what provide portability and safety guarantees.
- mort96 4y agoYeah, as I mentioned in the article, tracing JITs are the way to get the best performance out of dynamic languages. But JITs are extremely complicated, hard and expensive to make, prone to security issues, require a separate implementation for every single CPU architecture you want to support, etc. If you're implementing an interpreted programming language, and you don't want to invest all the resources to make a JIT, you may want to use some of these tricks to make execution faster for much less cost. Even if you're implementing a JIT, you may want a general fallback, and these approaches become relevant there too.
- mncharity 4y ago> But JITs are extremely complicated, hard and expensive to make, JITs can also be surprisingly accessible, as in [1][2]... [1] How to write a simple JIT compiler https://news.ycombinator.com/item?id=29566249 https://news.ycombinator.com/item?id=29566249 [2] https://eli.thegreenplace.net/2017/adventures-in-jit-compilation-part-1-an-interpreter/ https://eli.thegreenplace.net/2017/adventures-in-jit-compila... [3] ... (others - I searched only briefly)
- tayistay 4y agoIn some environments (iOS for example) JITting isn't allowed. (Or more precisely, marking pages as executable isn't allowed)