3 ms·
> There aren’t currently any mainstream programming languages that feature reference capabilities. Does Rust not have something similar built into the borrow c
by saagarjha 7y ago
> There aren’t currently any mainstream programming languages that feature reference capabilities.
Does Rust not have something similar built into the borrow checker?
- foota 7y agoI don't think you can hold multiple mutable non-overlapping slices though, which this would appear to allow. Edit: I see you're talking about pony, not the op. It would seem your comment is correct. Although, pony seems to have a slightly different perspective on it.
- dbaupp 7y agoRust allows multiple mutable non-overlapping slices. They cannot be constructed by direct array[i..j] slicing, but there is a variety of convenience functions for it. Sequential: https://doc.rust-lang.org/std/primitive.slice.html#method.split_at_mut https://doc.rust-lang.org/std/primitive.slice.html#method.sp... https://doc.rust-lang.org/std/primitive.slice.html#method.split_at_mut https://doc.rust-lang.org/std/primitive.slice.html#method.sp... Parallel: https://docs.rs/rayon/1.2.0/rayon/slice/trait.ParallelSliceMut.html#method.par_chunks_mut https://docs.rs/rayon/1.2.0/rayon/slice/trait.ParallelSliceM...
- spooneybarger 7y agoSimilar goals, very different implementation. The goal is memory safety, but rust has the borrow checker which is rather different than reference capabilities.
- nickpsecurity 7y agoThey told me Rust uses affine types (i.e. its move semantics). Clay language (see Lea Wittie et al) used linear and singleton types. Pony has reference capabilities. http://jtfmumm.com/blog/2016/03/06/safely-sharing-data-pony-reference-capabilities/ http://jtfmumm.com/blog/2016/03/06/safely-sharing-data-pony-...