原创 Why aren't developers interested in Ada?

2011-3-5 11:03 1692 9 9 分类: 消费电子

Despite its strengths, Ada just doesn't have a lot of embedded market share. 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. 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:


num_doses=0;
morphine=patient_pain/num_doses;
dispense_morphine(morphine);


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.


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!!"

 

 

文章评论0条评论)

登录后参与讨论
我要评论
0
9
关闭 站长推荐上一条 /2 下一条