Memory/Allocation attributes for variables

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sat Jun 5 18:52:24 UTC 2021


On Saturday, 5 June 2021 at 17:55:26 UTC, Elmar wrote:
> `scope` exists for a good reason because guaranteeing compiler 
> optimization is very hard (apparently). The `scope` attribute 
> has two benefits: 1st it makes RAII explicit (which helps to 
> prevent bugs by falsely using it), 2nd it makes the compiler 
> faster and easier because it doesn't need to understand the 
> code in order to search for optimization places.

But introducing all these special cases just to avoid explicit 
lifetimes like Rust is making the language more complicated, not 
less.

The intention is to make it less complicated, but that will not 
be the end result, I think.

I don't think one can evolve a solution. It has to be designed as 
a whole, not one piece at a time like D is doing now.



More information about the Digitalmars-d mailing list