by ubj · 2y ago · 0 comments
Until Julia provides first-class support for AoT compilation of (small) binaries and libraries, I don't see it being a competitive single-language option for large-scale projects. And yes I'm aware of PackageCompiler.jl and StaticCompiler.jl (and even GPUCompiler.jl!) They do not provide first-class support for AoT compilation. There's a massive difference between the user experience of compiling a binary with those packages [1] as compared with, e.g., compiling a Mojo binary [2].
I would love to see Julia improve and become more widespread, but I see a strong possibility of it being disrupted by another language unless it improves on this front.
[1] https://julialang.github.io/PackageCompiler.jl/dev/apps.html
[2] https://docs.modular.com/mojo/manual/get-started/hello-world...
Julia with a proper `Julia -compile` flag that results in a proper binary of reasonable size would catapult Julia from "kinda nice, but limited" into "one of my favourite languages" territory.
Julia itself calls AoT binaries, for example when calling Linear Algebra functions [1].
Chris Rackauckas's team had to leverage AoT compilation (i.e. system images) to reduce TTFX on DifferentialEquations.jl [2].
PyTorch and Tensorflow run without TTFX because they use AoT compiled binaries. What's more, most end users don't have to compile anything on their computer--they can simply download the binaries and libraries.
For small scripts, yes you can simply distribute the package and have the user recompile on the fly. But imagine if your operating system had to recompile every time you turned the computer off. Or if an autonomous vehicle had to recompile an unseen patch of code while in motion.
[1] https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Stand...
In 2022 with Julia v1.8. See the edit from September. With Julia v1.10 it's mostly there without system image building since v1.9 added AoT compilation of packages during precompilation time and then v1.10 did a major improvement to that system. So as you said, AoT is required, though Julia now includes AoT as part of its package build system. I tend to not build system images anymore because of that, though there are a few more steps to get it to fully AoT (i.e. some load time reductions).