Beginning with Ada

ada_lovelace_portraitSo I’ve been thinking about trying out the Ada programming language for some time, but I kept putting it off. Learning a new language enough to actually be productive in it is a pretty large undertaking, and it seemed that there was always some reason to put it off, just until the next project. Well, that next project was also in a hurry, so it was put off yet again, etc.

I was finally tipped over the edge by a mention in Jack Ganssle’s wonderful embedded programming newsletter about a programming competition for Ada projects. (The top prize is €5000, so if by chance anyone is reading this before the end of September 2016 and is an Ada programmer, you might want to look into it.)

I’m just competitive enough so that sounds like it might enough incentive to get me going and learn the language. I’m fully aware that I don’t have the chops to win the contest, but I still plan to take advantage of it to give me the extra push to actually spend the time on it finally. I think I’ll use it to program up my garage door closer project.

The most attractive thing to me about the language is its promise of a lack of bugs due to its heavy use of contracts and compile-time checking. (Though there are also run-time checks, which can be enabled or not, depending on the programmer’s choice.) There’s also a subset of the language that is designed around being formally provable (in the mathematical sense) to not have bugs in the algorithm. This is a huge thing in being able to trust that your microcontroller will actually do what you mean for it to do! If the code is controlling something with safety implications then being able to trust it to behave is, of course, very important. (Even something like the bed heater on a 3D printer can benefit from this degree of trust.)

Although one more large point in its favor is the fact that it’s named after Ada Lovelace, who is often regarded as the world’s first programmer. There aren’t many contributions by women that are acknowledged and celebrated in the history of computer science, not to mention the rest of science or mankind in general. So just from that standpoint, I was already tending to like the idea of the language, before even hearing about its other promising features. Because really, at the end of the day, any Turing complete language can get the job done, its just a matter of whether the language will help or hinder you get to the finish line.

Leave a Reply