Jump to page: 1 2
Thread overview
D's tail
Aug 10, 2021
Brian Tiffin
Aug 10, 2021
Adam D Ruppe
Aug 10, 2021
evilrat
Aug 10, 2021
Guillaume Piolat
Aug 10, 2021
Dukc
Aug 10, 2021
Vladimir Panteleev
Aug 11, 2021
Bastiaan Veelo
Aug 11, 2021
jmh530
Aug 11, 2021
Johan
Aug 11, 2021
FeepingCreature
Aug 11, 2021
Bastiaan Veelo
Aug 11, 2021
Johan
Aug 11, 2021
Brian Tiffin
Aug 12, 2021
FeepingCreature
Aug 12, 2021
Brian Tiffin
Aug 12, 2021
Dukc
Aug 12, 2021
Tejas
Aug 12, 2021
Johan
August 10, 2021

Being a COBOL guy (for fun), I have opinions on this, but I'll try and only let them leak out a little bit lot, as this is meant as a question, not a judgement.

How long do you expect your D programs to last?

How long do you think the D system should support your source code?

D is 20+ now, but how long is its tail? Meaning, if you found D code from 19 years ago, would you expect it to compile today, with a current compiler? How far back in time should D source age? The length of the tail.

Is it better to cut off the growing tail for progress, or should progress allow for long tailed source code and binaries?

To be fair, a 1.0 to 2.0 bump is major enough to warrant lopping off a tail. (Or is it?)

Being new to D, that seems to put D2 at 12-ish years old. Does anyone have 12 year old code that would recompile without touching the sources? Would you expect it to? Or is it ok to write programs with fixed (with a randomness factor) life expectancy?

The idea to ask this question came up from reading the std.datetime article, and how it deprecated std.date. Would it be reasonable to freeze code rather than deprecate and remove? Leave the tail, even though it may be wrinkled and dry at the ends, rather than lop it off?

On one hand, a long tail means hauling luggage, an ever growing, possibly useless (to most) pile of baggage. On that hand, a long tail would mean that D only accumulates, ever growing. On the other, D becomes a smaller in toto codebase that slides through time, leaving it's past behind as it pursues perfection.

Leaking bias; I'm amazed that sophisticated Report Writer code from 1969 (pre structured programming) still compiles in a 2020+1 COBOL compiler. Has that code been superseded by events? Not really, dollars are still dollars, pennies are still pennies, page breaks are still page breaks and sums are still sums. The output format is archaic, but the code is still useful, and cups-pdf will gladly convert a plain old text file to PDF.

But I also realize that IBM charged customers a high premium to advertise and maintain that backward compatibility. Maybe only Computer Business needs those kinds of timelines and guarantees. Perhaps Computer Science can slide, allowing old code to become worthless without surgery after a reasonably short life span, as Science evolves faster in general. Lots of life forms leave behind old shells behind to grow and mature.

So it's a question. What is a reasonable life expectancy for the projects I start in D today?

Have good, make well.

August 10, 2021
On Tuesday, 10 August 2021 at 00:53:29 UTC, Brian Tiffin wrote:
> How far back in time should D source age?

Most my code compiles with compilers up to 5 years old. Some will go back as far as 12 years old, though that's a fairly significant effort hat I don't bother with on anything except maintaining code from that era.

> Does anyone have 12 year old code that would recompile without touching the sources?

I have some small modules that still will, but the vast majority of things do require an active effort to maintain compatibility from back then (especially if you want to support both new and old compilers).

The majority of these things are due to library changes. There was a period around 2011 where tons of little things changed, like tolower became toLower and std.date got removed, and stuff like that. Or of course in 2008ish when strings changed their type to immutable... None was too hard to update but it did force updates.


> Would it be reasonable to freeze code rather than deprecate and remove?

yeah that's been closer to the policy in recent years.

> So it's a question.  What is a reasonable life expectancy for the projects I start in D today?

It so depends on what you use. If you avoid outside libraries (at least copying them into your project), you can realistically keep it for many many years. But it does take some active effort.
August 10, 2021
On Tuesday, 10 August 2021 at 01:57:49 UTC, Adam D Ruppe wrote:
>
> The majority of these things are due to library changes. There was a period around 2011 where tons of little things changed, like tolower became toLower and std.date got removed, and stuff like that. Or of course in 2008ish when strings changed their type to immutable... None was too hard to update but it did force updates.
>

