top | item 43936814

(no title)

Klasiaster | 9 months ago

What's truly missing for Wasm and WASI to be an alternative to POSIX is dynamic instatiation so that a Wasm program/component can start another Wasm program/component by providing the bytecode at runtime. So far I don't think anyone is working on that.

discuss

order

marianoguerra|9 months ago

in the browser you can compile modules and create instances from arrays of numbers/bytes, here's an obfuscated example: https://wasmgroundup.com/blog/wasm-compiler-in-a-tweet

if the host provides the guest wasm module via imports a function to create and run from an array of bytes then it can be done today (if I understand you correctly).

Here's some related content: https://github.com/pdubroy/til/blob/main/wasm/2024-02-22-Run...

yuri91|9 months ago

On the Web, you can do that today. This is what https://webvm.io does for example. It jit-compiles Wasm modules at runtime from the original X86.

packetlost|9 months ago

I wonder if it hasn't been done because it would break the security model

xmorse|9 months ago

does it? a program would be able to spawn another program only with the exports available to him