News for hackers. Stuff that matters.
Re:C will never stop you from making mistakes by mytailorisrich on Monday August 10, 2020 @09:31AM (#24109001)
IMHO that's how it should be for a programming language.

If a programming language evolves to the point that previous programs written in that language no longer compile then it's no longer the same language.

So let's keep C as C and, as you point out, new ideas and concepts that would break things can be implemented in new languages.

C does evolve but it's also taken the pragmatic approach not to break the huge existing code base it has. In many cases these programs have been running for decades, they work.

Re:C will never stop you from making mistakes by Tehnix on Monday August 10, 2020 @10:01AM (#24109311)
>If a programming language evolves to the point that previous programs written in that language no longer compile then it's no longer the same language.

I don't really buy that you cannot ever introduce breaking changes. That's a recipe for disaster and IMHO short-sighted.

>In many cases these programs have been running for decades, they work.

And in many other cases, they have been full of security holes that take an incredible amount of work to discover.

Something like Rust's editions seems to solve this problem very well, and is indeed what they are intended for.

You can still compile old code, you just won't have full access to new features if you choose to do so. This provides a way to keep legacy systems alive while providing an upgrade path for them at the same time.

Re:C will never stop you from making mistakes by guenthert on Monday August 10, 2020 @07:33PM (#24115470)
Well, C hasn't been designed to be evolving and was also quite under-specified through most of its history; a hacker's delight, a tool to get things done, quick, but not a receipt for long-term maintainability. Given that, I'd think C did rather well.
Re:C will never stop you from making mistakes by 0xffff2 on Monday August 10, 2020 @10:45AM (#24109790)
>>If a programming language evolves to the point that previous programs written in that language no longer compile then it's no longer the same language.

>I don't really buy that you cannot ever introduce breaking changes. That's a recipe for disaster and IMHO short-sighted.

It's also empirically true in my experience. See Python2/Python3, Perl/Raku, C++98/C++11/C++20. In the latter case, I'm not even sure there are any significant breaking changes, but the feature sets are so different that I find that I pretty much always have to specify which version of C++ I'm talking about.

Re:C will never stop you from making mistakes by noelwelsh on Monday August 10, 2020 @10:27AM (#24109596)
Scala has a tool called scalafix (https://scalacenter.github.io/scalafix/) which allows people to write migration scripts (and other things) that work based on analysis of existing code. This has been used for library upgrades, and will play a big part in the Scala 2 -> Scala 3 migration coming at the end of the year. So it's not impossible to evolve a language and keep code bases current with minimal work for the end user.

For such a tool to be effective it must be possible to statically analyse code to a reasonable degree, and C is certainly not a language that enables easy static analysis.

Re:C will never stop you from making mistakes by Gibbon1 on Monday August 10, 2020 @08:01PM (#24115706)
On the other hand it's absolutely pathetic that C still doesn't have actual arrays. To head off comments, no syntactic sugar on top of pointers doesn't count at all. So don't even try to make that argument.