5 ms·
I'm a little confused by this. Did someone manage to write a YARV to WASM compiler? I kind of doubt this is a wholly new Ruby to WASM compiler, so my best guess
by _hardwaregeek 8y ago
I'm a little confused by this. Did someone manage to write a YARV to WASM compiler? I kind of doubt this is a wholly new Ruby to WASM compiler, so my best guess would be a YARV to WASM compiler. Except...even that would be tricky since Ruby has a notoriously complicated runtime. Just looking at this though, it looks like they just compiled an existing Ruby implementation to WASM via Emscripten. But that's not really compiling Ruby to WASM then...
- XMPPwocky 8y agoI think this is a Python v.s. CPython sort of confusion- you can run Python code in CPython which can compile to wasm, but you can't directly compile Python source to wasm in a nontrivial way (i.e. just shipping CPython with your source in a single wasm binary doesn't count, sorry, yes I know you heard about the futamura projections yesterday but this isn't actually very interesting)
- deleted 8y ago[deleted]
- mcpherrinm 8y agoYeah, look like it is compiling Ruby (the interpreter, aka MRI or CRuby), not programs written in the language Ruby.
- paradoxparalax 8y agoSo , the maximum you can get from it is the console log text return of the script you paste there. right? Or you can glue your script with anything like webgl or canvas there to do anything?
- thefounder 8y agoWASM doesn't provide DOM access so you can't use anything useful on the web unless you callback through a bunch of JS.
- paradoxparalax 8y agoI see thank you very much :) cheers
- ericb 8y agoI imagine that is some sort of intentional sandboxing? I didn't know about that and find myself surprised. In principal I'm not sure why it wouldn't be able to provide direct DOM access. I'd love to hear more background on this if you know it.
- markdog12 8y agoIt's coming: https://github.com/WebAssembly/host-bindings/blob/master/proposals/host-bindings/Overview.md https://github.com/WebAssembly/host-bindings/blob/master/pro...
- singularity2001 8y agoafair also mruby compiles to wasm almost out of the box: https://github.com/noontage/test-mruby-wasm https://github.com/noontage/test-mruby-wasm
- chrisseaton 8y agoIt's 'compiling Ruby' as in 'compiling the program called Ruby', not 'compiling programs written in the Ruby language'.