News for hackers. Stuff that matters.
Re:Relive: 50 years of C, the good, the bad and the ugly by kovac on Friday December 30, 2022 @09:41AM (#34185426)
Can C really completely go away as long as there's embedded programming? Are there any other alternatives for that domain?
Re:Relive: 50 years of C, the good, the bad and the ugly by Zagitta on Friday December 30, 2022 @10:14AM (#34185733)
Rust is rapidly picking up steam in the embedded sphere :-)

Unfortunately it's an industry with a lot of stubborn old people so I don't see any major changes happening until they've retired but I'm willing to bet that async is going to revolutionize embedded development. Being able to await interrupts and doing efficient cooperative scheduling while writing straight forward code is a massive QoL improvement which is what embassy is enabling: https://embassy.dev/

Re:Relive: 50 years of C, the good, the bad and the ugly by pjmlp on Friday December 30, 2022 @10:34AM (#34185923)
Yes, compilers for C++, BASIC, Pascal, Ada are around, mostly commercial and people pay to keep those companies in business, for powerfull microcontrollers where real time GC is an option, there are Oberon, .NET and Java as well.

There are surelly other factors that weight in using C, but not for lack of options (in many cases).

Re:Relive: 50 years of C, the good, the bad and the ugly by Tomte on Friday December 30, 2022 @10:00AM (#34185615)
There are embedded devices programmed in other languages, you know, and there have been for decades. In Ada, for example. Which is an even better fit to the domain than C (better ways to describe hardware idiosyncracies).
Re:Relive: 50 years of C, the good, the bad and the ugly by KnowOneYouNo on Friday December 30, 2022 @01:15PM (#34187939)
Ada is a much better and modern alternative for embedded, real-time and/or systems programming. Its mature, (although still evolving) and very scalable from very, very small to very, very large systems. It also supports interoperability with C and C++. It is a primary language in GCC. See https://ada-lang.io/ and https://learn.adacore.com/

Unfortunately Ada is held back by a genuine lack of awareness and some old misinformation baggage.

Re:Relive: 50 years of C, the good, the bad and the ugly by Hemospectrum on Friday December 30, 2022 @07:33PM (#34191892)
As strange as it might sound, the success of Rust seems to have reopened some doors for Ada. People in both communities are aware of this and already collaborating on various projects to mutual benefit.
Re:Relive: 50 years of C, the good, the bad and the ugly by timbit42 on Sunday January 01, 2023 @12:06PM (#34208134)
Rust and Ada are both seen as 'safe' languages that prevent many unsafe actions by programmers.
Re:Relive: 50 years of C, the good, the bad and the ugly by micronian2 on Wednesday January 04, 2023 @02:39PM (#34250313)
I haven't used Rust, but many of the comments and articles I have read about the benefits of the language and the strong desire for develop robust and/or safe software are virtually the same as what Ada supporters have been claiming for decades.

It's a good thing more people are realizing we really need to stop settling for C and C++, stop investing more money into tools that simply compensate for the weak foundation of those languages, and finally adopt safer alternatives.

Re:Relive: 50 years of C, the good, the bad and the ugly by micronian2 on Wednesday January 04, 2023 @02:25PM (#34250151)
This! I have mainly programmed in C in my career (note: I also have experience with C++ on multiple projects and to a lesser extent with C# and Java). In almost all the embedded projects I have been on, Ada would have been a far better choice because it would have helped avoid whole classes of common software bugs and thus less costly to maintain. This is especially true with bugs reports and vulnerabilities that would be discovered on systems that were already deployed.

People normally think that C is the best for low level embedded programing, but from my experience, it pales in comparison to the amount of low level control and type safety that Ada provides, even when you restrict yourself to a small subset of the language (note: Ada is often used on barebone systems and without an Ada runtime). Given the interoperability Ada has with C, it means you don't have to rewrite everything in order to incorporate it into existing code bases.