Ada on the Raspberry Pi!
Not exactly show-and-tell because it's just my Pi Zero sitting on a breadboard, but I wanted to celebrate hitting a classic milestone with hardware - blinking an LED - now in Ada!
I only started learning the language a few days ago, and it's weird. For those unfamiliar, Ada was created by the US Department of Defense in 1983 after they noticed that they needed a powerful, stable, easily maintainable language for mission-critical embedded software like aerospace flight controllers, and that none of the existing languages of the day really met all the criteria they outlined. They put together four teams around the world and had them develop their own ideas based on the criteria (the "Steelman" list), and what we now call Ada (after that famous early programmer, the Countess of Lovelace - hey, the name wasn't so cliche in '83!) was the winner.
It's designed to make C programmers implode ensure stability, safety, and readability while still offering comparable performance and power to other compiled languages. It definitely feels like a language from the 80s in some ways despite being actively developed and revised - the most recent standard is Ada2012, with rumors of a new revision maybe next year - but I'm slowly getting the "groove" of it and feeling more clever.
Proof enough of that, I think, is that I've gotten it interfacing with the Raspberry Pi's GPIO without any third-party libraries or other languages! I took advantage of the /sys/class/gpio directory on the Pi to do some file I/O and manage the pins myself. I will say this - while I have nothing but respect for AdaFruit and the ADA and what they've done for their respective communities, it sure made looking up mysterious compiler errors difficult ;)
I don't quite have a pretty library package set up for it yet, and I'm sure there's more optimal ways of doing it than holding on to a bunch of file handles, but it feels like a major hurdle's been surpassed when there's no compiler warnings and the compiled test code runs cleanly in a language that two weeks ago I didn't even know existed.
If you're an Ada veteran I'd love to hear your wisdom, and if you've never heard of it before then maybe I've given you an alternative language to try for your next project! I hear the folks at AdaCore are hosting a competition for embedded Ada projects, emphasizing newbies and students...
Posted Sep 15, 2019, 5:21 PM UTC
Nice work! I started programming in Ada in 1988 for geosynchronous communication satellites and it's a beautiful language. We weren't permitted to use generics or Ada's tasking system, but Ada made it easy to write safe and clean code. It would be great to see Ada make a comeback, if nothing else than in safety critical systems. In 1990 I started developing in C, and have developed in that language ever since.