I think we have different opinions on the cost of a wasm VM.
In my mind, the cost of a WasmVM is minimal: it's only (1) the amount of memory we allocate for it and (2) the cost of storing the wasm32 -> x86_64 JIT-ted code.
Two things: (1) I believe it is possible to write wasm32 blas routines that rival ntive blash routines, and (2) although Erlang can use NIF, I highly doubt pure Erlang blas routines can rival native blas routines. Therefore, for at least certain classes of tasks, I would argue that wasm32 has far higher performance than BEAM.
I believe the way BEAM handles this is: after X000 'reductions', the BEAM process is suspended, and the next BEAM process runs.
In wasmtime, there is something similar: Caller in wasmtime - Rust . I was asking about this exact issue in: Interrupt wasmer/wasmtime
I do not know enough about lunatic / wasmcloud to state their limitations. I will say this: I personally do not know of any "wasm32 VM per process" runtime that has anything remotely close to OTP for distributed computing.
====
I apologize if it appears I am pedantically nitpicking on the BEAM vs wasm32 VM issue. What drives my interest is that I am very curious if we can have a system where:
- lightweight 'processes' can crash independently, like in Erlang
- we can do OTP style distributed fault tolerant computation
- lightweight 'processes' can be as fast as native C
- we can program in a language with safety guarantees of Rust
Erlang itself "fails' 3 in that to get native C like performance, we need NIFs. Erlang/Elixir's lack of type system also does not satisfy 4.
Gleam seems to achieve 1, 2, 4. (Though I believe at the cost of hot code reloading).
Rust compiled to wasm32-unknown-unknown, with a "each 'process' has it's own wasm VM", I believe achieves 1, 3, 4.
If you agree with the above (and it might be the case you disagree, as I get the impression you believe wasm32 VMs have much higher overhead), one interesting question -- assuming 1, 2, 3, 4 are all desirable, would be whether it is easier to add (3) to gleam/BEAM or easier to add (2) to Rust/wasm32/{lunatic, wasmcloud}.
I personally don't know the answer. I suspect that the reason this has not been done implies there is some technical difficulty I am not aware of.