News for hackers. Stuff that matters.
Re:Xi: an editor for the next 20 years [video] by willtim on Tuesday January 30, 2018 @04:06PM (#16269021)
A rope data structure is very almost persistent. So perhaps I am splitting hairs! It could of course be made fully persistent if mutating operations are avoided. This would allow sharing them between threads.
Re:Xi: an editor for the next 20 years [video] by steveklabnik on Tuesday January 30, 2018 @04:16PM (#16269118)
> This would allow sharing them between threads.

This is an area where Rust ends up feeling different than many languages: xi's rope uses https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#metho... like this: https://github.com/google/xi-editor/blob/422948d62688dcc2ee0... , which gives you both options. This code uses Rc, not Arc, so it's not currently sharable between threads, but Arc has the same API.

Rust cares about sharing more than immutability.

Re:Xi: an editor for the next 20 years [video] by raphlinus on Tuesday January 30, 2018 @04:52PM (#16269426)
Nope, it's Arc for exactly that reason, though we're not currently using it across threads right now. The fact that it can support immutable semantics safely is one of the really nice features of Rust.