mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

383K
active users

Kornel

It's surreal how slowly time moves in the world of C compilers.

Today there are still active projects that are hesitant to move past C89, and C99 is still the "new" standard.

The C99 standard has been released before the first public Mac OS X and Windows XP. It's older Itanium and the x86-64 instruction set. It predates iPod, Game Cube, first ever Xbox, and Nokia 3310.

Entire platforms lived and died in the meantime, while C programmers still can't be sure if they can rely on the new C99.

@kornel and yet msvc still doesn't fully support c99

@kornel Our technical debt is measured in centuries.

@federicomena @NanoRaptor @kornel I feel this so hard, working on a >20-year “legacy” code base

@federicomena @kornel@mastodon.social Technical payday loan.

@federicomena @kornel My actively utilized COBOL code requests you kindly and temporarily hoist its hoppy beverage, kind sir!

@kornel happily we have autotools to set defines to show which features we can use :D :D :D

@kornel maybe the fear of moving to 3 digits, as they typed their version as an int(2) everywhere? 🙃

@kornel It wasn't that long ago that the X11 source code still had optional support for C89 function prototypes.

The headers used preprocessor magic so they could remove the argument definitions from function prototypes, and all the C source files used K&R function definitions.

It comes from a time when upgrading the compiler wasn't really a thing you did. You'd use the one your UNIX vendor provided you, and be happy with it.

@dascandy @kornel It looks like even Zlib has dropped K&R support in the 1.3 release from August last year: zlib.net/ChangeLog.txt

So if you are as conservative as Zlib, I guess you can adopt C17 in 2051.

@jamesh "It wasn't that long ago" put in a different light, then, namely 20 years ago.

@jamesh @kornel I argue "you use the compiler your vendor/distro provides you" is *still* how it works for 99% of customers

@malwareminigun @kornel There was a period of time when Sun included a K&R C compiler with the OS and sold an ANSI C compiler as an optional extra. At that time, if you were distributing software as source, using ANSI C would mean only people who paid extra could use your code.

I don't think anyone sees "new language version support" as something they can charge extra for now, which is good.

@kornel i switched ircII to C89 minimum in 2004, and C99 minimum in 2014, and this is not a new, fast moving, rapidly evolving project.

@kornel I blame Microsoft for that. The last time I checked (which isn't even that long ago. 201x?) their C compiler still didn't have full C99 standard compliance.

@oblomov @kornel
Nowadays they support C11 and C17 (the "required" parts of the standards, not the optional ones): devblogs.microsoft.com/cppblog

But as they apparently don't want to implement VLAs, they will never support C99 (they became optional in C11).

Anyway, Microsoft *definitely* is to blame for this, because only with VS2015 they started to aim towards C99 conformance at least in their standardlib, e.g. with a standards-conforming snprintf()

C++ Team Blog · C11 and C17 Standard Support Arriving in MSVC - C++ Team BlogPlease see our Visual Studio 2019 version 16.8 Preview 3 release notes for more of our latest features. Update: Windows 10 SDK version 2104 has been released, which includes the changes needed for C11 and C17 as well as the conformant preprocessor.

@kornel any ideas as to how prevalent this issue is in the C++ world side of things?

Can’t speak to C but the first and last time I learned and touched/wrote anything C++ it had to’ve been version 98, MAYBE C++03 but that would’ve been brand new at the time.

I’m amazed by what I see folks do and write now with it. But how often do big existing projects and products really upgrade? I hope it’s plenty but I have a feeling it’s the opposite.

@colinstu @kornel
In my experience, C++ users are much more eager to target new standards, sometimes up to the point where it gets annoying that code requires C++ standards that are so new that the default compiler in many commonly used Linux distros doesn't support them yet.

@kornel In fairness, this is just as much to do with vendors being unwilling to *implement* C99 as with programmers' reluctance to change it. See en.cppreference.com/w/c/compil

In particular, VLAs turned out to be something of a misfeature and were made optional in C11.

There are a lot of C implementations in the world, and a lot of C programmers care about working with some weird ones, and that means C89 a lot of the time :/

en.cppreference.comCompiler support for C99 - cppreference.com

@malwareminigun @kornel don't forget that niche or dead platforms are like pokemon, gotta catch em all 😀

@kornel
If that should only underline C's advantage then I agree.
I really dislike the evolution of modern languages, lots of new features appearing every year, only adding complexity and making #opensource modifications difficult. TypeScript is a good example :(

@cdamian @kornel It's quite like COBOL nowadays isn't it. If it works, it works, don't touch it.

@skolima
It's certainly better to having to update your whole build system and fix compatibility problems every few months with modern languages.

(Insert old man shouting at cloud gif)
@kornel

@cdamian @kornel I've got my happy place (ecosystem where members know the value of backwards compatibility, but not to the point of being zombie-like 😉). I can't stand e.g. JS and a few other hip languages where half a year is enough to become so out of date as to be effectively stranded.

@cdamian @skolima There's a difference between stability and stagnation. The downside for C is that it's impossible to fix anything in the language, because it will take 20+ years to become the baseline. I suspect C++ mis-evolution has scared C users into *don't change anything ever!*.
Both C and C++ are outliers. It's possible to be stable without stagnation: Java and C# evolved without jumping the shark. PHP cleaned up a ton of language warts. Go can ship quickly without breaking things.

@kornel as far as I know Firefox uses C++17 currently (still quite old)

@kornel I mean, let's be real here: this kind of thing is entirely Sr. Engineers in leadership positions who are scared of learning new things.