TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Bolt: A research language with finer-grained concurrency than Rust

103 pointsby mrathi12about 5 years ago

2 comments

comexabout 5 years ago
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.
评论 #23131875 未加载
评论 #23130327 未加载
评论 #23131308 未加载
评论 #23130852 未加载
评论 #23130660 未加载
评论 #23133198 未加载
TheAsprngHackerabout 5 years ago
Discussion on r&#x2F;ProgrammingLanguages: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;ProgrammingLanguages&#x2F;comments&#x2F;gg0cmd&#x2F;bolt_a_new_language_with_datarace_freedom&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;ProgrammingLanguages&#x2F;comments&#x2F;gg0cm...</a>