https://github.com/nalgeon/ruby-wasi
Ruby WASI build.
https://github.com/nalgeon/ruby-wasi
ruby wasi wasm
Last synced: about 2 months ago
JSON representation
Ruby WASI build.
- Host: GitHub
- URL: https://github.com/nalgeon/ruby-wasi
- Owner: nalgeon
- License: apache-2.0
- Created: 2024-01-03T15:35:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T15:36:00.000Z (over 2 years ago)
- Last Synced: 2025-10-23T13:28:26.091Z (8 months ago)
- Topics: ruby, wasi, wasm
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ruby WASI build
This is a [WASI](https://wasi.dev/) build of the Ruby 3.2 interpreter compiled by [VMware Labs](https://github.com/vmware-labs/webassembly-language-runtimes).
It is published as an NPM package [@antonz/ruby-wasi](https://www.npmjs.com/package/@antonz/ruby-wasi):
```
https://unpkg.com/@antonz/ruby-wasi/dist/ruby.wasm
https://unpkg.com/@antonz/ruby-wasi/dist/ruby-slim.wasm
```
## Usage
Using the [Runno](https://github.com/nalgeon/runno) runtime:
```js
import { WASI } from "https://unpkg.com/@antonz/runno/dist/runno.mjs";
const url = "https://unpkg.com/@antonz/ruby-wasi/dist/ruby.wasm";
const result = await WASI.start(fetch(url), {
args: ["ruby", "--version"],
stdout: (out) => console.log(out),
stderr: (err) => console.error(err),
});
console.log(`exit code = ${result.exitCode}`);
```
Result:
```
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [wasm32-wasi]
exit code = 0
```
## Building from source
```
make prepare
make build
```
## License
Copyright 2023 [VMware Labs](https://github.com/vmware-labs/webassembly-language-runtimes), Apache-2.0 license.
Ruby is copyrighted by [Yukihiro Matsumoto](https://www.ruby-lang.org/en/about/license.txt), 2-Clause BSD License.