2020-07-29 –, Purple Track
This talk presents the new 1.0 release of the Julia package PackageCompiler.jl which allows one to, in addition to create sysimages, also create “apps” or executables which can be run on machines that do not have Julia installed. In addition, it gives a background to the Julia compilation model and how and why one would want to create custom sysimages.
When a function is to be executed for the first time in Julia there are several steps that need to happen. The code needs to be parsed, type inference has to run, LLVM has to compile it to machine code etc. Depending on the function, this can take some time giving a bit of a latency to the first call of a function. When packages are loaded, there is a precompilation step that takes place that tries to cache some of this work, but even with that the latency before the function actually runs can be significant.
Julia comes with a few packages that are already installed and available without having to explicitly add them like normal packages. These are called “standard libraries” and the Julia REPL is one of them. You might have noticed that the Julia REPL loads almost instantly (significantly faster than a “normal” package) even though it is a quite complex package. This is because it is compiled into what is called a “sysimage” which allows more extensive caching of compiled code than the normal package precompilation system.
PackageCompiler.jl (which recently had its 1.0 release) is a package that makes it easy to create custom sysimages which can include other packages than the default standard libraries. This can be used in cases where a commonly used package is slow to load or has functions with high overhead for the first call.
In addition, PackageCompiler.jl can create apps that can be downloaded and directly run on a machine that doesn’t have Julia installed. It works together with the artifact system allowing automatic bundling of external binaries and libraries. This allows one to ship quite sophisticated apps written in Julia in a simple manner.
This talk will expand on the points above and show the API of PackageCompiler.jl v1.0.
- Contributor to Base and many packages (Pkg.jl, OhMyREPL.jl, PGFPlotsX.jl, TimerOutputs.jl, JuAFEM.jl, NearestNeighbors.jl, etc)
- Release manager for Julia.
- Software engineer at Julia Computing.
- PhD-student in mechanical engineering at Chalmers University of Technology, Sweden.