Windows experience is atrocious

H. S. Teoh hsteoh at qfbox.info
Tue Jul 25 16:51:04 UTC 2023


On Tue, Jul 25, 2023 at 03:06:22PM +0000, harakim via Digitalmars-d wrote:
[...]
> In the end, I would like an ecosystem of IDEs, libraries and tools
> that don't even exist in other languages. Until there is a way to take
> a 2-year-old abandoned project and pick it up and build it, it will be
> starting from scratch each time and a lot of the tools will not get
> built and stay built. It has to be something where work done is done
> and not lost.  I would like a roadmap to that before I personally
> commit a lot of my time to it.
[...]

This is why I came up with the versioning idea.  Basically, we need to
face the reality that a lot of code, once written, is going to stay that
way.  Once in a while you might refactor a bit of code here and there,
maybe even rewrite a module or two, but 90% of the code is going to stay
untouched for a long time, many years even. This is especially true if
we want D's library ecosystem to grow.  The bigger the ecosystem
becomes, the more code you'd have to rewrite to keep up-to-date with the
language if we continue updating it.  This is inescapable.  The result
is that more and more D code will accumulate in the ecosystem, and the
more it accumulates, the less likely someone will have the time / energy
/ motivation to rewrite it all when the language undergoes a fundamental
change.

The only solution, to avoid having to do a massive rewrite of 90% of D's
entire ecosystem every time there's a language change, is to have the
compiler understand old code and compile old code in the way it was
supposed to be compiled years ago.

Just think about it.  In human language, the same thing happens. Most
literary works in any language, including English, consists of a large
body of works written in an older dialect of the language -- think
Chaucer, Shakespeare, and more recent, but not contemporary authors --
in the 1900's, in the 1950's, etc.. When you read them, you get the
distinct sense that they used certain words differently from how we use
them today.  Yet our human brain automatically adapts itself, and parses
the older language *according to the older language*, so that we don't
have to rewrite Shakespeare in 2023's modern English just to be able to
read it.  Nobody's gonna rewrite the entire body of English literature
just to keep up with the modern language, that's totally impractical.
And nobody's gonna throw away older literature just because it's "not
compatible" with the modern language.  No, we keep the older stuff
around, and the contemporary language continues evolving like it always
has.

How do we reconcile the two?  It's not that hard, you just spontaneously
understand when you're reading a 1950's novel, for example, that it's
older literature, and they used certain expressions (language
constructs) we don't use today, but by looking at the context you can
more-or-less figure out what it means. And you just adapt your reading
accordingly to understand the text.

In compiler terms, this just means that the compiler has to (1)
understand that it's dealing with code meant for an older version of the
language, and (2) based on that knowledge adapt the way it processes the
code in a way that preserves its original meaning.

Tagging code with versions takes care of (1); that leaves the compiler
to implement (2), and it would work.

Something along these lines has to be done, otherwise we're never gonna
move forward.  The ecosystem is just gonna stagnate because the more the
language advances, the more old code and old libraries will stop
compiling.  But not changing the language doesn't work either -- English
in 2023 is different from English in 1823 for a reason.  It has to keep
up with the times.  Imagine if we still spoke Shakespearean English
today just because we feared that change would obsolete existing
literature.  That'd be ridiculous.  We need both progress and
compatibility with older literature (i.e., existing code).


T

-- 
Тише едешь, дальше будешь.


More information about the Digitalmars-d mailing list