We are currently developing a noncritical moving map type navcomm solution for our Atom based avionics device. The prototype has been done in Python/Qt, now I need to decide on a language to use for the "real" app. Ada or C/C++. I've been a C++ developer for 12 years and loathe the language. Ada seems promising, but I'm a little worried about it's supporting infrastructure, available libraries, developer availability and so on. Has anybody here been through this before? What are your conclusions?

not sure if you'll ever see this comment, but which language did you decide to go with in the end and how'd it turn out?
–
Erik AllikNov 13 '13 at 14:05

2

We ported some core parts of the application to C++ and kept the rest in Python. The company went bankrupt before going any further, unfortunately, despite a having great working cockpit device. We never got certified but managed to get it into a couple of cockpits by means of a minor change. That said, the language used was our smallest problem. Our biggest was the onslaught of Ipad and Android devices.
–
zeroc8Jun 25 '14 at 6:20

6 Answers
6

Contrary to prediction of its imminent demise, Ada is still going along just fine. The current version of the language is Ada 2005, and the updates for Ada 2012 are in the process of being finalized.

Ada continues to undergo modernization and incorporate new software engineering features and practices as they're developed by industry. (And the reverse is true as well--built-in concurrency has been a core Ada feature since 1983, and which is only now making its way into "modern" programming languages. :-)

Not every new feature and practice is going to be adopted by Ada, Ada's not going to morph into a functional language, for instance. But those features that enhance software productivity, reliability, and safety are incorporated in a way that is consistent with Ada's underlying architecture and intent.

It's certainly true that Ada is not a widely used programming language, but it does have a committed developer community, who are almost always more than willing to help out with questions, concerns, and advice for those developing projects and learning the language. Resources include here at StackOverflow (check the Ada tag), comp.lang.ada, even Reddit.

As for Ada developer availability, it's sort of a "Catch-22" situation. Because it's not widely used, there are fewer developers. Because there are fewer developers, companies shy away from using it in projects, and because it doesn't get used for projects, developers don't go looking for jobs in it.

I can attest, though, that there are many knowledgeable current and former Ada programmers who love working with the language, and would be particularly interested in doing so for an application of the type you're describing--if they knew about it. If you made the commitment to go with Ada, and then unapologetically advertised for Ada developers--on Monster, wherever else you advertise, tastefully on comp.lang.ada or Reddit--I think the availability of Ada developers would surprise you and many other skeptics.

One nit: While Ada is indeed not a functional language, I generally like to code it in an at least semi-functional style. Ada's way of dealing with strings and arrays strongly encourages that approach.
–
T.E.D.Oct 18 '10 at 12:43