There was also tons of changes around 2015-2016, very often packages older than 2016 simply won't work, some language changes from that period makes it non trivial to upgrade such code.
No examples, sorry, but one thing I remember was module ctors and shared variables issues when upgrading old package to 2019 compiler.

August 10, 2021

On Tuesday, 10 August 2021 at 00:53:29 UTC, Brian Tiffin wrote:

>

So it's a question. What is a reasonable life expectancy for the projects I start in D today?

Have good, make well.

I have some code that builds with DMD 2.076.0, that's 1 Sep 2017.
You can probably go much earlier with some effort.
Ultimately I hope an event as breaking as D2 circa 2010 won't happen again, many people departed.

August 10, 2021

On Tuesday, 10 August 2021 at 00:53:29 UTC, Brian Tiffin wrote:

>

How long do you expect your D programs to last?

Normally the programs use the standard library and/or DUB libraries. In that usual case, it in my experience takes around an year or so for code to stop compiling. However, it's almost always easy to migrate - just find-replace a library function call, add an alias for it, or stuff like that.

If you copy-paste the library code instead, or don't use it, your code will usually keep compiling for multiple years. DMD is a good example - it may well compile with 20 minors older version of itself.

But all in all, in D one has to be prepared to use older compiler versions if updating old code is not possible or worth the effort. On the other hand, I think one should always be prepared to do so in any language. Even in standartised languages, it does happen that the code accidently uses non-standard features or the new compiler versions include regressions.

August 10, 2021

On Tuesday, 10 August 2021 at 00:53:29 UTC, Brian Tiffin wrote:

>

How long do you expect your D programs to last?

Forever.

>

How long do you think the D system should support your source code?

Forever.

>

D is 20+ now, but how long is its tail? Meaning, if you found D code from 19 years ago, would you expect it to compile today, with a current compiler?

No. But with a compiler from then.
-> your code should mention the version of D it is supposed to be compiled with.
If it's not too old, I would expect to be able to update the source code to compile with a current compiler without much effort.
Of course it gets more complicated with every library involved...

August 10, 2021

On Tuesday, 10 August 2021 at 12:19:26 UTC, Dukc wrote:

>

But all in all, in D one has to be prepared to use older compiler versions if updating old code is not possible or worth the effort.

Old D versions do not receive platform compatibility updates. E.g., it's not possible to build a program with D 2.060 on recent versions of macOS, and old versions of macOS don't run on new hardware, so you actually have to keep the old hardware around. (Or at least that's how I understand it - not a mac user.)

Old versions of D also do not compile on recent systems. I maintain Digger which attempts to solve this problem, though. (This doesn't help solve the problem above.)

August 11, 2021

On Tuesday, 10 August 2021 at 14:18:47 UTC, Dominikus Dittes Scherkl wrote:

>

-> your code should mention the version of D it is supposed to be compiled with.

This. We successfully use https://dub.pm/package-format-json.html#toolchain-requirements for this.

-- Bastiaan.

August 11, 2021

On Wednesday, 11 August 2021 at 10:05:19 UTC, Bastiaan Veelo wrote:

>

[snip]

This. We successfully use https://dub.pm/package-format-json.html#toolchain-requirements for this.

-- Bastiaan.

I don't recall seeing that there. Thanks for pointing it out.

August 11, 2021

On Tuesday, 10 August 2021 at 00:53:29 UTC, Brian Tiffin wrote:

>

So it's a question. What is a reasonable life expectancy for the projects I start in D today?

Very much depends on the type of project. How much do you depend on new features (likely to change), how much do you depend on library code, how much do you depend on ABI details, how much are you working around current language/compiler issues...?

At Weka, thusfar any new compiler means compilation failures. It is a demanding codebase.
Some reasons for failures: workarounds for compiler bugs, ABI dependencies, template attribute deduction deltas, dependence on druntime internals, new compiler bugs, change of language semantics (sometimes intended, but also often unintended), no way to disable/enable specific warnings/deprecations, ...
On top of that, performance may change too with compiler version, so even if the build succeeds that does not mean the program still functions within the required performance constraints.
Keeping the code compatible with multiple frontends is a large burden, currently avoided by specifying the compiler version in the codebase and using that exact compiler on build systems and developer's machines (i.e. each dev will have multiple compilers on his machine, automatically downloaded and used by build system). Updating the compiler to a new version is a lengthy process. Weka is currently at LDC 1.24 (with Weka modifications).

-Johan

« First   ‹ Prev
1 2