4 ms·
Proposal to merge WASI based WebAssembly support
- samwillis 5y agoThis is awesome to see, even for a none Ruby developer, as I believe WASM is going to become the default target for so much more than in the browser. Cloud (particularly at the edge), App plugins, even embedded devices are all going to use WASM in the future. Any movement forward on any platform is good for all of us. For any Python devs like myself, Pyodide is doing incredible things and can already run much of the scientific Python stack in the browser. https://github.com/pyodide/pyodide https://github.com/pyodide/pyodide This is the Python bug tracking adding WASM support to cpython natively: https://bugs.python.org/issue40280 https://bugs.python.org/issue40280
- Ericson2314 5y agoYeah we really need capsicum a thing without web assembly too, and this helps!
- kitsunesoba 5y agoIt would be pretty interesting if there were a standalone desktop WASM+canvas runtime that didn’t drag the entirety of a browser around with it. It would be a good fit for small to moderate sized cross platform utilities that have no use for the majority of the features provided by a web engine.
- jokoon 5y agoI hate emscripten. I tried it once, I could not wrap my head around it. Building C++ is already quite painful, but adding webassembly seems to really make it even more sadistic. WASM seems like an awesome thing, but emscripten makes it quite unpleasant.
- hutzlibu 5y agoIt is non trivial technology. With more broad adoption, there will be probably more easy tools and easy IDE integration, but hating a very complex and powerful technology, because it is hard to get into, seems strange.
- jcelerier 5y ago> I hate emscripten. I tried it once, I could not wrap my head around it. fun, I just pass the emscripten toolchain to CMake and things mostly JustWorksTM
- pjmlp 5y agoIt is somehow complex, however hardly any different from a typical C or C++ compiler toolchain.
- mhoad 5y agoI’m only vaguely familiar with WASI so forgive me if this is a set of dumb questions. Would this mean that instead of complicated Ruby deployments where I need an app server, a Ruby runtime and a bunch of other magic that I could theoretically just end up with a single binary that contained everything in it? Secondly, this is shipping a Ruby runtime inside of WASI or is it aiming to “compile” to “native”? Not exactly sure what those terms mean in a WASI context hence the quotes. Then finally, does this also theoretically do something big for Ruby’s performance metrics? Edit: thanks for the insight in the comments below
- kevincox 5y agoI am not super familiar but let me give it a shot. My understanding is the main benefit is that you can have one ruby interpreter that can be used on any CPU architecture or operating system. This is especially interesting for web as you can implement the WASI interface and then run Ruby in the browser. This is especially cool for learning tools and IDEs. Another benefit is that by using a "safe" WASI backend you could run Ruby sandboxed which could be helpful for testing and dynamic analysis of untrusted code or even for IDE support for potentially dangerous code. (For example you can run the `rm -r /` function to see it's return type without actually letting it wipe the disk.) > that I could theoretically just end up with a single binary that contained everything in it? I don't think this changes anything here. You could do this just as easily with or without. > this is shipping a Ruby runtime inside of WASI or is it aiming to “compile” to “native”? My reading says that it is the former. Compiling the Ruby runtime to WASI. > Then finally, does this also theoretically do something big for Ruby’s performance metrics? It likely hurts performance as WASM will be slower than native.
- rgrmrts 5y agoAs I understand it, this proposal brings cruby to WASM. As in the code for Ruby itself, the vm, compiler, etc. WASI is just an interface to the host system and is not specifically related to native compiling
- robertoandred 5y agoProposal to use hyphens correctly
- dccoolgai 5y agoWith all the supply-chain problems creeping up (and they're only getting worse) Capabilities Model that WASI is built around is the only sane future. IMHO running things any other way is as reckless and irresponsible as sending sensitive user data over an unencrypted connection. It's good to see this: Hopefully we'll see more ecosystems support this going forward.