5 ms·
Can C really completely go away as long as there's embedded programming? Are there any other alternatives for that domain?
by kovac 4y ago
Can C really completely go away as long as there's embedded programming? Are there any other alternatives for that domain?
- Tomte 4y agoThere 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).
- Zagitta 4y agoRust 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/ https://embassy.dev/
- pjmlp 4y agoYes, 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).
- KnowOneYouNo 4y agoAda 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/ https://ada-lang.io/ and https://learn.adacore.com/ https://learn.adacore.com/ Unfortunately Ada is held back by a genuine lack of awareness and some old misinformation baggage.
- Hemospectrum 4y agoAs 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.
- timbit42 4y agoRust and Ada are both seen as 'safe' languages that prevent many unsafe actions by programmers.
- micronian2 4y agoI 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.
- micronian2 4y agoThis! 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.