What does HackerNews think of webassembly-language-runtimes?

Wasm Language Runtimes provides popular language runtimes (Ruby, Python, …) precompiled to WebAssembly that are tested for compatibility and kept up to date when new versions of upstream languages are released

Language: Shell

Exactly. The Drupal code is unmodified and runs on top of the PHP interpreter compiled to Wasm [0]. The Drupal PHP code is not compiled to Wasm.

- [0] https://github.com/vmware-labs/webassembly-language-runtimes

WMWare labs [1] managed to compile Python/Ruby/PHP into WASM distributions. This works if you want to run the language interpreter but is limited when you want your WASM runtime to run in parallel of your own program. This leads to the creation of the "reactor" concept by the community [2].

In the python WASI reactor, we load the libpython compiled for WASM and add a Rust reactor layer. Currently, it supports dynamic registration of Python lambdas and we are working on adding support for whole functions/packages.

[1] https://github.com/vmware-labs/webassembly-language-runtimes [2] https://github.com/bytecodealliance/wasmtime/blob/main/docs/...

The Python builds from the WebAssembly language runtimes [0] project target the WebAssembly System Interfaces (WASI) [1]. It allows the Python interpreter to interact with resources like the filesystem.

Many server-side Wasm runtimes supports WASI out of the box. For the browser, you need to provide a polyfill to emulate these resources like the one provided by the WASI team [2].

Regarding SQLite, these builds include libsqlite so you should be able to use it :)

- [0] https://github.com/vmware-labs/webassembly-language-runtimes

- [1] https://wasi.dev/

- [2] https://wasi.dev/polyfill/

(wazero contributor) In case you are interested, you can use Ruby (or any other interpreter compiled to wasm) with wazero. Our CLI shows what most of the runtimes can do, too.

$ echo salaboy | wazero run ruby-3.2.0.wasm -ne 'print "Hello "; print'

Hello salaboy

Of course getting and gems etc gets weird in wasm..

Anyway, thanks to VMware labs for publishing interpreter wasm builds, people can play around. https://github.com/vmware-labs/webassembly-language-runtimes...

Random, but enjoy.

Hey! A WasmLabs team member here :). We're planning to port several runtimes as part of our WebAssembly Language Server initiative [1]. Porting things to Wasm+WASI is sometimes challenging. There are some deep-dives in our blog around this topic [2].

[1] https://github.com/vmware-labs/webassembly-language-runtimes...

[2] https://wasmlabs.dev/articles/php-wasm32-wasi-port/