Discussion:
Anyone writing / building a Ruby 2 WASM compiler ?
pudim
2021-03-27 15:33:25 UTC
Permalink
Is anyone doing this?
Anyone thought about doing it?
- I would be interested in helping! - I am prob not clued-up enough to do it by myself . .
Do you mean compiling MRI to WASM, or compiling Ruby programs to WASM?

Compiling MRI to WASM should be possible with Emscripten.

Now compiling Ruby programs to WASM or regular ASM... that's a
different story. Of course any Ruby program can be written in (W)ASM
in _some way_, after all, MRI itself is compiled to ASM, and the Ruby
code that runs inside is thus proved to be possible under ASM
limitations...

However, because the crazy metaprogramming Ruby allows, there might
not be much room for translating Ruby programs into (W)ASM without
resorting to reimplementing some sort of Ruby interpreter.

I heard there are efforts to make a compiler to translate a _subset of
Ruby_ to machine code, so some bits of Ruby that don't use
metaprogramming or other complicated features could be optimized. But
that's a _subset of Ruby_...

There is also the Crystal lang that might be of interest, a Rubyish
language that compiles to machine code.
--
pudim (she/her)

Unsubscribe: <mailto:ruby-talk-***@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
Loading...