News for hackers. Stuff that matters.
Re:Copying data is wasteful, mutating data is dangerous by wlib on Thursday January 09, 2020 @01:47PM (#22004153)
Isn't this solved perfectly with an affine or linear type-aware optimizing compiler? Where all data is immutable unless the types prove to the compiler that there are no mutation conflicts. I believe Rust implements this and Idris 2 does so as well with quantitative type theory.
Re:Copying data is wasteful, mutating data is dangerous by masklinn on Thursday January 09, 2020 @02:07PM (#22004345)
Rust would be very different and the problem wouldn't exist in the first place, because the function would signal its behaviour and intent through taking the parameter by reference, mutable reference or value.
Re:Copying data is wasteful, mutating data is dangerous by wlib on Thursday January 09, 2020 @02:17PM (#22004449)
That's what I meant