> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide.<p>At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using Java or Python depending on who taught which of the courses in that first series.<p>People found it frustrating how much work it'd take to get their programs to even compile but that's a good thing in my view. If it wasn't compiling, that was normally because the compiler found an error that would still be there at runtime in another language.
In answer to what appears to be a misunderstanding about Rust:<p><i>> Its foreign function interface seems particularly poorly implemented. The official Rust documentation suggests the use of the external third-party libc library (called a 'crate' in Rust parlance) to provide the type definitions necessary to interface with C programs. As of the time of writing, this crate has had 95 releases. Contrast this with Ada’s Interfaces.C package, which was added the language in Ada 95 and hasn’t needed to change in any fundamental way since.</i><p>Rust's libc crate isn't third-party, it's first-party, developed by the Rust project itself: <a href="https://github.com/rust-lang/libc/" rel="nofollow">https://github.com/rust-lang/libc/</a> . It's also not just for type definitions necessary to interface with C programs; here's the first heading and first paragraph of its README:<p><i>"libc - Raw FFI bindings to platforms' system libraries"<p>"libc provides all of the definitions necessary to easily interoperate with C code (or "C-like" code) on each of the platforms that Rust supports. This includes type definitions (e.g. c_int), constants (e.g. EINVAL) as well as function headers (e.g. malloc)."</i><p>The fact that this library contains low-level type definitions for every platform that Rust supports explains why it's had more than one release: new platforms get added, platforms add new interfaces, and platforms change the definitions of existing interfaces (possibly incompatibly, which explains why this isn't in the standard library).<p><i>> It lacks basic features necessary for the task, like bitfields, and data structure packing.</i><p>The latter is achieved via the built-in `repr(packed)` attribute (<a href="https://doc.rust-lang.org/nomicon/other-reprs.html#reprpacked" rel="nofollow">https://doc.rust-lang.org/nomicon/other-reprs.html#reprpacke...</a>) and the former is provided by the bitflags crate: <a href="https://crates.io/crates/bitflags" rel="nofollow">https://crates.io/crates/bitflags</a> (while unlike libc this does not live under the rust-lang org on Github, it does live under its own org which appears to be populated exclusively by Rust project team members).
This was a good read. I instantly recognized the title of the textbook that is mentioned in the blogpost? I own it!<p>Having a background in C, I went back and forth with Ada for years, without really jumping all in. In the last couple years in particular, with the growing popularity of Rust, I started to renew my interest.<p>I'm reminded of a popular reddit thread on r/Ada-- someone called Rust a "toy language", which prompted the valid response that Rust is being used in a lot of commercial products lately. The response[0] kind of brings home the caliber that Ada is capable of, starting with:
> Rust being used in commercial products isn’t really the same ballpark as what I’m talking about. It’s not even the same game.<p>It seems like the easiest way to trend on HN is to make a post such as "<old software> rewritten in Rust", but each time I see more and more people advertising Rust, I just wonder why Ada didn't get the credit it deserved as being absolutely bulletproof. Eventually, I came across an "Ada Manifesto" of sorts [1] that finally pushed me to "put my money where my mouth is" and start going all in with the language.
(the same author of that "Manifesto" maintained a "Should have Used Ada"[2] series for a while that points out just how using Ada could have stopped certain security vulnerabilities from ever being a problem in the first place)<p>Ada is anything but dead and there's a lot of interesting things coming out for the 202x specification. I hope to see community enthusiasm grow as people begin to shift their interest more and more to safe languages.<p>[0]: <a href="https://old.reddit.com/r/ada/comments/js6edd/regarding_this_language/gbzqe6s/?context=3" rel="nofollow">https://old.reddit.com/r/ada/comments/js6edd/regarding_this_...</a>
[1]: <a href="https://old.reddit.com/r/ada/comments/7p12n3/going_allin_with_ada_a_manifesto/" rel="nofollow">https://old.reddit.com/r/ada/comments/7p12n3/going_allin_wit...</a>
[2]: <a href="https://annexi-strayline.com/blog/" rel="nofollow">https://annexi-strayline.com/blog/</a>
I really like Ada's ranged types (VHDL has them also - it inherited them from Ada). You can say:<p><pre><code> type OperatingTemp is range 33 .. 90;
</code></pre>
And then declare variables of that type and they will be range checked - an exception will be thrown if the variable goes out of that range. Wish more languages had this feature.
I like the "clean feel" of Ada's syntax: it combines the elegance of Python with a bit more structure and does not suffer from Python's significant whitespace issues.<p>The so-called "Ada comb" structure that is used for packages, subprograms, and even declare blocks makes it easy to find what you are looking for because it makes the source code more regular.<p>The "Ada comb" is formed by the shape of the source code with the subprogram header / declare, begin, exception, and end forming the "teeth" of the comb and the rest of the source code indented between the "teeth":<p>function Square_Root (Arg : Float) return Float is<p><pre><code> -- local variables declared here
</code></pre>
begin<p><pre><code> -- program work here
</code></pre>
exception<p><pre><code> -- exception handling here
</code></pre>
end Square_Root;
I took my first university course in Ada in 1981. I also worked for a company that provided an Ada runtime in the mid 80's.<p>Ada was sabotaged early on because it was 'mandated' by the DOD for new programs. That meant that all the usual suspects, like Lockheed, GD , TI (I don't remember exactly which ones) came up with Ada compilers and runtimes that cost on the order of $10K per seat. The typical military contractor ripoff. So it was impossible for individuals or small companies to use Ada on their own dime. It was only feasible if the cost was rolled into a larger (bloated) defense contract. So it couldn't get a following. Of course much later on free versions became available but it was too late.<p>That said, Ada was absolutely no fun to program with. It was awkward and verbose. I hated it from the get go, compared to the alternatives. If it is so super why is rarely used.
I went to a summer program at the US Air Force Academy and took a short class using Ada with Lego mindstorm robots. Having never done any programming at the time beyond BASIC (thanks to QBASIC and my TI-83+ calculator), I really enjoyed learning Ada. The instructor talked about the safety aspect of Ada which went over my head at the time :)<p>I have done a lot of embedded programming in C over the years and while the reality is most embedded programmers know C best, I am starting to think we would be better served to try a new language with better features such as Ada or Rust. C++ is nice as well, but has it's own set of problems when used for embedded programming.
I love Ada, unfortunately it’s real world use seems to be relegated to old legacy code. I’d like to use it a little more on the side, but I also need to keep my priorities focused on realism, which sadly means ignoring Ada and learning something like C++ which seems unapproachable from any angle.<p>Ada also seems to have a weirdly negative rep in many circles it seems. I recall looking around for an Ada compiler for a moderately popular platform and came across and old thread where people didn’t give any options but instead just joking about how the OP was interested in such a terrible language. Maybe it’s the Pascal/Algol type syntax?
His discussion of Ada (not all upper case -- can the HN title be changed?) is interesting, but his criticism of Fortran, although colorful ("eldritch"?) , is vague and likely uninformed. I program in Fortran 95 a lot and can easily understand my code years later.<p>"Admittedly, I had pictured Ada’s syntax resembling the uncompromising verbosity and rigid construction of COBOL, or perhaps the Lovecraftian hieroglyphics of Fortran’s various eldritch incarnations."
> The writing is on the wall: Ada is here to stay.<p>OK, this has no relation to the actual content of the article, but I have to point out that that is not what the phrase "the writing is on the wall" means.
> It is possible to define a struct type in C with bit-fields for the individual elements, however the C standard does not guarantee the layout and order of the individual fields.<p>As a professional embedded developer who uses bitfields to access registers every day, this doesn't really make a practical difference. On any bare-metal or embedded project you will rely on the behaviour of your compiler, and portability is largely irrelevant if you're accessing memory-mapped registers. Probably, the manufacturer has already provided register maps using bitfields anyway.
I think the thing that's been under-sold in Ada is the way you can get so much at compile time as properties of things, like, you can say "this type counts between 1 and 30" and then later refer to "the largest value of this type" as a loop bound, say, in a way that won't break if you later set the maximum to 40. And hides the fact it's implemented as an unboxed primitive integer.
I tend to like Ada, but it is a tiring language to read with the all caps. Also, it 'feels' like it has a gatekeeper group and really doesn't come up in any mobile conversation. I still believe someone will do something akin to a syntax substitution and come up with a well liked language.<p>Also, modern Fortran is not that bad of a language much like the modern parts of C++.
> the Lovecraftian hieroglyphics of Fortran’s various eldritch incarnations.<p>This is one of the best lines I've read in awhile, gave me a good chuckle. Thanks for that.
I took an Ada programming course when I worked at a defense contractor in the late 80s. Coming from C and Pascal it seemed familiar enough to learn quickly but was overkill for what we were doing at the time. I left soon after and I have no idea if they ever actually adopted it.
No discussion of Ada is complete without referencing the cost of commercial development licenses. They're expensive. Very expensive.<p>Any enthusiasm for this language is inevitably quashed upon encountering the $$,$$$ per-seat price of the compilers for the absolute bare-bones x86 version. It's more if you want to target non x86. I pester AdaCore for info every few years and while they've dropped a little bit, they're still out of reach for companies not in the Fortune 500. I'd love to use SPARK, but I don't see that happening any time soon.
Ada syntax is closely related to Pascal and Algol. If you like these languages, then you will enjoy Ada. Unfortunately many people prefer the tenseness of C++.
We did Ada at UNSW in the early 90's but for only one subject - parallel programming. I think many dining philosophers starved during the assignments...
No mention of FAA's DO-178C or Green Hills Integrity-178 RTOS? Green Hills's IDE is named after Ada[1].<p>[1] <a href="https://ghs.com/products/AdaMULTI_IDE.html" rel="nofollow">https://ghs.com/products/AdaMULTI_IDE.html</a>
Thought this was talking about blockchain tech, Cardano (Token $ADA) which I'm having a hard time giving a chance. Was hoping something could change my mind