Why aren't developers interested in Ada?Poll after poll shows that even after a quarter-century Ada has failed to garner a significant market share in the embedded space. Yet the data is stark: programs written in Ada have fewer bugs and are delivered faster than those written in C.
But wait, there's more!
Ada compilers work (see my soon to be published article on this site which reports that many C tools miscompile code that uses the "volatile" keyword). Ada compilers are checked against the exhaustive Ada Conformity Assessment Test Suite (ACATS).
But wait, there's more!
The most popular Ada compiler, GNAT, is free and is available under the GPL.
Ada was designed from the ground up for high reliability embedded applications. Neither C nor C++ can claim that distinction. The Ravenscar Profile even more finely targets real time embedded systems. Tasking is a built-in feature, not a bolt-on requiring expensive dalliances with RTOS vendors.
You'd think "faster, better and free tools" would be a pretty compelling argument, but it has failed to persuade most of us. Why?
It's probably not due to any inefficiencies. Robert Dewar, president of AdaCore, tells me that even with all of the runtime checks enabled expect no more than a 20% performance hit compared to C, though he said 10% is more likely.
Maybe I should define "runtime checks," as that concept is alien to the C community. Ada looks for error conditions like divide by zero. You can even define legal ranges for integers. But in C we can write:
We can't blame a lack of compilers. AdaCore has ported GNAT to most mainstream 16 and 32 bit CPUs.
In my experience new Ada developers typically hate the language. It makes one work very hard to get a compileable source file. The old saying is "if you can make the damn thing compile at all, it will work." But after about three Ada projects most programmers learn to love the language. Sure, they put more effort into getting the code right (which is surely a Good Thing), but they save mounds of time in debug.
What's your take on Ada? Leave your comments here at the end of this column and/or go to the Embedded.com Home Page and participate in the poll on this question.
As correspondent Rich Ries wrote to me: "Maybe Ada's lack of success is like a healthy life-style -- something we all know we should have, but few actually employ it!!
Jack G. Ganssle is a lecturer and consultant on embedded development issues. He conducts seminars on embedded systems and helps companies with their embedded challenges. Contact him at email@example.com. His website is www.ganssle.com.