Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

holyjit #11

Closed
cztomsik opened this issue Feb 24, 2021 · 2 comments
Closed

holyjit #11

cztomsik opened this issue Feb 24, 2021 · 2 comments

Comments

@cztomsik
Copy link

cztomsik commented Feb 24, 2021

https://github.com/nbp/holyjit

The project is dead but you could get some inspiration there. The idea is that you only write interpreter and some wodoo macro will eventually generate very efficient code for that interpreter. But it doesn't have to be interpreted anymore. A bit like JIT JIT compiler.

It's super ambitious but it has been done already - GraalVM compiler is the most successful and production-ready example. TBH, they have far more resources but they also have much bigger scope, so... Definitely possible.

It might be easier to resurrect the project and use it instead of doing JIT all by yourself (and it might be for other dynamic languages implemented in rust).

I would do that myself if I was not busy with other things in my life right now (yeah, I know)

@playXE
Copy link
Collaborator

playXE commented Feb 27, 2021

Hi! holyjit is nice project but I do not want to implement meta-trace JIT library as it is really hard work because I have to trace either raw assembly or Rust MIR. Instead I will use GCCJIT for optimizing JIT and my own masm-rs library for baseline jit.

UPD:
Meta-tracing also has some disadvantages:

  • It will generate trace for entire interpreter loop rather than for some bytecode sequence
  • I can't directly apply optimizations that utilize inline caching when meta-tracing is used
  • Performance boost compared to optimizing jit + baseline jit is really small. While baseline JIT can patch code on the fly and optimizing jit can generate code for specific types in specific bytecode sequence meta-tracing JIT can't do all of this.

If you're interested in meta-tracing JIT in Rust there's ykrustc which is a fork of rustc suitable for building meta-tracing JIT.

@cztomsik
Copy link
Author

Fair point, I guess I just got over-excited :)

BTW: Thanks for the links, I'll definitely have a look.

@playXE playXE pinned this issue Feb 27, 2021
@playXE playXE closed this as completed Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants