BTW in a comment he mentioned that Rust offers concurrency safety. Can someone elaborate on the concurrency model of Rust? I completed the xv6 lock lab a few days ago and it was one of the most difficult labs. Hard to debug and easy to mess up.
Are you sure you mean concurrency safety, and not thread safety?
I think Rust's concurrency safety (e.g. async on a single thread) is mostly granted by the Pin trait [1], and the async code-gen making sure lifetimes make sense over .await points (which requires things to be either pinned across those points, or to not care about their location in memory potentially moving).
Thread safety is instead given by a couple of auto-derived marker traits, called Send and Sync [2], that denote which kinds of data can be sent or shared between threads safely.
This is coupled with types like Arc, Mutex, etc that can wrap data that isn't safe to share, so that the wrapped data as a whole is safe to share. It is also coupled with functions (like std::thread::spawn [3] and MPSC's send()) that have a requirement for the data to either be Sync/Send, or to take full ownership of it (which ensures there are no other active references to it).
[dupe] and article is out of date (other than being day late on the original story) as the LinkedIn poster updated his post walking back some of the statements.
markus_zhang|2 months ago
https://www.linkedin.com/feed/update/urn:li:activity:7407863...
BTW in a comment he mentioned that Rust offers concurrency safety. Can someone elaborate on the concurrency model of Rust? I completed the xv6 lock lab a few days ago and it was one of the most difficult labs. Hard to debug and easy to mess up.
whytevuhuni|2 months ago
I think Rust's concurrency safety (e.g. async on a single thread) is mostly granted by the Pin trait [1], and the async code-gen making sure lifetimes make sense over .await points (which requires things to be either pinned across those points, or to not care about their location in memory potentially moving).
Thread safety is instead given by a couple of auto-derived marker traits, called Send and Sync [2], that denote which kinds of data can be sent or shared between threads safely.
This is coupled with types like Arc, Mutex, etc that can wrap data that isn't safe to share, so that the wrapped data as a whole is safe to share. It is also coupled with functions (like std::thread::spawn [3] and MPSC's send()) that have a requirement for the data to either be Sync/Send, or to take full ownership of it (which ensures there are no other active references to it).
[1] https://doc.rust-lang.org/std/pin/struct.Pin.html
[2] https://doc.rust-lang.org/std/marker/trait.Sync.html
[3] https://doc.rust-lang.org/std/thread/fn.spawn.html
__patchbit__|2 months ago
epic games' language in development is referenced here in this presentation
unknown|2 months ago
[deleted]
ChrisArchitect|2 months ago
Update in the HN thread: https://news.ycombinator.com/item?id=46360955
andsoitis|2 months ago