# \[ANN\] StaticTools.jl: Enabling StaticCompiler.jl-based compilation of Julia code to standalone native binaries by avoiding GC allocations and \`llvmcall\`-ing all the things

**URL:** <https://discourse.julialang.org/t/ann-statictools-jl-enabling-staticcompiler-jl-based-compilation-of-julia-code-to-standalone-native-binaries-by-avoiding-gc-allocations-and-llvmcall-ing-all-the-things/80398>\
**Category:** Package Announcements\
**Tags:** announcement, compilation\
**Created:** [May 3, 2022, 3:34am UTC](https://discourse.julialang.org/t/ann-statictools-jl-enabling-staticcompiler-jl-based-compilation-of-julia-code-to-standalone-native-binaries-by-avoiding-gc-allocations-and-llvmcall-ing-all-the-things/80398 "2022-05-03T03:34:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brenhinkeller](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brenhinkeller/32/36648_2.png) [@brenhinkeller](https://discourse.julialang.org/u/brenhinkeller)\
**Post date:** [May 3, 2022, 3:34am UTC](https://discourse.julialang.org/t/ann-statictools-jl-enabling-staticcompiler-jl-based-compilation-of-julia-code-to-standalone-native-binaries-by-avoiding-gc-allocations-and-llvmcall-ing-all-the-things/80398/1 "2022-05-03T03:34:57Z")

</div>

Technically this one has been registered for a couple months already, but we never made an announcement, so here goes! [GitHub - brenhinkeller/StaticTools.jl: Enabling StaticCompiler.jl-based compilation of (some) Julia code to standalone native binaries by avoiding GC allocations and llvmcall-ing all the things!](https://github.com/brenhinkeller/StaticTools.jl)

I’ve just released version 0.3, which brings a _lot_ of major changes. While it’s still a somewhat experimental package, I think it’s at least to some extent ready for other folks to use, or just to explore and see if the techniques herein could be useful in other contexts.

While the examples in the README currently focus on command-line executables, all the techniques here for making things standalone-StaticCompiler-able will also work for making `.so`/`.dylib` shared libraries that could be called from other languages (as in [Successful Static Compilation of Julia Code for use in Production](https://discourse.julialang.org/t/successful-static-compilation-of-julia-code-for-use-in-production/79318)) – just switch from `StaticCompiler.compile_executable` to `StaticCompiler.compile_shlib`.

PRs welcome!

---

<div class="post-metadata">

**Author:** ![brenhinkeller](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brenhinkeller/32/36648_2.png) [@brenhinkeller](https://discourse.julialang.org/u/brenhinkeller)\
**Post date:** [May 3, 2022, 3:35am UTC](https://discourse.julialang.org/t/ann-statictools-jl-enabling-staticcompiler-jl-based-compilation-of-julia-code-to-standalone-native-binaries-by-avoiding-gc-allocations-and-llvmcall-ing-all-the-things/80398/2 "2022-05-03T03:35:38Z")

</div>

One fun example: [Mandelbrot Set in the terminal with compiled Julia - YouTube](http://www.youtube.com/watch?v=YsNC4oO0rLA)

---

<div class="post-metadata">

**Author:** ![jakebolewski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakebolewski/32/35921_2.png) [@jakebolewski](https://discourse.julialang.org/u/jakebolewski)\
**Post date:** [May 3, 2022, 2:50pm UTC](https://discourse.julialang.org/t/ann-statictools-jl-enabling-staticcompiler-jl-based-compilation-of-julia-code-to-standalone-native-binaries-by-avoiding-gc-allocations-and-llvmcall-ing-all-the-things/80398/3 "2022-05-03T14:50:22Z")

</div>

Nice demo! It is cool to see the static compilation effort progressing.
