3 ms·
Is WASM going to replace: Lua, JS and LLV IRM?
by tester34 5y ago
Is WASM going to replace:
Lua, JS and LLV IRM?
- BlueTemplar 5y agoIsn't it an intermediating language ? Why would it replace them, it's not like a lot of people directly code in assembly when C is available...
- cpuguy83 5y agoInstead of, as an example, coding a plugin in lua, you code it in whatever you want and compile to wasm (that supports wasm as a compile target). In that sense it would be replacing lua.
- BlueTemplar 5y agoBut lua is typically used as an easy scripting language for non-programmers...
- _nalply 5y agoNo. I am not a clairvoyante but I think there will be possibilitites to compile to WASM. LLV IRM is a special case but transcompiling is not unimaginable.
- kortex 5y agoNo, no, and no. The only one remotely close in scope is LLVM-IR, and even then scope is pretty significantly different. LLVM-IR is a general purpose IR for native compilation. Wasm is deliberately small in scope and designed for sandboxing. Lua and JS are not even binary languages.
- hajile 5y agoThere is a proposal from Mozilla/Facebook for a binary JS format. https://github.com/tc39/proposal-binary-ast https://github.com/tc39/proposal-binary-ast
- Findecanor 5y agoWASM is a compiler target. It was designed for fast compilation into native instructions with deterministic effects. LLVM-IR has been considered, but has never been suitable as a compiler target. Code is targeted for a specific arch even before it becomes translated into LLVM-IR. Undefined behaviour in C is undefined also in LLVM-IR, and a portable compiler target can not have any. It is also changing too much between compiler versions (which is a reason why SPIR moved away from it). BTW. It seems that in the long-term, the use of LLVM-IR in compilers is going to be replaced with MLIR (Multi-level IR).