I think once your system is large enough, C++ is not your only option, many languages can be used.
I think once your system is large enough, C++ is not your only option, many languages can be used.
There are exceptions (no pun intended) to this, namely exceptions, RTTI, global construction/destruction, and the intricacies of new/delete. As the article points out (as will anyone who advocates the use of C++ in constrained environments), none of these are really necessary to use C++ effectively and can be safely stubbed out.
I guess the only common embedded systems I would think twice before using C++ nowadays is 8051 and the very low end AVR/PIC (which can have as little as 32 bytes of RAM).
i would agree only if there is sufficient discipline and experience on the team, management included. Spaghetti C++ can be a lot harder to untangle than spaghetti C, in my experience.
Many modern micro-controllers have at least this amount of RAM.
Regarding C vs C++, it has been a constant fight since those days.
So, which one should I write in? And this company hates exceptions while that company doesn't allow dynamic allocations so I've got different dialects even IF you can get everybody to agree on which dialect of C++ you should write in.
And, why should I learn C++14 when C++17/18/19 will be another different language?
No, I'd rather put in the effort to make Rust usable. The C++ ship has sailed.
While it is indeed a pain to look at source code and understand the differences, the C++ standard gets very few releases than say Python or Ruby, and I doubt anyone can list all the differences between language versions without searching for them.
> No, I'd rather put in the effort to make Rust usable. The C++ ship has sailed.
Me too, but when it comes to what customers allow me to use, it is C++.
Sony and BMW are just now migrating to C++11 (not C++14, C++17, ...), how many years do you think it will take for something else to reach similar scale?
Which is why I am supportive of all attempts to improve the overall quality of C++, even C (UNIX variants are not going away) for that matter.
Rust still needs to improve a few things, which are anyway part of the 2017 roadmap, before Sony, BMW, Apple, Microsoft, IBM and similar companies decide to go Rust instead of C++yz or Swift.
Also you are shouting a bit hyperbole. Each new standard does not erase the prior standard. C++17 does not remove the features from ++14. Each new version focuses on different things, and they have been really great additions.
Also there is no C++18 or 19.
I am not shouting hyperbole at all. Each new standard completely changes the way you are supposed to write new C++ code. The problem is that the legacy code was written the old way, with all the problems that entails.
So, you have to know everything about the new way AND you have to know all the pitfalls of the old ways for when you need to go debugging through the old code. Um, no thanks.
I've been following C++ since 1996-ish. I stopped following it after 2011. It's just not worth the pain.
As the author points out, C++ offers very significant and tangible benefits, and in the right hands/with the right discipline should be less error prone and result in more efficient code. In my opinion, C++'s greatest benefit for embedded programming is that it has a wealth of abstractions that have no runtime overhead.
The are several reasons that C is still king, but I suspect the main one is portability. Your company may need to be able to port its software to some obscure microcontroller where the only compiler available is a buggy C89 implementation. Or if it has C++ support, odds are that it is inefficient and out of date.
Because of this and other reasons, the labor pool of "deeply" embedded software engineers has a heavy bias towards C over C++. This compounds the problem, reducing the incentive for embedded engineers to learn modern C++.
Which according to Dan Saks talk at CppCon and interview at CppCast, there are plenty of them in the embedded space.
https://en.m.wikipedia.org/wiki/SPARK_(programming_language)
Ivory might git your requirements:
http://ivorylang.org/ivory-introduction.html
Tower is their other one:
https://github.com/GaloisInc/tower/blob/master/README.md
ATS is used here on an 8-bitter: