Hacker News new | past | comments | ask | show | jobs | submit login
Ada 2012: A New Language for Safe and Secure Software (2012) (cotsjournalonline.com)
77 points by shepardrtc on May 20, 2015 | hide | past | favorite | 42 comments



These articles give the worst impression of Ada possible. It's not the it's a specialized language for the military, but a language created to cleanup the DoD's software nightmare of the 70s, which is not unlike the software nightmares of today. It just happens that they had a pretty good grasp, even at that time, of what helps make good software easier to write, large software projects easier to manage and maintain, and strong ideas about how much a language should intervene if the programmer is doing things that look pretty dumb.

Ada has a neat OO system (not like the Javas or C++s), built-in state-of-the-art tasking (since 1983!), ranged types (one of the things I can hardly bare to live without), but also simple things like switches that aren't useless and just a general appreciation for what a discrete type can allow you to do. It has generics, too, though I know they've been proven irrelevant by newer languages. Have you seen that new Java 8 date time stuff? It's playing catch up to Ada. Ada's numerics are, hands down, the best facilities of any mainstream language.

Most importantly, it's probably already available for your Linux distribution because it's a part of the GNU Compiler Collection, which means that it's on the commercial OS you've settled for, as well.

An out of print book that I always recommend to those who are interested in playing with Ada is John English's "The Craft of Object-Oriented Programming". Enjoy.

http://www.adaic.org/resources/add_content/docs/craft/html/c...


I discovered Ada 2012 last year, and ended up doing a chunky writeup on it: http://cowlark.com/2014-04-27-ada/index.html

It's a seriously nice language --- it feels like a mature, well-thought-out C++ without a lot of the craziness and ancient edge cases. There are moments of sheer brilliance: the pointer scoping semantics mean that it's actually _syntactically invalid_ to leak pointers from an inner stack frame to an outer one. Its tasking and concurrency support is amazingly good. Having proper nested functions are amazing. The type system, while no Haskell, is easily good enough to say things like 'bounded array of tagged unions with length not known at compile time', with both compile and run-time error detection. And all this produces code that performs on a par with a modern C++ compiler!

Here's a multithreaded Mandelbrot renderer what I wrote: http://ideone.com/a1ky4l Note that each thread is a scoped object nested inside a function, communicating with each other via strongly typed and named messages --- startup and shutdown synchronisation happens automatically...

That's not to say there aren't warts; the OO system is pretty painful, with some annoying hidden requirements (e.g. you have to define a class' methods adjacent to the class structure itself, otherwise the compiler gets confused; if this is a requirement there should be explicit syntax for it). Having case insensitive identifiers is a complete failure. Exceptions are just plain clunky. There are a number of syntactic weirdnesses where the language got expanded beyond the original syntax' ability to cope. But the big omission is that there's no garbage collector, even though the language was obviously designed to have one. It would be so, so much nicer to write real code in if it had one.

Ada really deserves to be better known than it is.


There is at least one error in your "About Ada" section. The language was not designed by the Department of Defense, though it did meet specifications laid out by DoD called the Steelman. The language was designed by Jean Ichbiah and his team at CII Honeywell-Bull for a competition held by the High-Order Language Working Group, a group within the DoD. Four languages were submitted: Red, Yellow, Blue and Green, of which Green won and became Ada.

http://www.adahome.com/History/Steelman/steeltab.htm http://www.adahome.com/History/Steelman/intro.htm


I did the first couple years of my undergrad (starting 1990) in Ada. I liked the generics, although the lack of inheritance was peculiar for an OO language. As a Pascal programmer in high school, Ada was pleasant and familiar, but I quickly lost interest when I discovered Eiffel. Eiffel felt like what Ada should have been from the beginning.

I've not written a single line of either post-graduation.


Sadly both suffered from enterprise prices by the compiler vendors.

Although Ada seems to be quite well in high integrity systems. At least that is my perception from the, now regular presence, at FOSDEM and European safety conferences.


Ada had OO from Ada 95, though it doesn't look anything like the OO in most mainstream languages of today. In Ada 95, tagged types were introduced which were based on Ada's powerful record types and Ada 2005 introduced interfaces in a style similar to Java. Java and Ada have both taken plenty from each other over the years.

Edited because I was misleading about the introduction of OO.


    ...although the lack of inheritance was peculiar for an OO language
I almost see that as a feature. ;)


I have only tried Ada for a few toy programs, but given the reputation it has with some people, I was pleasantly surprised.

Ranged types are awesome. Like I said, I did not use Ada a lot, but I have on a few occasions when programming in other languages missed them.

Also, the diagnostics the GNU Ada compiler gave me were a lot more helpful than anything a C++ or C compiler ever gave me.


During a presentation, I tried to show a ranged type implementation in Java. To put it mildly: it's a mess.


