I built a system image file with a new function
function printHello() println("Hello World!") end
I used the
--compile=all --output-bc flags in the
build_sysimg.jl to generate the system image in llvm bitcode format
sys-hello.bc. I use this bitcode system image file to start julia and set compile to “no”
julia -J sys-hello.bc --compile=no (so that I am informed if any expression needs to be compiled from the REPL) and then run the
printHello() function in REPL. This works and I am under the impression that for running the
printHello function julia did not have to compile anything and used the bitcode of that function
julia_printHello_<some numbers> to get the native IR and run it.
However, even if I go ahead and remove everything from this function, I still get the correct output.
Is Julia still dynamically compiling the printHello function from the AST? Is the LLVM bitcode generated in
sys-hello.bc of any use, or only the binary blob containing the AST matters?
PS: This is in relation to my effort to get LLVM IR of my function in Julia and being able to make changes to it, which are eventually reflected in the output. A related topic is here
Update: April 14 2017 12:10pm CST: I see now that the command
julia -J sys-hello.bc --compile=no does not even look for the file sys-hello.bc. Instead it looks for sys-hello.so in its place and uses it. I am not sure how is this helpful. The application should be more transparent about this. Just display the error that this is not a sys image file if we cannot use it, rather than having the user believe that he/she is using a file which he/she is not.