New Emscriptem WebAssembly target + examples #4486
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow-up to the email I sent Matz last week asking if there was any plan to running Ruby on WebAssembly. I decided to give it a shot. In this pull request you'll find:
A new crossbuild file to target Emscripten WebAssembly. For this MRUBY_CONFIG to work you need to install Emscripten on your machine first (emcc compiler)
Once you have build the emcc-wasm target go to examples/emcc-wasm and run the compile script to generate the two Web Assembly examples
This proves that we can run mruby in the Emscripten WebAssembly runtime. This is however "just" a demonstrator as what we are showing here is the RiteVM mruby VM running within the Wasm VM. So from a performance standpoint we could do much better if mruby could generate WebAssembly bitcode. I don't know what's the best way of doing this though. Generate WebAssembly directly or "transpile" RiteVM instructions to WebAssembly bitcode ?
Comments, feedback welcome