rustmove-semanticsmercuryclean-language

How do Rust's ownership semantics relate to uniqueness typing as found in Clean and Mercury?


I noticed that in Rust moving is applied to lvalues, and it's statically enforced that moved-from objects are not used.

How do these semantics relate to uniqueness typing as found in Clean and Mercury? Are they the same concept? If not, how do they differ?


Solution

  • The concept of ownership in Rust is not the same as uniqueness in Mercury and Clean, although they are related in that they both aim to provide safety via static checking, and they are both defined in terms of the number of references within a scope. The key differences are: