by gregsadetsky · 3y ago · 0 comments
Absolutely agreed, it really seems like a fascinating possibility.
What’s your take on how WASM drivers (meant to run in a web browser) could integrate at the OS level? For instance, if you wanted all installed desktop softwares to be able to print via the WASM printer driver?
wasm spec is fully defined and public, and we even already have source for browsers.
What prevents developing a wrapper or shim that runs any wasm as if it were any other native executable?
You might be legally prevented from redistributing the wasm, so maybe you can't bundle it right into a .deb or.rpm, but it's trivial in that case to just download on the fly if not exist and re-use after that. You may want it to check for updates all the time anyway.
That definitely exists and is used on server-side - Wasmtime, Wasmer and others.
As for browser API compatibility, I don't see much point to it since they're mostly designed with the assumption of a JS host. Ideally a WASM driver would export low-level functions to translate from (for example) PostScript to USB packets. Then the underlying native driver (Linux kernel module, Windows dll, etc) runs the WASM and handles all the IO, calling exported WASM functions as needed.