Show HN: Bolt: A research language with finer-grained concurrency than Rust
So the features that the dissertation claims Rust doesn’t have are:<p>- Single-threaded mutable aliasing<p>Actually, Rust supports this in the form of the `Cell` type.  It’s admittedly not very ergonomic, though.  Also, Bolt runs on the JVM and thus has a garbage collector.  This pattern is more powerful in a garbage-collected environment, because merely reading a pointer is enough to guarantee it won’t be collected.  Suppose you (1) read a mutable field of type string, (2) call some other code that might write a different string to that field, then (3) access the string you originally read.  With garbage collection, this is safe; without it, your string might have been freed by the time you access it.  You can also make this safe with reference counting – most interpreted languages do this, Swift does it with class fields, and there are libraries to do it in Rust – but fiddling with reference counts every time you access an object is fairly slow.<p>&gt; Concurrently mutate disjoint parts of object<p>Out of the box, Rust lets you take mutable references to disjoint parts of an object and send them to different places, including different threads.  Bolt also apparently lets you pass these around as linear capabilities; translated to Rust terms, it’s like if you could take a Box&lt;(Foo, Bar)&gt; and split it into a Box&lt;Foo&gt; and Box&lt;Bar&gt;.  Rust doesn’t support this out of the box, but you can get something equivalent with the owning_ref crate (again, a bit less ergonomic, but still safe).<p>&gt; Concurrently mutate object, locking overlapping state<p>You can easily do this in Rust with Arc&lt;Mutex&lt;Foo&gt;&gt;.   Bolt apparently inserts mutexes automagically where needed, but other than that I don’t see any ergonomic difference.  Most Rust programmers would probably not appreciate mutexes being inserted automatically; locking is expensive and creates the possibility of deadlocks, so for both a performance and correctness standpoint you want to understand where mutexes are being used.