I’d like to share GooseArrays.jl, a package inspired by Goose’s memory management approach.
The idea is to provide temporary, mutable Julia arrays with fixed sizes and explicit lifetimes, backed by a reusable memory arena rather than ordinary GC-managed array storage.
The package provides two main types:
GooseArray: fixed-size arrays without specializing on their length.
StaticGooseArray: arrays with dimensions encoded in the type for additional compiler optimizations.
Here’s a small example:
using GooseArrays
result = with_datastack(1 << 20) do s
x = GooseVector{Float64}(s, undef, 4)
fill!(x, 2.0)
y = StaticGooseVector{Float64,4}(s, undef)
y .= 2 .* x .+ 1
Array(y)
end
I’ve also benchmarked the package against Array, FixedSizeArrays.jl, and StaticArrays.jl. The first results are promising, particularly for temporary arrays and avoiding GC allocations, although performance depends on the workload.
The package is still experimental (v0.1) with some parts a little too vibe coded and unpublished yet, I’d still be happy to get feedback, suggestions, or ideas for improvements!
One thing that may change: Normal and Static seems to have very similar perf (a little better for static) and static doesn’t seem to add unreasonable specialisation meaning GooseArrays may become a version than can change size at some point which would also clear up ;the difference with AllocArrays.jl which for now is quite close to GooseArrays
I’m not really an expert on this topic, but I cannot see how it differs from Bumper.jl. Could you elaborate a bit more on the theoretical or practical differences?
Not very familiar with Bumper.jl (I did saw it and made sure its not the same thing) so Ive let AI answer that one sorry
“”"
Good question! There is indeed a lot of overlap with Bumper.jl, especially when combined with AllocArrays.jl.
The main differences are:
Nested scopes and checked lifetimes: GooseArrays supports nested allocation scopes, with automatic memory reclamation and invalidation of arrays when their scope ends, while keeping arrays from outer scopes valid.
Array-oriented API: operations such as broadcasting, map, similar, and matrix multiplication can allocate their results directly in the arena. This is similar to what AllocArrays already provides.
So the underlying idea is not fundamentally different from Bumper. GooseArrays mainly explores the combination of checked lifetimes, nested scopes, and optimized fixed-size array operations in a single abstraction.
I haven’t benchmarked GooseArrays against Bumper or AllocArrays yet, but I think that would be a very useful comparison, especially to evaluate the overhead of lifetime checking.
“”"
Also as I said in the annoncment the dynamic size I plan to add will add quite a difference but not yet.
Well, to be honest, this answer didn’t help me much. Benchmarks or code snippets that demonstrate what can be done with GooseArrays but not with Bumper would be useful. Nested scopes are possible with Bumper, I think, and checked lifetimes, an array-oriented API, or dynamic size don’t look like something that cannot be added to Bumper.
I’m not someone with the authority to say whether GooseArrays should be registered or not, but I definitely encourage you to discuss your ideas with the authors of Bumper. I know the temptation to generate awesome packages with AI, but collaborative efforts usually pay off in terms of package quality, maintainability, and generality. A single feature-rich and battle-tested package is better than multiple half-baked solutions…
I didn’t even try to register yet and I’m not sure I’m going to.
I understand why collaboration is key and I do collaborate on some things.
if we keep telling people they should collaborate instead of showing their project especially for AI generated ones I feel like chances are that people stop sharing at all.
The thing is
a new language drop
can I remake their way of doing stack vectors instead of heap and the way they handle lifetime
yes, that’s cool, is their another project doing the exact same ? No not really it’s close though with Bumber
2 choices comes :
don’t talk about what you tried : I feel that’s a shame and people may be interested
talk about it : cool but people may tell you you should have just collaborate on the other project which is not what pushed you to make the package anyway.
So I guess it really depends the goal, if all I wanted from the first place was making a inline allocator and let’s say I find a quicker way than bumper then yes making a package is nonsense but that’s not the way I thought about this and neither what made me want to do it.
Edit : I feel like we should add another discourse section distinct from package announcement, where people can just show things that can be translated to Julia or just things that Julia can do but is not directly made to be a package unless it interest people to have it.
Sorry if I offended you or sounded unfriendly. I don’t think that you did anything wrong by presenting your idea here, and thank you for the courage to do so.
And I think the “Package announcement” category would be suitable for such a discussion, with a broader scope in its description. Probably it’s worth bringing it up in the Meta Discussion category.
I’m not don’t worry, I understand the need for collaboration in a lot of projects and a little “could you try to see if some of your idea could be moved to Bumper would be nice” would be very welcome but i felt like you were saying we shouldn’t do programming for pure fun and love for the language and should always serve the ecosystem and I don’t think this is right especially for an awsome language like Julia.
Also I’m french so everything I say sounds rude I’m not tilted at all