3 ms·
Note: “Features WASM interpreter (AOT is planned)” You’ll compile a program to have it interpreted at the end. Does anybody know some specific case where th
by acqq 8y ago
Note:
“Features
WASM interpreter (AOT is planned)”
You’ll compile a program to have it interpreted at the end.
Does anybody know some specific case where this direction is advantageous?
- q3k 8y agoThis is how a lot of interpreters work - they compile source code to some intermediary bytecode (usually an imaginary stack or register machine) and then interpret that. It's usually faster than executing directly over some sort of AST, and also fast when you re-execute the same script over again (that's why Python creates .pyc files for modules).
- boomlinde 8y agoIn this instance I think that by AOT they mean that at some point the runtime will be able to compile WASM into machine code ahead of time and execute that instead of interpreting it during run-time. WASM already is the intermediate format and VM that you describe.
- baybal2 8y ago> Does anybody know some specific case where this direction is advantageous? Very slow memory. Decades ago, a lot of interpreters did the same trick internally: 1. tokenise code, 2. convert to some compact binary serialisation format used internally by the rest of interpreter. The trick was to make interpreter code to remain in CPU cache as long as possible while the code being interpreted did not require fetching from RAM
- sanxiyn 8y agoInterpreters save space. That's why Apple II used interpretation extensively.