Can we just have struct inheritence already?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jun 10 17:20:33 UTC 2019


On Monday, 10 June 2019 at 16:44:35 UTC, Meta wrote:
> IMO, that's a fallacy. There are constraints on a language's 
> standard library that don't exist for user code, such that 
> sometimes weird stuff has to be done to avoid or limit breaking 
> changes

I don't think so. Anyway, C++ is already a language where the 
demand for proficiency is high. So it doesn't matter, inheritance 
is the least problematic aspect of the language… Well, actually, 
inheritance is the sole purpose for its existence… so it would be 
very odd if that was a regret. Especially since Bjarne deeply 
respects Kristen and Ole-Johan based on what he has said in 
interviews.

Besides, it is reasonable to require that people who write 
libraries are skilled.  Generally,  you need at least some 
experts to provide, and sustain, a solid library in any language, 
IMHO.

Maybe it is reasonable to make a separation between features for 
framework code and features for application/user-interface code, 
rather than @safe or not.

> Just look at all the outdated and suboptimal stuff in Phobos.

Ok, but I think with any language that currently provides meta 
programming the implementation of a standard library will look 
messy. How to do it really well, in terms of legibility, is 
simply not known at this point.

I think you need a different layer for API specification and 
implementation to get around that, and to get that kind of shift 
we will have to wait for a decade of comp-sci research to be 
done, i.e. a shift towards more constraint based 
library-programming. I don't think it is possible to do this now 
in a way that scales. Except maybe for embedded programming with 
small code bases.




More information about the Digitalmars-d mailing list