Hi, I don’t know if any of you are familiar with the pypy project. Most importantly, it’s a jit-compiler generator toolchain, ie you write a bytecode interpreter for some new language using a subset of python and add some useful hints. The jit-generator then adds a tracing jit which unrolls the main opcode dispatch loop to match the loops in the end-user program (the one written in the new language) and does his things on them. The important part is that it’s actually tracing and jiting the interpreter code, not the new language code. I feel like it would be a perfect match to use Rust to replace their RPython (a subset of python that’s kinda hard to work with: has almost no libs and documentation): Rust is already a compiled language, it has strong support for low-level (necessary to write a jit-compiler), for compile-time code execution (with macros and compiler plugins) to generate the jit and for code hints with attributes. Moreover, writing a jit(-generator) for Rust would be something useful in general as it can be used to speedup some other things like hardware simulators or maybe generic programs having lot’s of runtime-constant dependent hot-loops.
Has anybody already thought about this (a jit-compiler for Rust)?
Note: not sure if this category is specifically about rustc or about compilation and compilers of Rust.