Skip to content

Instantly share code, notes, and snippets.

@xxuejie
Created March 3, 2014 13:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxuejie/9324574 to your computer and use it in GitHub Desktop.
Save xxuejie/9324574 to your computer and use it in GitHub Desktop.
Regarding the current status of webruby

We now have reached a corner regarding the development of webruby.Emscripten is now switching to a LLVM-based backend, which eventually will replace the old JS-based backend. However, a bug in clang prevents us to use the new le32-unknown-nacl triple in LLVM/emscripten, it also prevents us from using the new LLVM-based backend of emscripten.

A fix has been developed for LLVM to solve this problem, but as of today, it's neither in the PNaCl fork of clang, nor emscripten-fastcomp-clang. So this prevents us from switching to the latest version of emscripten.

In a meantime, an attempt to fix this problem at mruby side was also rejected, since this would complicate mruby a lot for a small corner case.

We could maintain a separate patch for this in webruby, but the real question here is: when do we want to switch to the new LLVM-backed emscripten?

Right now, if one wants to use webruby, he/she only needs to download LLVM 3.2 binaries from LLVM webside, have Python, Ruby and node.js installed, then a simple gem install webruby will be enough. If we are switching to LLVM-backend, we are forcing everyone to build a custom version of LLVM first before installing webruby. Though it is more stable right now, the LLVM backend is still very new stuff and only lives at the very cutting edge state.

Emscripten SDK seems a viable solution. To be honest, I haven't tried this so I cannot comment on whether we can rely on this, maybe we can simply download a pre-built version of emscripten-patched LLVM and saves the building time. However, given the fact that new fixes and enhancements come out everyday in the LLVM branch. This still needs a lot of downloading efforts, and we don't know yet if we can save the LLVM building process.

Given all those facts, what I think is reasonable now, is that we keep the current stable version of webruby for now, and wait to see when can the LLVM backend in emscripten becomes more or less "stable". By that time if va_arg fix is still not landed, we can then host our patch in webruby. IMHO there's no point in hosting a patch and bump webruby to use the emscripten-patched LLVM right now. We are bringing a lot of burdens to those fun Ruby developers.

These are only my personal views, and it is very likely that I may missed some points here. Any comments are extremely welcome. Thanks for reading!

@take-cheeze
Copy link

I'm developing mruby on OS X so I didn't know linux emscripten toolchain is provided officially.
When the time new emscripten toolchain and struct/union va_arg fix is available seems to be the time to switch.

@xxuejie
Copy link
Author

xxuejie commented Mar 3, 2014

Since updatting on llvm toolchain is more hard than updating a few JS files(either more files needs to be downloaded, or more compiling efforts are needed), I think we should at least wait till the toolchain becomes more stable.

As for va_arg fix: I think we don't have to wait till this is available, we can switch to the new toolchain and provide the patch when time is right. I just think we don't need that patch right now, since we are not using the new LLVM backend.

@xxuejie
Copy link
Author

xxuejie commented Mar 3, 2014

@take-cheeze Good point. It seems the linux version of emscripten SDK is still not available: https://github.com/kripken/emscripten/wiki/Emscripten-SDK#wiki-linux.

@take-cheeze
Copy link

take-cheeze/mruby@1089f39 is the current toolchain files I'm using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment