== Quote from Leandro Lucarella ([email protected])'s article > Andrei Alexandrescu, el 5 de noviembre a las 09:57 me escribiste: > > Leandro Lucarella wrote: > > >Andrei Alexandrescu, el 5 de noviembre a las 08:48 me escribiste: > > >>First off: _all_ languages except C, C++, and assembler are or at > > >>least claim to be safe. All. I mean ALL. Did I mention all? If that > > >>was some ideology that is not realistic, is extremely difficult to > > >>achieve, and ends up too painful to use, then such theories would be > > >>difficult to corroborate with "ALL". Walter and I are in agreement > > >>that safety is not difficult to achieve in D and that it would allow > > >>a great many good programs to be written. > > > > > >I think the problem is the cost. The cost for the programmer (the subset > > >of language features it can use is reduced) and the cost for the compiler > > >(to increase the subset of language features that can be used, the > > >compiler has to be much smarter). > > > > > >Most languages have a lot of developers, and can afford making the > > >compiler smarter to allow safety with a low cost for the programmer (at > > >least when writing code, that cost might be higher performance-wise). > > > > D is already a rich superset of Java. So the cost of making the > > language safe and useful was already absorbed. > That's an unfair comparison. Java has a very efficient GC (partially > because of safety), so using D as it were Java yields very inefficient > programs (using classes and new all over the places).
Why does safety have to do w/ Java's GC quality? IMHO it's more a language maturity and money thing. The only major constraint on D GC is unions and even in that case, all we need is one bit that says that stuff in unions needs to be pinned. I think we already agree that storing the only pointer to GC allocated memory in non-pointer types, xor linked lists involving GC allocated memory, etc. are undefined behavior. Other than that and lack of manpower, what prevents a really, really good GC from being implemented in D?
