Hacker News new | ask | show | jobs
by badsectoracula 2167 days ago
> D being a mature language long enough.

I do not follow D closely, but i get the impression that the language breaks backwards compatibility every now and then - i remember some posts here or Reddit some months ago by someone complaining that Walter Bright introduced some changes to the language that broke existing code.

IMO a mature language is a language that you can depend on for your existing code to keep working in a timespan of decades - like C and C++ for example. A language that willingly breaks backwards compatibility is a toy, not something to be taken seriously for long term work.

3 comments

The Wikipedia page history section [0] talks about stability. The most relevant part is this:

> The release of Andrei Alexandrescu's book The D Programming Language on June 12, 2010, marked the stabilization of D2, which today is commonly referred to as just "D".

In other words, D is backwards compatible for 10 years now. At least, I don't know any breaks and the little code I have in D never broke.

The transition from D1 to D2 did break backwards compatibility in 2007. The change is comparable to the Python2 to Python3 transition but in a much smaller community. Outdated news from that time still pop up sometimes. Maybe you heard something related to that?

[0] https://en.wikipedia.org/wiki/D_(programming_language)#Histo...

So basically if i write some D code now it'll keep working (assuming no OS ABI changes) and compiling in 20 years from today? I'm ok with very minor changes due to compiler bugs or whatever.

I wonder what that complain was about then.

I have code that I wrote on D like in early 2010's, and keeps working with very minor changes.
Then I guess C and C++ are toys as well, given there are a couple of breaking changes.

K&R C, gets, Annex K, VLA, gone by now in C17.

gets, exception specifications, external templates, std::auto_ptr now gone, RVO semantics changed, and a couple of other minor semantic changes by C++20.

Nobody has removed support for gets nor VLA (of those that bothered to add them in the first place) or anything else they provided.

TBH i'm not sure about modern C++20 since that has been a shitshow anyway.

Apparently you have to update yourself with ISO C contents.

Hint, there are more C compilers out there than clang and GCC.

I know, i've tried a bunch of them and have several C compilers installed but AFAIK none has removed support for gets or VLA (or anything else they bothered to implement). When i wrote "none" i wasn't referring to the standard but to the actual compilers. I do not care what the standard says is deprecated or to be removed, what i care is what compilers actually do since that is what affects existing code.
Have VLAs really been removed from the C language? I can't find a source for this.
What happens some times is that changes in the compiler fixes issues that were not well defined in the specification, or were bugs in the implementation. Programs that used the feature wrongly or that were in fact buggy then break when compiled with the better specified feature. It's comparable to compiling a K&R conforming C program with C89 or C99 enforcing: it will reveal bugs that were none in K&R (type punning, uninitialized variable, prototype violations, etc.).