|For novel ideas about building embedded systems (both hardware and firmware), join the 25,000+ engineers who subscribe to The Embedded Muse, a free biweekly newsletter. The Muse has no hype, no vendor PR. It takes just a few seconds (just enter your email, which is shared with absolutely no one) to subscribe.|
By Jack Ganssle
Ada's Slide into Oblivion
Why don't you program in Ada?
A language survey (http://www.embedded.com/pollArchive/?surveyno=2228) we ran on this site generated almost 1400 replies. 85% of us create embedded products in C or C++. Java accounts for another 5%, Forth about 3%. Ada scored a pitiful 2%, coming in even behind "other".
I like C, mostly because it's rather like assembly language. Both give me total control of the machine. Assembly is particularly fun due to its cryptic syntax and the ease - or even the necessity - of creating tricky and clever constructs. But these are lousy reasons to select a language. Worse, they suggest that both C and assembly are not appropriate for building big, complex systems that must be reliable.
I think Ada is the only language designed to significantly reduce and maybe even eliminate dumb programming errors. What a novel concept! Ada's rigorous syntax traps most silly mistakes during compilation. C, by comparison, lets practically anything through, so we spend far too much time debugging. I've observed that most embedded developers spend about half their programming time debugging. This is ridiculous, and is clearly the first place to focus when looking for ways to speed products out the door.
A strict language with fascist syntax rules can cut debug times dramatically. The old rule of thumb with Ada is "if you can make the damn thing compile, it'll run correctly."
Most of us have been driven mad chasing elusive bugs only to find the compiler did something quirky, or even totally wrong. That's unheard of in the Ada world, since the compilers are essentially perfect. Each must undergo an exhaustive validation process before being allowed to use the Ada moniker by the trademark holder. By comparison, a C compiler might not even be Ansi-compliant. One I use here doesn't even support linking.
Yet for some reason it has almost zero market share in the embedded space. Why?
Could it be that we developers are intellectually lazy, and want the immediate gratification of compile and test? Most of us hate satisfying the demands of a tool. That's probably one reason so few folks use Lint, a very powerful aid to creating syntactically-correct C. But Lint is, as it must be, very picky and thus frustrating.
Another poll (http://www.embedded.com/pollArchive/?surveyno=2241) showed that 70% of us chose our development language based on business issues rather than technical suitability. One very valid business reason for Ada's failure is the lack of tools. The lively compiler/debugger market so typical of C and C++ never came about for Ada.
Or were we afraid of the memory needs of such a big language? It was never meant for 8051 or other resource-limited applications. Yet the same can be said of C++ which is healthy and has a growing user base.
The Defense Department was the language's primary advocate, swearing that contractors would have to adopt it for all major programs. DOD caved, first allowing a few exceptions, then many, till now Ada is more an interesting historical aside than part of every developer's zeitgeist. Is the government at fault for not being strong despite the vigorous opposition that always surfaces when anything new comes about?
What do you think?