munificent / craftinginterpreters

Repository for the book "Crafting Interpreters"
http://www.craftinginterpreters.com/
Other
8.79k stars 1.03k forks source link

Adding JIT support to Lox #904

Closed mcfriend99 closed 3 years ago

mcfriend99 commented 3 years ago

Hi @munificent

I have implemented a language based on this beautiful book and your implementation of the Wren language as well as a few tidbits from the CPython implementation and I have been able to add support for lists, dictionaries, sets, exceptions, files and I/O operations as well as modules (this was more tedious than I anticipated to get correctly) and byte arrays amongst others (this wonderful book provided the base for most of the implementation).

One thing I am finding hard to grasp is how to add JIT support to the Lox implementation (as well as mine). I have searched through CPython code and can't see where any form of JIT was implemented even though the PEP/Issue list claims that there is JIT support in it.

Any suggestions on where and/or how to get started??

I believe this is a discussion that will benefit a lot of people following this project as well.

Regards!

Irwin1985 commented 3 years ago

@mcfriend99 congrats for your new language! is it open source to take a look?

munificent commented 3 years ago

Any suggestions on where and/or how to get started??

I really don't know any good resources for writing a JIT, unfortunately. It doesn't seem to be covered well by the literature I've seen (and I don't know enough to write about it either).

mcfriend99 commented 3 years ago

@Irwin1985 not quite ready for the public. But I'll be sure to notify you here once it is