Skip to content
kripken edited this page Jul 6, 2012 · 29 revisions

The original emscripten compiler was written in JavaScript, which was very useful for quickly prototyping new ideas during development of the various new methods needed for effective compilation to JavaScript (the relooper, longjmp tricks, C++ exceptions in JS, etc.). It is also quite stable at this point and generates very good code. However, it has a few downsides:

  • Compiler speed. The generated code is fast, but generating the code is not so fast. Especially with full optimizations on, builds can be quite slow. This is not an issue for a few dozens of KLOCs, but for 1M KLOC projects it is a serious problem.
  • LLVM backends integrate more closely with LLVM, and can leverage LLVM's internal code analysis and optimization. The original compiler just parses LLVM bitcode externally, so it cannot benefit from internal capabilities of LLVM.
  • An upstream LLVM backend is easier to use for people than a separate project. Compiling to JS should, as much as possible, be just another backend in a compiler.

The plan is to start work over Summer 2012. We hope to quickly get to something working, since the people planning to work on this have expertise both in LLVM and in compiling to JavaScript.

Notes:

Clone this wiki locally