Project

General

Profile

Actions

Misc #18761

open

provide an example wasm project

Added by grosser (Michael Grosser) about 2 months ago. Updated about 1 month ago.

Status:
Open
Priority:
Normal
[ruby-core:108455]

Description

Neither the release notes nor the wasm/README.md include any runnable examples.
Please provide a docker image that can be used to generate a wasm binary (even if it's just "hello world"),
to show how this is supposed to work.

Updated by katei (Yuta Saito) about 2 months ago

  • Assignee set to katei (Yuta Saito)

Thank you for reporting. ruby/ruby.wasm repository provides a simple example and prebuilt rubies to try it easily. https://github.com/ruby/ruby.wasm#quick-example-how-to-package-your-ruby-application-as-a-wasi-application

Is this enough for your case, or need more getting started instructions?

Updated by rkh (Konstantin Haase) about 1 month ago

grosser (Michael Grosser) wrote:

Neither the release notes nor the wasm/README.md include any runnable examples.
Please provide a docker image that can be used to generate a wasm binary (even if it's just "hello world"),
to show how this is supposed to work.

I assume the final release will have an official .wasm file that ships with it.

Note that the current approach isn't to compile Ruby scripts to wasm, but to compile CRuby itself to wasm and use WASI or a custom interface to run Ruby code (ie, the Ruby code is sent as source code to the wasm binary).

You can find pre-compiled wasm files on GitHub: https://github.com/ruby/ruby.wasm/releases

Actions

Also available in: Atom PDF