Feedback on Átila's Vision for D

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Oct 15 14:38:41 UTC 2019


On Tue, Oct 15, 2019 at 01:09:15PM +0000, Mike Parker via Digitalmars-d wrote:
> This thread is for general feedback and discussion regarding Átila's
> blog post on his vision for D's future.
> 
> https://dlang.org/blog/2019/10/15/my-vision-of-ds-future/

@safe by default sounds like a VERY good idea. Can't wait to see when
we start transitioning! (Though, I'm not holding my breath on it atm --
I realize there's a lot to be done before this will be possible.)

Making D the default implementation language: this sounds a bit general.
What exactly does this mean, and what exactly does it entail?  Is this
pushing for better marketing ("hey world, let's use D as the default
implementation language"), or are we talking about something on the
implementation side here?

Interop with C++: while I applaud this goal, I'm not sure how exactly
we're going to pull this off, seeing as there are some fundamental
incompatibilities with C++ like transitive const, no Koenig lookups, a
different (albeit mostly compatible) templating system, etc.. Back in
the day C++ started off as essentially "C with classes", meaning
existing C code was practically 100% compilable as C++ (of course, there
are some subtle differences, but for the most part this is true). But
with D, some syntax like templates have a fundamentally different
syntax, and you're not gonna be able to just compile non-trivial C++
code as D without endless pages of syntax errors. This, of course, is
merely at the syntactic level. But the lack of transitive const is a
deeper problem that isn't going to be easy to solve: C++ programmers
expect to be able to cast away const without invoking UB, and in D you
just can't do that without getting into UB land.

//

Anyway, as for pet peeves / pet features: I'd like to propose having a
plan for Phobos v2 as Andrei has mentioned once.  There are some design
decisions in Phobos that are hard to reverse now, like autodecoding, the
whole shebang about .save in std.range, etc.. We *might* be able to pull
off removing autodecoding as a gradual transition, but that's impossible
for the range API since just about *everything* in Phobos uses it. The
only possible way I see is std.v2.

Plus, I'd like to see this not just as a one-off thing, but an ongoing
development and refinement of D as time goes on.  In the realm of
natural languages, languages are a living, dynamic thing that changes
and develops over time, adapting to the circumstances it's used in; it's
not a static thing that stays fixed forever. (A static natural language
is a dead one -- like Latin.)  IMO a programming language also has to be
constantly adapting and developing to fit contemporary needs, and one
should not expect it to stay static forever.  In more practical terms,
this means D needs to have *official mechanisms* in place for retiring
old features (not necessarily get rid of them -- nobody wants to be
rewriting legacy code every 5 years -- we can keep old features in the
back closet as long as they don't interfere with new ones) and
introducing new ones. std.v2 is one step in this direction, and I'd like
to see a consistent, workable scheme that would allow for std.v3,
std.v4, etc., in the distant future.

There is already the current deprecation process for relatively small,
gradual transitions; but I'd like to see a process for larger-scale
(probably longer-term) changes like std.v2, reworking the range API,
etc..


T

-- 
The right half of the brain controls the left half of the body. This means that only left-handed people are in their right mind. -- Manoj Srivastava


More information about the Digitalmars-d mailing list