No we should not support enum types derived from strings

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon May 10 22:37:51 UTC 2021


On Monday, 10 May 2021 at 21:44:02 UTC, deadalnix wrote:
> The bad news is, there is already a language like this. It's 
> called C++, and it's actually quite successful. With all due 
> respect to you and Walter, you guys are legends, but I think 
> there is also a bit of learned helplessness coming from both of 
> you due to a lifetime of exposure to the soul corroding effects 
> of C++.

Not sure how this applies to C++, what subtyping issues are you 
having with C++?


> This attitudes pervades everything, and most language 
> constructs suffer of some form of it in one way or another, 
> causing a cascade of bad side effects, starting with this whole 
> thread. A few examples en vrac for instance: DIP1000, delegate 
> context qualifiers, functions vs first class functions, etc...

That's a direct result of the process. Features have always been 
added as an experiment rather than being completed on paper, even 
the ones with a DIP. At this point, this pretty much defines what 
D is... Just look at the addition of a C compiler that is being 
advanced right now. It is being added because there might be some 
benefits from it the future, perhaps. Of course, you also have 
the side effect that the AST becomes more resistant to change... 
and refactoring costs doubles...

So that is why D has these issues. People wanted something, and 
it was added in an experimental way, not in an analytical way. 
That is the way of D. Experiment in features.

Ideally D should have boosted meta programming and cut down on 
features to the bare minimum. Literals should have been a compile 
time type... and alias should bind to them, strings should've 
been a library construct, etc etc.

But if you look at the features being added, meta programming is 
not in focus. So this won't change. Features are being added that 
has nothing to do with metaprogramming (memory safety, C interop 
etc).

D will continue to evolve experimentally.

So there will never be a small core language that is consistent.

It is what it is, at this point.



More information about the Digitalmars-d mailing list