Editions Ideas
Nick Treleaven
nick at geany.org
Mon Dec 15 12:26:04 UTC 2025
On Saturday, 13 December 2025 at 21:25:29 UTC, Sadiel wrote:
> This is a list of things that the D team have wanted to remove
> over the years:
>
> - Complex number support
As it's already deprecated, should be OK to error on this in an
edition.
> - Lazy attribute
> - Some problematic features of classes,
Do you mean something like ProtoObject?
> __traits(compiles, ...)
Can you expand on that?
> - alias this
For classes, maybe it would be sufficient to:
1. Forbid alias this from producing anything that implicitly
converts to Object.
2. Forbid alias this if a superclass has already defined it.
For structs, I think there was some plan to replace it, but I
never saw details.
> - Extern C++ with an identifier for the namespace
>
> Now, what I would like is to simplify the syntax:
> There are like 5 ways of creating delegates, wouldn't be better
> to stick to one?
It might be justified to remove BlockStatement from
[FunctionLiteral](https://dlang.org/spec/expression.html#function_literals), to make parsing easier. Use `() { ... }` instead.
> Make different keywords instead of overusing them, for example
> static.
I think that would need to demonstrate that overloading static
has a cost for people once they've learnt the language, or that
learning the meanings is a significant obstacle. There's the cost
of new keywords breaking existing code, unless they start with
`__`. Also learners may get confused about 2 forms of syntax as
long as the `static` syntax variant is supported.
IMO we should use editions to fix bug-prone features, reduce
unnecessary complexity or fix badly implemented features. I think
there should be a reasonable limit to the amount of breakage when
upgrading editions, prioritized by need. Just redesigning syntax
needs quite a high bar to justify it.
> For completeness this are things that the D team have wanted to
> add or change over the years:
> - Constructor syntax
Recently there has been discussion of explicit this parameters,
but I don't know that removal of current syntax would happen.
Additions can happen without an edition.
> - Pattern Matching
> - Import C++
More information about the Digitalmars-d
mailing list