About static compilation and static analysis

Julia doesn’t need 2.0 to compile to binaries, since it’s already possible.

As you may know PackageCompiler.jl makes it possible (and while I’ve not used it recently, I understand it’s much improved in recent years, or was it only since Nov 2.0 version, since I used it).

You may want to look into non-default options with that packages, and new non-default options in Julia 1.8:

  • New option --strip-metadata to remove docstrings, source location information, and local variable names when building a system image (#42513).
  • New option --strip-ir to remove the compiler’s IR (intermediate representation) of source code when building a system image. The resulting image will only work if --compile=all is used, or if all needed code is precompiled (#42925).

Poor support for static compilation

That should have all features, e.g. threading and GC, and Windows ok. But you can also look at, without that:

Tools to enable StaticCompiler.jl-based static compilation of Julia code (or more accurately, a subset of Julia which we might call “unsafe Julia”) to standalone native binaries by avoiding GC allocations and llvmcall-ing all the things!