"It's not the it's a specialized language for the military, but a language created to cleanup the DoD's software nightmare of the 70s, which is not unlike the software nightmares of today."

The nightmares aren't like each other, they are the same nightmare, just with the spooge scraped into slightly different piles.

Further, a language won't clean it up; that's going to take something seriously different. In fact, I suspect the spooge is irreducable past a certain point. I believe it is the nature of the problems.

That being said, Ada is a significant improvement over many others, in many cases for the reasons you describe.

"though I know they've been proven irrelevant by newer languages"

Uh, what?


> "though I know they've been proven irrelevant by newer languages"

> Uh, what?

Sarcasm, presumably; cf. Golang.


T'was programming language satire at it's finest, in my opinion. :)


A non-free resource that I found very helpful in learning Ada was "Ada for Software Engineers" (http://www.springer.com/us/book/9781848823136). Although it covered Ada 2005, not Ada 2012, it otherwise has excellent coverage of the Ada feature set, with a focus on programming-in-the-large.


> It has generics, too, though I know they've been proven irrelevant by newer languages.

Is it wrong to read this sentence as snarky?


> Is it wrong to read this sentence as snarky?

Honest question, honest answer: yes. Dry humor maybe.

The reason why my snark detector passes this one is because there is no reason for the author to be snarky here.


I had to do one assignment in Ada during my undergrad. It felt like a gift from an alternate dimension.


I was an Ada programmer for about 4 years in the aerospace industry.

I remember my last Ada project. It was run as a traditional 'waterfall' project (In the early 2010s). I sat in my hole (cubicle, in the very center of a massive cube farm) coding away on a simulation model for a satellite's attitude control system, while the other devs worked on their own modules in silence and isolation. Integration and testing was pushed all the way to the end of the project.

I was a scumbag contractor, hence I was not allowed to see the complete code base like the regular employees were, so I couldn't, say, do a complete build to verify my stuff worked (because some of the libraries I needed to build my module I wasn't allowed access to). So I was armed with the Ada compiler as one of my only tools (I just had to ignore the link errors. Though, I was able to code up a few tests for some of the algorithms I was able to isolate, even though unit testing was neither expected nor encouraged, as it did nothing to increase my SLOC numbers -- i.e., "wasting time").

I worked slowly and deliberately (getting constant flak for my SLOC numbers not going up fast enough -- and apparently if you ever reduce your SLOC, you've made negative progress), and at the end when I passed my code off to the 'build master' to my amazement my module built and largely just worked. I have to give credit to the language -- it caught a ton of stuff at compile time.

Suddenly I was no longer a slacker (Gee, thanks). At the end of that project I left and never touched Ada again. I now (probably unfairly) associate Ada with old-school waterfall-driven software development and dank, dark offices with flickering, soul-sucking fluorescent lights.



Been a while since I read that :)

I do remember entering a negative number one week on the manager's "status spreadsheet (an excel spreadsheet on a network share that he asked everyone to edit)" next to my name. Of course he came by asking for an explanation, and if memory serves had me enter the number of lines deleted as a positive number, so that the 'metrics' he reported up the chain didn't look bad.


American programmers like to think they are engineers. German ones cannot because "engineer" is a legally protected title here and programming is not recognized as an engineering discipline.

I think that is justified by the way. Programming is a fad / fashion driven industry more than anything.

This is relevant here because whenever I look at Ada source code I hear synth pop. It is so 1980s. Sorry, maybe if Google or some other hip company took Ada, and simply changed the superficial appearance (i.e. syntax, identifier names) to look more 2010ish, gave it a cool name, and marketed it as the hot new thing it might go somewhere.

Sad fact is, whatever merits Ada has or does not have is completely irrelevant until that happens.


It used to be that only mechanical engineering was engineering. Now we have civil, chemical, electrical, et cetera. What is happening to software engineering is quite similar to what happened to other branches of engineering. The main difference is that the cost of producing software is usually dominated by design and labor costs (but not always). Before we had a grand tradition of aerospace engineering there were a couple bicycle manufacturers who strapped wings to their contraptions and tested them in a wind tunnel. The dawn of aerospace was all about fashion the same way you describe software engineering today: rock stars cavorting about the globe designing airplanes out of wood, cloth, and instinct, all to adoring crowds.

But the reason it seems like software is all about fashion is because you are browsing Hacker News. Hacker News is a fashion website for computer hackers, not unlike Wired but without its own articles. If you go look at actual software companies you will find a lot more reliance on well-researched tools and techniques. If you restrict yourself to places where other costs outweigh design costs, you'll see that it's much more familiar. Look at the software engineering effort for the STS, for example. Incredibly low defect rate.


The last time I looked (which was about a decade ago) the teaching of software engineering at the masters level seemed to be mostly concerned with process management, without any real equivalent of engineering's foundation in the physical sciences. In particular, the coverage of software design was mostly reduced to rules-of-thumb, some quality metrics of dubious relevance, and especially to documenting the result.


