3 ms·
"a WebAssembly module can’t run dynamically generated code" Why does it have that limitation, and is there any hope that it will someday be overcome?
by pmoriarty 4y ago
"a WebAssembly module can’t run dynamically generated code"
Why does it have that limitation, and is there any hope that it will someday be overcome?
- aidenn0 4y agoOn your computer, heap, stack, code, and global data all share the same address space. On the WASM virtual machine, only heap and global data share the same address space. Code and stack are abstracted away by the machine. It was designed to support C-like languages, so you can do the equivalent of loading a DLL (or dynamic shared object). However in Lisp it is not unusual to compile just one function at a time. It's definitely possible to create a DLL for each function and load each DLL, but it requires a completely different architecture than most Lisp implementations use (in which, when you compile a function, it just writes the machine code to the heap). There are similar impedance mismatches with so-called W^X systems (where you are disallowed from having a page be both (W)ritable and e(X)ecutable.