natefaubion/example-functional-compiler

lazy compilation for JIT

BebeSparkelSparkel opened this issue · 6 comments

It seems like lazy compilation would be advantageous for a repl or quick interpretation to quickly rerun a modified code without waiting for compilation.

The README states explicitly that this an exemplary compiler frontend. JITting is much more in the realm of a compiler backend. There is no reason someone couldn't build the equivalent of this project for compiler backends, but I think it's a good idea to limit the scope of what's presented here.

@kritzcreek is correct, the goal of this project is a language frontend. We could explain precisely what that means in the documentation. The goal is to only serve as a teaching tool for parsing, type-checking, and reduction semantics. It is not meant to be an example for executing code as this is potentially a very large project in itself.

Sorry, I was not clear enough with my question. I did not mean to suggest that there should be a JIT included here. I was interested in a more pull based design that would parse on demand rather than create everything.

With that kind of design it would allow it to be the frontend for a jit backend and conventional backends as well.

I think it's an interesting approach, but I would put that in the "exotic" category, and so I do not think that it serves the teaching goals of this project.

Lots of ideas still floating around for compilers these days.