4 ms·
Am I missing something or is the work required to write an interpreter comparable to the work involved in a drop-dead-simple compiler, that even without any opt
by yholio 6y ago
Am I missing something or is the work required to write an interpreter comparable to the work involved in a drop-dead-simple compiler, that even without any optimizations is guaranteed to be faster? The wasm instruction set maps very well over the x86_64 instructions, you already need to build a decoder for the input binary, so with a bit more glue code and address space setup you can execute wasm directly. More complex functions and instructions can fallback to the precompiled versions that you have to write anyway.
But again, there might be complexity I'm missing.
- flohofwoe 6y agoThe readme has a small section about the interpreter vs JIT tradeoffs: https://github.com/wasm3/wasm3#motivation https://github.com/wasm3/wasm3#motivation Also, maybe the "Cosmopolitan platform abstraction" doesn't support mapping memory pages and making them executable, which would be required for a JIT (speculating, I haven't actually checked).
- yholio 6y agoSo they are not targeting just x86_64 like here, but also MIPS, various MCUs, iOS and even wasm itself. Yeah, that will get hairy in a hurry.