Hacker News new | ask | show | jobs
by hsmyers 5500 days ago
OK, everyone here who codes in ADA, raise your hand. Atlas?
8 comments

I hadn't known much about Ada other than that it's very old (as programming languages go) and it has a kind of nonspecific bad reputation, but I looked it up on Wikipedia and it actually doesn't look like an unpleasant language at all from the article. I particularly like its built-in message-passing system for concurrency: http://en.wikipedia.org/wiki/Ada_(programming_language)#Conc...

On projects like this I would worry more about accumulated technical debt from decades of modification than the language they're written in. (I suppose the language can complicate the task of hiring programmers who are skilled with its idiosyncrasies, but that's hardly an insurmountable or crippling problem.)

From my defense software experience with Ada 83 and Ada 95, Ada's concurrency features made it much easier to work with than C. Tasks/processes were a top-level feature of the language, like classes in Java, and the "protected" keyword functioned somewhat like "synchronized" in Java (an implementation of the monitor pattern).

Our compiler package also came with an extensive concurrency API that offered a variety of threadsafe containers comparable (again) to java.concurrent - and this was software from the late 80s/early 90s!

What was bad about Ada was Ada 95. It strove to make Ada into an object-oriented language, but did a poor job of it with some very tortured syntax. edit what Masklinn said - "bolted on" is a perfect way to put it.

There are many nice ideas in Ada, but I have two big issues with it:

1. It's a very lawyery language, there are very few things the compiler will accept to infer, which makes Ada tedious to read and write.

2. The strange mix of underscores and uppercases that is the normal Ada writing style (I believe Ada identifiers are case-insensitive, code from the 80s tends to be VERY_UPPERCASE_HEAVY while the same code now Tends_To_Be_Strangely_Capitalized) makes my head hurt.

And since this is avionics, they're probably dealing with embedded code (which tends to be even less readable) as well...

And as totalc notes, the OO additions of Ada 95 (if you have access to them) feel very bolted on and unnatural.

I was taught Ada95 by John McCormick, who wrote several textbooks on Ada.

Though I can't claim any professional experience, lots of my college education was straight from DoD/Navy expats who wrote military software.

There are lots of firms in the midwest that write this kind of software. John Deere, Lockheed, etc.

I write real-time avionics software for my day job. It's done almost entierly in Ada95.....I don't work on the F-22's.
So then what's your take on coding in Ada compared to other languages?
I've played with it, it's a nice language. Don't see why people hate on it, it's not especially verbose, and the static types are actually helpful (like, you can cleanly loop over the extent of an enumerated type, for example) as well as more than usually protective (like, you can type define "inches" and "centimeters" as kinds of integer, and it won't let you mix them by accident).
F# has units of measure too.
It goes a bit deeper than that.

Most static typed languages - C, Java, Haskell, etc are memory representation centric in their primitive types. Ada is usage centric.

You see that two ways.

First, in most languages any item with underlying implementation X can represent any legal value of X, even if it makes no sense. If you want to represent a quantity whose maximum value is one million, putting it in anything shaped like a 32-bit int will let it contain the illegal value "one million and one". Contrast Ada which will let you cap its legal range.

Second, in most languages any item with underlying implementation X can contain anything else with the same implementation. Your typedef'd int can be put into anything else int-sized. Contrast Ada, which won't permit you to mix apples and oranges if they are defined as distinct types with int storage.

We had a project in our "Programming Languages" class that consisted of solving a problem in a number of different languages, including Ada, which proved to be the most difficult simply because of the lack of decent resources or guides online. I'm not saying I couldn't get accustomed to it, but with just about any other language you can go online and find a few guides that'll get you acquainted with the paradigm of a language, and I couldn't find anything like that for Ada. Programming in Prolog was easier because at least then I could go to our library and dust off a book from the late '80s about how to write programs in Prolog.
when I went to Uni, the main language we used was Turbo Pascal (followed by loads of assembly and a small amount of C). The year behind us had Turbo Pascal replaced by Ada as that was going to be the Next Big Thing.

The Ada class started in '94 if a timeframe helps

Does VHDL count?
Me!

Well not really, but Ada is alive and well in the guise of PL/SQL. You can see it if you look closely, type "desc sys.diana" into any Oracle DB, DIANA is "descriptive intermediate annotated notation for Ada".