https://github.com/juliaarrays/staticarrayinterface.jl
Interface designs for enforcing static computations in array functions with Julia
https://github.com/juliaarrays/staticarrayinterface.jl
Last synced: 12 months ago
JSON representation
Interface designs for enforcing static computations in array functions with Julia
- Host: GitHub
- URL: https://github.com/juliaarrays/staticarrayinterface.jl
- Owner: JuliaArrays
- License: mit
- Created: 2023-02-18T10:26:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T14:49:56.000Z (over 2 years ago)
- Last Synced: 2024-05-08T21:14:07.453Z (about 2 years ago)
- Language: Julia
- Size: 323 KB
- Stars: 13
- Watchers: 8
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.bib
Awesome Lists containing this project
README
# StaticArrayInterface.jl
[](https://docs.sciml.ai/StaticArrayInterface/stable/)
[](https://github.com/JuliaArrays/StaticArrayInterface.jl/actions?query=workflow%3ACI)
[](https://buildkite.com/julialang/StaticArrayInterface-dot-jl)
[](https://codecov.io/gh/JuliaArrays/StaticArrayInterface.jl)
The AbstractArray interface in Base Julia does not always enforce static guarantees.
For example, if the size of an array is known at compile time, many of the indexing
schemes are not specialized to make use of that size to build fully optimized code.
In most cases a user should rely on the compiler to deduce the static properties
and perform the optimization. However, some brave souls believe they can beat the
compiler, and this library is for them.
Functions like `known_length` return values using [Static.jl](https://github.com/SciML/Static.jl)
which encode all of the information at the type level, which in turn forces the
computation to occur at compile time.
## Is This Library About StaticArrays?
No, not necessarily. StaticArrays.jl is one library about array types which have static compile
time information. However, there are many other array types with static compile time information.
The purpose of this library is to be able to write code generic to all of those libraries
which also keep this property of enforcing the computation is at compile time by using
the type space.
## Warning: Compile Times
Because this library enforces things be done at compile time by encoding everything
into types, using it will increase your compile times. You have been warned, now
proceed (with caution).