I recently finished the basic Elm tutorial that Tenor introduced me to. The last assignment was on ports. This to me seemed very strange. What is an elm port? Why do we need it? It reminded me of this this Rust WASM feature request:
Request for library: mpsc channels library built on top of the postMessage API #163
This could allow wasm to talk to js via CSP style message passing, different wasm instances to talk to each other without sharing memory, the wasm instances might even be in different threads by using web workers.
It is a pub/sub pattern, where JS subscribes to a port that is populated in Elm, and then sends messages on a port that is then handled in elm.
I did not expect Elm to work this way, but its not that strange. Maybe I can use some concepts and apply them to RUST WASM.