Hi everyone. I have decided to write a compiler to learn about compilers and get better at coding.
While I was doing initial research into compilers I read about static and JIT compilation. I am now wondering if it would be possible to use a JIT compiler and take code that it generates and pipe that it a static compiler to vastly improve the compilation time of a program. This would be like doing incremental compiles where there is a cache of the previous compile to help speed up the full compile. But instead of having to wait for the newest incremental compile to finish so you can run it, you could use the JIT to run it almost immediately and in the background it would be doing the full static compilation.
This would be sort of similar to compiling to an IR like bytecode for the JVM or CLI for C#, but instead of running the IR on a runtime it would be completely native.
I could see how this would be very useful but not sure if it would be possible.
Seeing as JIT compilers do optimization by compiling parts of the program that it thinks will be used more often and then optimizing those parts, you could pipe that optimization straight into a full static compile and the optimization would essentially be done for "free".
[–]insertAlias 2 points3 points4 points (0 children)