Is it time for D 3.0?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Mar 27 17:32:44 UTC 2020


On Fri, Mar 27, 2020 at 11:56:40AM -0400, Steven Schveighoffer via Digitalmars-d wrote:
> There have been a lot of this pattern happening:
> 
> 1. We need to add feature X, to fix problem Y.
> 2. This will break ALL CODE IN EXISTENCE
> 3. OK, cancel the fix, we'll just live with it.
> 
> Having a new branch of the compiler will provide a way to keep D2
> development alive while giving a playground to add new mechanisms, fix
> long-existing design issues, and provide an opt-in for code breakage.

What about supporting multiple versions of the language simultaneously,
using some kind of version directive at the top of each file?  It will
mean more work to develop and maintain the compiler, but the benefit is
that *no* code will break, and users can migrate old code incrementally
and at their leisure by bumping the version directive on a file and
fixing any subsequent errors.

As Andrei said once, one solution to the problem of not breaking old
code while improving new code is additive enhancements rather than
replacing old things outright.  If there's a breaking language change,
maybe there's a way to keep the old behaviour for old code while
changing it for new code. Versioned source files is one way to do this,
albeit at the cost of greater complexity in the compiler.


> Some issues I can think of:
> 
> 1. The safe by default debate
> 2. pure by default
> 3. nothrow by default
> 4. String interpolation DIP
> 5. auto-decoding
> 6. range.save
> 7. virtual by default
> 8. ProtoObject

Yeah, pretty much all of these items would be nice to have in my book.


[...]
> The biggest drawback is that we aren't a huge language, with lots of
> manpower to keep x branches going at once.

Yeah, forking the compiler now may have major unforeseen consequences.

Supporting multiple versions of the language simultaneously will also
put a drain on our resources, and there will be tricky issues about how
to interoperate code written in different versions of D, but at least it
still keeps it all in one place.


> I just wanted to throw it out as a discussion point. We spend an awful
> lot of newsgroup server bytes debating things that to me seem obvious,
> but have legitimate downsides for not breaking them in a "stable"
> language.
[...]

Yes, we're gradually becoming everything we hated about C++. Perhaps
it's not as simple to do better, as we once thought! ;-)


T

-- 
Do not reason with the unreasonable; you lose by definition.


More information about the Digitalmars-d mailing list