Closed orenbenkiki closed 2 years ago
As you can see the package is not actively maintained as people did not really decide to start using it. Still - feel free to make a PR and I can make a release. Thank you!
Hmmm... I was planning to use it, or at least support its usage in my package (which allows people to store all kind of arrays in a container). Should I worry about the package being incomplete in general?
I suppose that since Julia doesn't really believe in immutability, I shouldn't fight on being uniodiomatic and settle for "strongly urging" people to avoid modifying things they shouldn't?
If so, a pity - immutability is important for thread-safety, and I was planning on using this package to (mostly) ensure it in the relevant cases for people using the "normal operations". I realize people can always access .parent
if they want to forcibly get mutable access but anyone doing that should "really know what he's doing".
Thanks :-(
I guess what you write is indeed the core of the problem. The immutability is easily broken so people did not start to rely on this package as it does not give much benefit. Maybe use https://github.com/JuliaArrays/StaticArrays.jl as they can guarantee immutability (assuming your arrays are not super large).
Oh, my arrays are definitely super-large... up to several GBs in size.
I can enforce some immutability in the special case where I memory-map the arrays from disk files - mmap
mercifully does work on files opened for read-only. But my APIs are uniform for in-memory and memory-mapped arrays and I was hoping to be able to provide immutability in both cases.
I can't help but think that if Julia is successful (which I definitely wish it to be), it will discover that ignoring immutability will be an issue, since multi-threaded code is becoming more and more prevailent. And immutability is useful in general - even Python with its GIL (so effectively no multi-threading) supports a writeable
flag in Numpy arrays...
Oh well. Thanks for the quick response!
maybe open an issue for this in Julia Base repo and CC me there as I agree :).
I submitted JuliaLang/julia#42157 FWIW.
As shown by:
I'd have expected a slize of a read-only array to also be a read-only array.