More evidence that memory safety is the future for programming languages

rikki cattermole rikki at cattermole.co.nz
Sat Mar 28 23:14:05 UTC 2020


On 29/03/2020 9:24 AM, Walter Bright wrote:
> https://news.ycombinator.com/item?id=22711391
> 
> Fitting in with the push for @safe as the default, and the @live 
> Ownership/Borrowing system for D.
> 
> We can either get on the bus or get run over by the bus.

"This is why D requires and @live attribute be added to functions to 
enable the checking for just those functions, so it doesn't break every 
program out there."

Interesting quote there.

But what if we want to use these semantics isolated and not turn it on 
in every function in use?

The alternative I have been proposing is headconst tied to lifetimes, 
basically a borrowed pointer just with a bit of extra syntax that does 
propagate within a type.

https://gist.github.com/rikkimax/4cb2cc8ddcac33c1a9bb20de432f9dea


More information about the Digitalmars-d mailing list