safety model in D

Jesse Phillips jessekphillips+D at gmail.com
Thu Nov 5 09:21:07 PST 2009


Andrei Alexandrescu Wrote:

> Leandro Lucarella wrote:
> > A clear example of this, is not being able to take the address of a local.
> > This is too restrictive to be useful, as you pointed in you post about
> > having to write static methods because of this. If you can't find
> > a workaround for this, I guess safety in D can look a little unrealistic.
> 
> Most other languages do not allow taking addresses of locals. Why are 
> they realistic and SafeD wouldn't? Just because we know we could do it 
> in unsafe D?

I think part of the problem is that current users of D have picked it up because they do get this power. But it makes sense that there are potential users that would like the compiler to prevent them from unsafe constructs. And I can't imagine it being more restrictive than Java or C# which are very popular languages.

I do like the different approaches though taken by C# and D. C# took a safe model and punched holes in it. D is taking an unsafe model and restricting it.



More information about the Digitalmars-d mailing list