Ada for new project? [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this questionWe 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?
(A response from an actual Ada developer)
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.
Good luck with your project.
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.)
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
There are pragma restrictions you can use to restrict certain features of the language too. Might be alternative to using spark.
If you write avionics Software, you usually cannot use many libs. Usually, you have a lot of coding rules that must be followed. E.g., recrusive functions or dynamic Memory allocation are forbidden. Therefore, libraries cause a lot of trouble when it comes to certification (e.g., DO-178C).
I prefer Ada over C++ as it stops you from doing many stupid coding errors. In principle you can do the same things with Ada and C++. However, you must define many coding rules to comply with certification requirements. And you have to demonstrate compliance with those rules.
You have the same with Ada but it is less work than with C++.
This is a good question.
I have written Ada professionally for many years, as well as C and C++. I enjoy both equally.
With any language, Ada or C/C++ it can be spaghettified.
You're more likely to find a cheap compiler and support with C/C++. Just apply discipline in your coding practices.
精彩评论