# Static.jl vs StaticNumbers.jl

**URL:** <https://discourse.julialang.org/t/static-jl-vs-staticnumbers-jl/87228>\
**Category:** Tooling\
**Created:** [September 13, 2022, 6:27pm UTC](https://discourse.julialang.org/t/static-jl-vs-staticnumbers-jl/87228 "2022-09-13T18:27:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [September 14, 2022, 8:58am UTC](https://discourse.julialang.org/t/static-jl-vs-staticnumbers-jl/87228/4 "2022-09-14T08:58:04Z")

</div>

StaticNumbers.jl is a lot older than Static.jl, and at the time, there was not so much discussion about invalidations affecting load time. Also, constant propagation in Julia was not nearly as good as it is now. I think it is really cool that something like StaticNumbers.jl is possible to do in Julia, but that’s mostly theoretical, and In practice I tend to use `Val` instead in my own code in the rare cases where constant propagation is not enough.

What I really would wish for in the core language is [a feature that lets you branch on whether a value is known at compile time](https://discourse.julialang.org/t/branch-on-whether-a-value-is-known-to-the-compiler/34850), without having to use a `Static` or `Val` type at all.

---

_[View the full topic](https://discourse.julialang.org/t/static-jl-vs-staticnumbers-jl/87228)._
