sourir: Speculative Compiler Optimizations

We are currently working on a programming language called sourir [1]. This language looks a bit like assembly because it’s not intended for humans. It is supposed to be the intermediate language of a compiler.

The reason why we are creating this language is that we are interested in describing speculative compiler optimizations. Those are the kind of optimizations virtual machines like HotSpot do all the time. For example: "let’s assume x is a number between 1 and 100" and optimize the code based on this assumption. If the assumption fails then the just-in-time compiler kicks in and compiles new code with a relaxed assumption. To model this situation sourir prominently features an instruction for bailing out of speculatively optimized code.

The language will serve as a vehicle to reason about the correctness of speculative optimizations.

Within this work there are two tasks which I offer as seminar projects:

On the one hand you could create a dynamic programming language for humans which compiles to sourir [2]. You are free to create a syntax and semantics for this language and figure out how you can implement it using the instructions sourir provides you (and maybe some more that we’ll have to add).

The other task [3] is to write a sourir to C compiler. This one is for the most part relatively simple. Figuring out how to support the "bailing out of optimized code" instruction will be the biggest challenge.

Check out the relevant issues [2,3] on github for more information.

In pictures this is how the two projects look: Your language > sourir > C

Currently sourir features a parser and interpreter written in ocaml. It would be nice if you are interested in working in that language. However since sourir has a well-defined textual representation any language will work for those two tasks.

  1. https://github.com/reactorlabs/sourir
  2. https://github.com/reactorlabs/sourir/issues/50
  3. https://github.com/reactorlabs/sourir/issues/51

Contact

Olivier Flückiger

Last changed by oscar on 20 February 2017