Our approaches are somewhat different, llvm-js-backend is, as the name implies, a JavaScript backend for LLVM. It's written in C++ and integrated in the LLVM codebase. Emscripten on the other hand parses human-readable LLVM bitcode, and is written in JavaScript. So sharing the core code isn't directly possible. However, we would really like to collaborate as much as possible otherwise, and it seems there is a lot of room for that:
1. Test framework and cases. While the approaches and architectures are different, we can use the same tests for both, since they are trying to do the same thing. One project (emscripten) has automatic tests that compile C/C++ code into LLVM bitcode that is then tested (through a Python test runner), while the other (llvm-js-backend) has test cases written in LLVM bitcode directly (and run using llvm-lit). I think there is a need for both kinds of tests. We could collaborate on the scripts that run the tests, and on test case code (of which we will need a lot!).
2. Standard library. Both projects need stdlib, math, stdio, etc. libraries. One approach is to write those in JavaScript (Emscripten is trying that, for now), another would be to compile a stdlib written in C/C++, after some porting. We can debate which approach is better, and work together on a single standard library that both projects can use.
3. Discuss the various issues we need to tackle in order to run LLVM bitcode in JavaScript, and perhaps implement shared solutions. For example, how to implement pointers, loops, etc. etc. It might turn out that we can agree on a certain implementation of pointers, and share the code for it, etc.
We should probably fork into separate threads for each of these topics.
- azakai