Want reasonable reference counting? Disable automatic sharing of immutable

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Nov 15 21:38:43 UTC 2021


On Monday, 15 November 2021 at 21:30:29 UTC, rikki cattermole 
wrote:
> const and immutables are compiler guarantees, and we shouldn't 
> be wanting the compiler to lie to us in our misunderstandings.

Hm, ```immutable```, ```const```, and ```pure``` are arbitrary 
symbols that means nothing more than what an updated language 
spec claim. Of course, one might argue that it is bad usability!

Also, you have to be in ```@trusted``` to change the setting of 
memory pages, and in ```@trusted``` you basically take upon 
yourself to uphold the spec (which involves a strong element of 
*hubris* given that few programmers know the full language 
semantics).

So that is basically the key issue. For ```@trusted``` to make 
sense, the type system has to be simple and intuitive.

So, I disagree, but I agree. :)



More information about the Digitalmars-d mailing list