4 ms·
Check out the Pony tutorial for a good introduction to reference capabilities https://tutorial.ponylang.io/reference-capabilities.html https://tutorial.ponylan
by anaphor 7y ago
Check out the Pony tutorial for a good introduction to reference capabilities
https://tutorial.ponylang.io/reference-capabilities.html https://tutorial.ponylang.io/reference-capabilities.html
They can be tricky to wrap your head around at first, but the idea (combined with object capabilities) is very powerful IMO.
- spooneybarger 7y agoThere's also a section of the website with additional materials that we've found help people learn reference capabilities: https://www.ponylang.io/learn/#reference-capabilities https://www.ponylang.io/learn/#reference-capabilities And John Mumm recently did an excellent intro talk on them: https://www.reddit.com/r/ponylang/comments/ckagfw/john_mumm_safely_sharing_data_reference/ https://www.reddit.com/r/ponylang/comments/ckagfw/john_mumm_...
- 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-...