

An Update on WebAssembly/WASI Support in Ruby.Add WASI based WebAssembly support #5407.This makes distribution of Ruby apps a bit easier. In addition, we built a VFS on top of WASI so that we can easily pack Ruby apps into a single. So CRuby fills the gap by using Asyncify, which is a binary transformation technique to control execution in userland.

Today’s WASI and WebAssembly itself is missing some features to implement Fiber, exception, and GC because it’s still evolving, and also for security reasons. Now you can try original CRuby in your web browser. An example use case is TryRuby playground’s CRuby support.

This support encourages developers to utilize CRuby in a WebAssembly environment. It enables Ruby developers to write applications which run on such promised platforms. WebAssembly/WASI support in Ruby intends to leverage those projects. Though such applications need to communicate with operating systems, WebAssembly runs on a virtual machine which didn’t have a system interface. WASI (The WebAssembly System Interface) is designed for such use cases. But its objective - running programs efficiently with security on various environment - is long wanted not only for web but also by general applications. WebAssembly (Wasm) was originally introduced to run programs safely and fast in web browsers. Currently this port passes basic and bootstrap test suites not using the Thread API. This enables a CRuby binary to be available on a Web browser, a Serverless Edge environment, or other kinds of WebAssembly/WASI embedders. This is an initial port of WASI based WebAssembly support. Ruby 3.2 adds many features and performance improvements. We are pleased to announce the release of Ruby 3.2.0.