I'll throw in my thoughts. For quick context: I'm currently working in Ada at one of those big companies (not Lockheed, but close enough). I am a C programmer at the core. (used C++,C#,and Java as well)

Ada is fine as a language. It has some nice things in it that you can't get in C/C++. For real-time critical systems, it is really nice. It takes a little getting used to, but it is easy enough to learn.

The downside is the language perception really. Most of the engineers I know that like and choose Ada are older (45+). Of those there are 2 types of programmers: the people who are actually really good at Ada and can do it right, and those that "know" Ada, but program it in a way/style representative of the 70s with older languages. Those good Ada programmers are highly valued here. For a small company to snatch them, I would think you would need to drop some major cash on them. They have 4-5 weeks vacation, 6 figure salaries (even in cheaper places to live) and all sorts of benefits. I hope this doesn't seem ageist, but it is just the way it is and something to think about as a small company. If you are in a major tech area like Dallas/Fort Worth, it might be ok. As you mentioned in your comments, most of the younger programmers aren't excited to learn Ada. It may pay well and be fine as a language, but it isn't nearly as marketable or exciting.

If I were starting a real-time embedded system project, I would just stick to C ( or C++ if you need the OO). For embedded I prefer C actually over C++ because in my experience, engineers try to force the embedded system into OO and use features because they are there, but your mileage may vary. With C or C++:
1. HUGE pool of programmers to choose from.
2. Every tool known to man has been made to work with it (many are free).
3. The resources online are endless.

It will allow you to just get to work. If you have access to some of the great debuggers using JTAG like Green Hills and VxWorks have, it really pushes the development speed along.

Generally, there are some situations where I'd prefer C++. If your program has no concurrency in it whatsoever, and there are some C++ (not C but C++) libraries out there that would be really helpful to use, then C++ is probably the way to go.

However, if you will have concurrency as part of your system design, Ada is a huge win, as it supports it natively. One job I was on actually wrote an entirely portable real-time scheduler. We ported the entire simulation (> 100KSLOC) from vxWorks to a completely different vendor's Windows compiler in about 2 hours (all spent dealing with their different source code library systems).

Any library that has C linkage is perfectly available in Ada, although sometimes you might find yourself having to write bindings. That is a wee bit more work, but you will often find that others with the same libraries to deal with have done the work for you already. For instance I believe there are bindings to all of Win32 available. Still, making new ones is easy enough that I often find myself doing it just to provide an interface I like better.

Ada also has a couple of features that IMHO make it the premier language available for low-level system's programming. For example, the language allows you to specify exactly where and how big each field in a record is placed. This is vital in dealing with hardware or data communicated with other platforms. C++ currently only allows you to specify how big each field is. I'm dealing with that right now, and find it very frustrating.

The other killer feature for system's programming is that by default all arrays are bounds checked. You can turn it off for efficiency if you want, but the default is safety. IMHO this is what the default should be. In C++ if you want the safety, you have to go out of your way to code it up yourself, or use a safer class like std::vector (and only use the .at() method. How many times have you ever seen anyone do that? Never? Me either.)

Are there any tools for automating those boilerplate imports from C libs?
–
user478389Oct 18 '10 at 17:53

It looks like Gnat comes with a biding generator gcc.gnu.org/onlinedocs/gnat_ugn_unw/… . If you are using that compiler (purchased from ACT), that's probably your solution. If not, I'd avoid it for non-GPL work as their free versions probably make the bidings GPL. You could check out the other generators at adapower.com/… . As I said, I generally prefer to make my own though. If you do it mechanically, you end up with a routine with a C interface (yuck!)
–
T.E.D.Oct 18 '10 at 19:57

well part of the reason Ada isn't a blockbuster language (although from what I read, I'm actually interested in learning more) is because most programmers want quick and dirty. Just look at Microsoft Windows. They wrote the first versions in C (and a bit of x86 assembler). It took them 2 years to finish the whole monstrosity, and even now it's fragile. The ease in which viruses and worms can infiltrate the system is so bad that they're trying to steer away from the Win32 API in Windows 8. I'm sure that if the OS was written in Ada instead, it would be a lot more robust and a bunch more secure than it is now

While a robust language in its time, Ada hasn't really kept up with modern software development practices. Its "object oriented" features are a bit awkward and harder to use than newer languages. There are libraries, but it's not exactly a thriving third party ecosystem. Developers are harder to find, but any good developer will be able to pick up Ada in a short time. You may find a slightly higher proportion of developers familiar with Ada in the aviation industry.

You may consider using Java, as there seems to be a migration from Ada to Java in various parts of the aviation industry. You didn't mention Java though, so perhaps you discounted it already for different reasons.

Java wasn't on my radar, to be honest, as I don't see many advantages over C++ here.
–
user478389Oct 17 '10 at 9:26

2

One great advantage of Java over C++ is memory safety. There are no dangling pointers or forgotten deallocations in Java.
–
Greg HewgillOct 17 '10 at 10:13

1

True, but there's still the problem with unfreed resources.
–
user478389Oct 17 '10 at 15:20

3

Another thing is that determinism is a big issue in aviation. If we ever have a need to certify parts of our software, it will be easier with Ada or C(++). DO178C will consider OO technologies, but I'm not quite sure how that will apply to jitted languages.
–
user478389Oct 17 '10 at 15:28

6

Avoiding the tempation to vote this down just because I disagree. Generally folks who find Ada's way of doing OO "awkward" are those who learned to do it another way. It is actually more powerful, as you can dispatch on more than one object at once. However, as a sop to folks who feel as you do, the latest version of the language provides the old object.method() notation you crave. You need feel awkward using Ada no more.
–
T.E.D.Oct 18 '10 at 12:39