It is the year 2020: why should I use / learn D?

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Nov 16 02:02:26 UTC 2018


On Thu, Nov 15, 2018 at 06:03:37PM -0700, Jonathan M Davis via Digitalmars-d wrote:
[...]
> *sigh* Honestly, auto-decoding is almost a perfect storm of issues for
> us being able to actually get rid of it. So, while I agree with you
> that we'd ideally fix the problem, it's _not_ an easy one to fix, and
> really the only "easy" way to fix it is to pretty much literally say
> "D3" and hard break all code. I think that the reality of the matter
> is that there are issues in every language that you can't fix without
> either creating a new language or creating a new version of the
> language that's not backwards compatible with the old one (which then
> forks the language and community).  So, while we'd very much like to
> fix everything, there are going to be some things we simply can't fix
> if we're not willing to create D3, and talking about D3 creates a
> whole other can of worms, which I don't think we're even vaguely ready
> for yet.

Talking about D3 has sorta become taboo around here, for understandable
reasons -- splitting the community now might very well be the death of D
after that Tango vs. Phobos fiasco.  Python survived such a transition,
and Perl too AIUI.  But D currently does not have nearly the size of
Python or Perl to be able to bear the brunt of such a drastic change.

Nevertheless I can't help wondering if it would be beneficial to one day
sit down and sketch out D3, even if we never actually implement it. It
may give us some insights on the language design we should strive to
reach, based on the experience we have accumulated thus far.
Autodecoding, even though it's a commonly mentioned example, actually is
only a minor point as far as language design is concerned.  More
fundamental issues could be how to address the can of worms that
'shared' has become, for example, or what the type system might look
like if we were to shed the vestiges of C integer promotion rules.


> Maybe auto-decoding will turn out to be fixable, maybe it won't, but I
> think that it's going to be inevitable that _some_ things will be
> unfixable. I love D, but it's never going be perfect. No programming
> language will be, much as I would love to use one. We should do the
> best that we can to approach perfection, but we're going to miss in
> some places, and as it stands, we definitely missed when it comes to
> auto-decoding.
[...]

It's true that at some point, you just have to dig in and work with what
you have, rather than wish for an ideal language that never arrives.
Still, one can't help wondering what the ideal language might look like.

A crazy wishful thought of mine is versioned support of the language,
analogous to versioned library dependencies.  Imagine if we could
specify a D version in source files, and the compiler switches to
"compatibility" mode for D2 and "native" mode for D3.  The compiler
would emit any necessary shunt code to make code compiled in D2 mode
binary-compatible with code compiled in D3 mode, for example (modulo
incompatible language changes, of course).  This way, existing codebases
could slowly transition to D3, module-by-module.  Sorta like the
-dipxxxx switches, but embedded in the source file, and on a larger
scale.

(I know this is probably not feasible in practice, because of the
massive amount of work it will take to maintain parallel language
versions in the same compiler, which will require manpower we simply do
not have. But one can dream.)


T

-- 
My father told me I wasn't at all afraid of hard work. I could lie down right next to it and go to sleep. -- Walter Bright


More information about the Digitalmars-d mailing list