... and especially to documenting the result.

Well, that's enough for ISO 9001, so that should be enough for engineering, right?


It is called Rust.

Besides, Ada is actually being used a lot in high integrity systems, just not on the Facebook clone of the month.


Sounds like you needs someone like Rex to give Ada an image upgrade: https://www.youtube.com/watch?v=rRbY3TMUcgQ ; it can be like Outlaw Techno Psychobitch aka Erlang.

Seriously though, I agree with you on the first part, we throw the title engineer around a lot more than we should on this side of the pond.


> I think that is justified by the way. Programming is a fad / fashion driven industry more than anything.

I do not disagree with the latter statement, but for the most part I consider myself a software engineer. I have a degree in CS, and my approach to making components for our systems is very much engineer like. I design, develop, test, evaluate, modify, install, inspect and maintain a system where I have applied science and theory to make to solution work. I have not have the pleasure to work with hardcore mathmaticians yet, but I hope I will some day.

I agree that developers that never touch the backbone and algorithms probably aren't doing engineering, at least not in the theory and science way, but saying that no developer is an engineer is wrong.


Probably explains why Germany is such a powerhouse in software development NOT.

I do wonder about the effect of all the bright kids who would do CS/Computing in the USA/Uk instead want to work for Audi.

Rigid hierarchies do have down sides until recently get put on the vocational track in the German school system that was it you where on it for life and it was almost impossible to go from Aprentice-> Technician to Engineer.


I think the title is less of a problem. It's more of a mental problem what software engineering (or developing or whatever) is about. In Germany there seems to a dominant opinion that sw development is easy and can be done by everyone. And therefore it can easily be outsourced. You will never get a big reputation (and a big salary) as a sw developer in most german companies - because thoughts are that working on requirements and coordinating projects are the more important things. Quite sad this situation. Especially when you consider the horrible quality of the SW developed in such (outsourcing) models.

I'm sure if you really want to sw development you would probably be better of working in USA/Uk than at Audi. Working on a direct competitor in germany, and I'm knowing the situation of the industry in the meantime quite well.


I Used Audi as they where reported as the most desired employer for engineers in Germany.


It might not be a powerhouse but it's fairly stable/good. There's at least one major player (SAP) there's plenty of companies in future fields (Metaio for AR for example) and there's a lot of in house stuff. There's also sort of an "alternative OS" tradition (Suse, yellowTAB). There's also more of a focus on business software (SAP influence might shine through) imo (the difference between Wirtschaftsinformatik and Information Systems has been discussed at length in journals)

Berlin is one of the better non-SV startup locations from what I hear.


Ah SAP one of those products that promises the moon on a stick and requires expensive SAP consultants to configure - worse than Oracle from what I am told


"There's at least one major player (SAP)..."

I'm not very familiar with any of the other examples you mention, but, uh,....

Have you ever gone anywhere near SAP?


I've worked for a competitor. Independent of the quality of their products SAP is still a big software company and the German software marked makes up roughly 50% of the entire European market. At least that was the case around 2012 haven't checked since (SAP alone is responsible for most of it). My point is merely that Germany is hardly a software wasteland and the assertion that "the talented people flock to traditional engineering" is somewhat dubious (imo).

There's some cultural indicators that programming is a topic of interest as well (the existence and size of the CCC for example).


Well, it explains why off-shoring companies have such a hard time with German customers.

The quality expectation is a bit higher than what other countries are willing to accept.


In the US, the legally-protected title is Professional Engineer. I switched majors from CS to CS & Engineering because of the former was not accredited to allow becoming a PE, whereas the latter is recognized by the PE licensuring body. http://www.nspe.org/resources/licensure/what-pe


Some subfields of computer science are indisputably engineering. The line between being an engineer and a code monkey is a thin one anyway.


I don't get why "engineer" is held in such a high esteem. As for myself, you can call me Cowboy Coder Cody (CCC for short) if that's what you prefer.


The only thing I remember about Ada is that it introduced exceptions (or maybe was one of the languages that spread it). Useful little tidbit since I like to keep a mental picture of what languages roughly influenced other languages. +it has a military/secure programming background (and thus is inherently friendly towards proving/verification) It was fairly widespread in Austria for a while (90s).

Never really used it and kind of expected it to be dead or only used in specific old systems. Interesting to see that there's a new version (I have to admit I'm still stuck on 95 and missed 2007 completely).

Edit: I think SAP generates roughly 1/3 of all European software revenue so that's already pretty major. Germany has always hovered around 50% of the European software market (last time I checked was a couple of years ago)


Exceptions were already in CLU and Mesa (70's), among others.


"Ada: A New Language"

Haha. Did I just take some acid and end up back in 1973. That would be cool if this is true. Now I can really see Pink Floyd live.


No, you just missed the "2012" part of the headline. :)





Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: