Docs on parse-time, compile-time and run-time operations?


#1

Are there any references that explain what happens exactly at parse-time, compile-time and run-time inside of Julia for someone who is curious but without all the in-depth background? Something along the lines of the following talk. I would love to understand Julia better to hopefully reach a point where I don’t have to keep watching my back when programming! It seems that the docs mention run-time and compile-time every now and then, but no section clearly details everything happening behind the scenes.


#2

Another nice article on some internals. https://juliacomputing.com/blog/2016/02/09/static-julia.html


#3

Some of the details here have changed, but the major gist is still valid:


#4

Here is another intuitive explanation of what’s going on under the hood, explaining generated functions and exposing Julia’s pipeline in the process.


#5

Awesome!


#6

Just one additional question, it seems that the concepts of parse-time, run-time and compile-time are a bit cyclic rather than being fixed points in a process. If I understand correctly, parsing changes the file to an AST which is then transformed and optimized in multiple ways before attempting type inference. After type inference, if generated functions exist, they will be unwrapped (more parsing work I suppose) and then code is generated and statically (?) compiled by LLVM for the specific types of the parameters passed at run-time (?) which then get cached for later quick use. So at the last bit, it seems that parsing, compiling and running are taking place somewhat simultaneously or in a very tight window, so where would you place markers for the parse-time, compile-time and run-time points in this process? Please excuce my ignorance of these concepts that you might take for granted.

Edited to add: well I suppose a lot more optimizations happen after type inference to only compile relevant pieces of the code making use of features such as traits and if statements that specialize the behaviour for different data types. And if you don’t mind another question, where does pre-compilation fall in this process, is it perhaps everything before type inference?