TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Giving Ada a Chance

177 pointsby jayp1418about 4 years ago

27 comments

iamevnabout 4 years ago
&gt; 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&#x27;d take to get their programs to even compile but that&#x27;s a good thing in my view. If it wasn&#x27;t compiling, that was normally because the compiler found an error that would still be there at runtime in another language.
评论 #26319825 未加载
评论 #26320151 未加载
评论 #26320252 未加载
评论 #26324583 未加载
评论 #26320507 未加载
评论 #26320063 未加载
评论 #26323094 未加载
评论 #26322317 未加载
评论 #26322287 未加载
评论 #26321539 未加载
kibwenabout 4 years ago
In answer to what appears to be a misunderstanding about Rust:<p><i>&gt; Its foreign function interface seems particularly poorly implemented. The official Rust documentation suggests the use of the external third-party libc library (called a &#x27;crate&#x27; 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&#x27;s libc crate isn&#x27;t third-party, it&#x27;s first-party, developed by the Rust project itself: <a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;libc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;libc&#x2F;</a> . It&#x27;s also not just for type definitions necessary to interface with C programs; here&#x27;s the first heading and first paragraph of its README:<p><i>&quot;libc - Raw FFI bindings to platforms&#x27; system libraries&quot;<p>&quot;libc provides all of the definitions necessary to easily interoperate with C code (or &quot;C-like&quot; 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).&quot;</i><p>The fact that this library contains low-level type definitions for every platform that Rust supports explains why it&#x27;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&#x27;t in the standard library).<p><i>&gt; 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:&#x2F;&#x2F;doc.rust-lang.org&#x2F;nomicon&#x2F;other-reprs.html#reprpacked" rel="nofollow">https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;nomicon&#x2F;other-reprs.html#reprpacke...</a>) and the former is provided by the bitflags crate: <a href="https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;bitflags" rel="nofollow">https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;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).
评论 #26323100 未加载
评论 #26321083 未加载
评论 #26320997 未加载
ajdudeabout 4 years ago
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&#x27;m reminded of a popular reddit thread on r&#x2F;Ada-- someone called Rust a &quot;toy language&quot;, 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: &gt; 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 &quot;&lt;old software&gt; rewritten in Rust&quot;, but each time I see more and more people advertising Rust, I just wonder why Ada didn&#x27;t get the credit it deserved as being absolutely bulletproof. Eventually, I came across an &quot;Ada Manifesto&quot; of sorts [1] that finally pushed me to &quot;put my money where my mouth is&quot; and start going all in with the language. (the same author of that &quot;Manifesto&quot; maintained a &quot;Should have Used Ada&quot;[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&#x27;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:&#x2F;&#x2F;old.reddit.com&#x2F;r&#x2F;ada&#x2F;comments&#x2F;js6edd&#x2F;regarding_this_language&#x2F;gbzqe6s&#x2F;?context=3" rel="nofollow">https:&#x2F;&#x2F;old.reddit.com&#x2F;r&#x2F;ada&#x2F;comments&#x2F;js6edd&#x2F;regarding_this_...</a> [1]: <a href="https:&#x2F;&#x2F;old.reddit.com&#x2F;r&#x2F;ada&#x2F;comments&#x2F;7p12n3&#x2F;going_allin_with_ada_a_manifesto&#x2F;" rel="nofollow">https:&#x2F;&#x2F;old.reddit.com&#x2F;r&#x2F;ada&#x2F;comments&#x2F;7p12n3&#x2F;going_allin_wit...</a> [2]: <a href="https:&#x2F;&#x2F;annexi-strayline.com&#x2F;blog&#x2F;" rel="nofollow">https:&#x2F;&#x2F;annexi-strayline.com&#x2F;blog&#x2F;</a>
评论 #26319620 未加载
评论 #26321106 未加载
评论 #26321354 未加载
UncleOxidantabout 4 years ago
I really like Ada&#x27;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.
评论 #26320610 未加载
评论 #26320328 未加载
评论 #26321950 未加载
评论 #26324059 未加载
评论 #26320295 未加载
评论 #26324244 未加载
评论 #26322782 未加载
thesuperbigfrogabout 4 years ago
I like the &quot;clean feel&quot; of Ada&#x27;s syntax: it combines the elegance of Python with a bit more structure and does not suffer from Python&#x27;s significant whitespace issues.<p>The so-called &quot;Ada comb&quot; 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 &quot;Ada comb&quot; is formed by the shape of the source code with the subprogram header &#x2F; declare, begin, exception, and end forming the &quot;teeth&quot; of the comb and the rest of the source code indented between the &quot;teeth&quot;:<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;
评论 #26317366 未加载
评论 #26319561 未加载
评论 #26321876 未加载
评论 #26321404 未加载
dmh2000about 4 years ago
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&#x27;s.<p>Ada was sabotaged early on because it was &#x27;mandated&#x27; by the DOD for new programs. That meant that all the usual suspects, like Lockheed, GD , TI (I don&#x27;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&#x27;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.
评论 #26323669 未加载
评论 #26323471 未加载
roland35about 4 years ago
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&#x27;s own set of problems when used for embedded programming.
评论 #26319708 未加载
the_only_lawabout 4 years ago
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&#x2F;Algol type syntax?
评论 #26317837 未加载
评论 #26318685 未加载
评论 #26320906 未加载
评论 #26321710 未加载
评论 #26318147 未加载
评论 #26325672 未加载
Bostonianabout 4 years ago
His discussion of Ada (not all upper case -- can the HN title be changed?) is interesting, but his criticism of Fortran, although colorful (&quot;eldritch&quot;?) , is vague and likely uninformed. I program in Fortran 95 a lot and can easily understand my code years later.<p>&quot;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.&quot;
评论 #26317344 未加载
Sniffnoyabout 4 years ago
&gt; 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 &quot;the writing is on the wall&quot; means.
评论 #26319730 未加载
评论 #26322565 未加载
shannongreenabout 4 years ago
&gt; 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&#x27;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&#x27;re accessing memory-mapped registers. Probably, the manufacturer has already provided register maps using bitfields anyway.
评论 #26324305 未加载
butterisgoodabout 4 years ago
Ada shouldn&#x27;t be all caps I don&#x27;t think.<p>(I always expand that to the American Dental Association)
评论 #26317429 未加载
评论 #26317555 未加载
评论 #26317446 未加载
评论 #26318447 未加载
JulianMorrisonabout 4 years ago
I think the thing that&#x27;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 &quot;this type counts between 1 and 30&quot; and then later refer to &quot;the largest value of this type&quot; as a loop bound, say, in a way that won&#x27;t break if you later set the maximum to 40. And hides the fact it&#x27;s implemented as an unboxed primitive integer.
protomythabout 4 years ago
I tend to like Ada, but it is a tiring language to read with the all caps. Also, it &#x27;feels&#x27; like it has a gatekeeper group and really doesn&#x27;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++.
评论 #26318069 未加载
评论 #26320377 未加载
评论 #26319062 未加载
评论 #26321778 未加载
drannexabout 4 years ago
&gt; the Lovecraftian hieroglyphics of Fortran’s various eldritch incarnations.<p>This is one of the best lines I&#x27;ve read in awhile, gave me a good chuckle. Thanks for that.
TomMaszabout 4 years ago
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.
cartoonfoxesabout 4 years ago
No discussion of Ada is complete without referencing the cost of commercial development licenses. They&#x27;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&#x27;s more if you want to target non x86. I pester AdaCore for info every few years and while they&#x27;ve dropped a little bit, they&#x27;re still out of reach for companies not in the Fortune 500. I&#x27;d love to use SPARK, but I don&#x27;t see that happening any time soon.
评论 #26325651 未加载
coliveiraabout 4 years ago
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++.
nevsterabout 4 years ago
We did Ada at UNSW in the early 90&#x27;s but for only one subject - parallel programming. I think many dining philosophers starved during the assignments...
walshemjabout 4 years ago
&quot; Lovecraftian hieroglyphics of Fortran’s various eldritch incarnations.&quot;<p>I take it the Author hasn&#x27;t seen any APL code.
superbcarrotabout 4 years ago
I have so many languages on the &quot;give it a chance&quot; list that I don&#x27;t know where to start.
评论 #26320215 未加载
nofunsirabout 4 years ago
No mention of FAA&#x27;s DO-178C or Green Hills Integrity-178 RTOS? Green Hills&#x27;s IDE is named after Ada[1].<p>[1] <a href="https:&#x2F;&#x2F;ghs.com&#x2F;products&#x2F;AdaMULTI_IDE.html" rel="nofollow">https:&#x2F;&#x2F;ghs.com&#x2F;products&#x2F;AdaMULTI_IDE.html</a>
评论 #26321068 未加载
whoisjohnkidabout 4 years ago
You know you’re deep into crypto when you read title and think this is talking about cardano
pdqabout 4 years ago
Ada, not ADA.
tenkenabout 4 years ago
I &lt;3 Ada
eplanitabout 4 years ago
A nitpick, but why is Ada in all caps in the title? It isn&#x27;t in the article, nor is the name an acronym.
评论 #26318276 未加载
评论 #26318152 未加载
评论 #26318993 未加载
评论 #26318340 未加载
评论 #26318589 未加载
评论 #26318953 未加载
评论 #26318646 未加载
snugabout 4 years ago
Thought this was talking about blockchain tech, Cardano (Token $ADA) which I&#x27;m having a hard time giving a chance. Was hoping something could change my mind
评论 #26317612 未加载