4 ms·
Maybe it's by design, but my biggest sticking point with WASM is the inability to modify the code at runtime, at least to my knowledge. This makes it a bad targ
by rileyphone 5y ago
Maybe it's by design, but my biggest sticking point with WASM is the inability to modify the code at runtime, at least to my knowledge. This makes it a bad target for dynamic languages where the source -> executable mapping isn't wholly known ahead of time, especially Lisps but also any looking to JIT compile things.
Speaking of Lisp and WASM, IchigoLisp [0] is a remarkably faithful implementation of LISP 1.5 in WAT. Extraordinarily impressive, and inspires even more awe for the original system from the 60s.
[0] https://github.com/zick/IchigoLisp https://github.com/zick/IchigoLisp
- hmry 5y agoWell, that functionality is not included by default, but you can certainly add it yourself. Add a function to your host system (be it a browser, a CLI interpreter, etc) which accepts a wasm module you dynamically create, instantates it, and gives you acces to some function it exports. I don't think any WASM implementations provide such a function by default, but that can be changed easily and is not an insurmountable limitation of WASM.
- Skinney 5y agoI believe you can call functions through a table, which makes it trivial to switch out functions at runtime.
- VikingCoder 5y agoWell, you can always add a VM inside WASM as a layer of abstraction, and modify its code at runtime. Is that what things like this [1] are doing? [1] https://github.com/pyodide/pyodide https://github.com/pyodide/pyodide
- emteycz 5y agoIt's still possible to JIT Wasm code and run it, though. WebVM does that.