Skip to content
Pieter van Ginkel edited this page Jul 2, 2015 · 3 revisions

The roadmap below describes where we want to go with the rjs project and what parts of it are already done. The order of the list below may be the order in which the different parts will be implemented, but it may change.

  • Lexer, parser, bytecode generator and interpreter.
  • Basic garbage collector. The current garbage collector is a very basic copying garbage collector. It is fully functional but the performance is not such that it can be left in as a permanent solution.
  • ECMA 262 conforming implementation. The ECMA 262 test suite is being used to implement a fully conforming implementation. There are however a few exceptions that either will not be implemented or are still outstanding. The test262-ignore.json file contains a list of tests that are currently excluded and the reason it is being excluded. Once this phase is completed, issues will be created for the remaining tests. One large part that has not yet been implemented is a conforming regular expression implementation. The reason for this is that the Rust regex crate does not implement all functionality required to support JavaScript.
  • Basic JIT compilation. JIT compilation is split into two phases. The first phase is to implement a basic JIT compilation that takes the current byte code as input and generates what roughly comes down to what the interpreter currently does. This means that there will be no/very limited optimization done at this phase. The current proposal is to use the libjit code generator as a basis for the JIT compiler, possible providing the code generator as a separate, reusable crate.
  • A fully conforming regular expression implementation. Instead of trying to adapt the Rust regular expression implementation, we should create our own. This has the following advantages:
    • The exact semantics of the JavaScript regular expression functionality can be implemented without any conversion or similar tricks.
    • Executing the regular expressions can be done directly against the UTF-16 code points. This saves a lot of conversion from/to UTF-8 which would have to be done otherwise.
    • We can integrate a JIT compiler into the regular expression implementation based on the JIT library we're going to create for rjs (see below).
  • A fully functional, generational garbage collector. The simplistic garbage collector should be replaced by a generational garbage collector. There are a number of open source projects that expose a garbage collector which could be used as a basis. The LuaJIT wiki also has a nice layout of what they are planning to implement. An alternative approach is to do a line-by-line rewrite of the Firefox garbage collector implementation.
  • An optimizing JIT compiler. The basic JIT compiler should be extended with an optimizing JIT compiler, e.g. by adding a type inference, inlining, etc.
Clone this wiki locally