nbp / holyjit

Generic purpose Just-In-time compiler for Rust.
https://holyjit.org/
Mozilla Public License 2.0
1.5k stars 26 forks source link

Use the -Z codegen-backend flag in rustc and reuse the cranelift rustc backend #38

Open siriux opened 3 years ago

siriux commented 3 years ago

An idea for anyone interested in reviving this amazing project.

Holyjit could be rewritten to use the new codegen-backend rustc flag instead of implementing a compiler plugin. There is an issue to bring it to stable at some point: https://github.com/rust-lang/rust/issues/77933

This is used at least by https://github.com/EmbarkStudios/rust-gpu and https://github.com/bjorn3/rustc_codegen_cranelift

It might be even possible to take advantage of this last project to generate Cranelift IR from rust code, and therefore Holyjit would only need to take care of the transforms to the interpreter and connecting everything together. Of course, execution would be through Cranelift in a similar manner to SimpleJit.