I don't want to rain on everyone's parade (both Nim and Rust), but regarding 
thread safety none of Nim or Rust or any language besides maybe Ada/Sparks and 
Haskell address what is needed to write concurrent data structure safely.

In both Rust or Nim the borrow checker or sink/lent annotations will ensure 
that you move ownership across threads instead of accidentally sharing or 
free-ing what you don't own. However to prove that your concurrent data 
structures are without races, deadlocks or livelocks you need formal 
verification.

Rust does have a library for that <https://github.com/tokio-rs/loom> because a 
borrow checker is not enough contrary to the usual claims about "concurrency 
without data races".

This is the second part of my RFC <https://github.com/nim-lang/RFCs/issues/222> 
Correct-by-construction thread synchronization which I started to research in 
<https://github.com/mratsim/weave/issues/18> and implement in 
<https://github.com/mratsim/weave/pull/127> (but no time to finish)

Reply via email to