Can non-nullable references be implemented as a library?

bearophile bearophileHUGS at lycos.com
Sun Nov 7 10:45:35 PST 2010


so:

> Also It is not only Andrei, every single people here agreed on stopping  
> "lets add this new feature to D today".

What's stopped is adding features to D2, but I have meant nonull types for D3. I don't think D evolution is finished right now. On the other hand new features add complexity, so they may refused in many cases (there are several other things that may be added to D3, like macros, pattern matching, integral overflows, ranged integrals, etc. But some such features add a lot of complexity to a language that's not simple already).


> If supporting a feature looks/is impossible for user we should improve the  
> language to help us solve this not just add the specific feature.
> You know there'll never be enough features :)

Are you saying that D may be improved to allow defining good enough nonnull types in user code? This is possible, but it's very hard. It requires macros and a powerful type system that's probably beyond what D will ever hope to have, because maybe not even CommonLips macros are enough for this (and even if such changes will be implemented, the resulting language will be harde to use as ATS or more, I don't think lot of people here will be happy with it). So to not increase the language complexity too much, some features need to be implemented at front-end level. It's a matter of trade-offs.

Bye,
bearophile


More information about the Digitalmars-d mailing list