top | item 32890100

The Ada Programming Language

63 points| jayp1418 | 3 years ago |ada-lang.io

29 comments

order
[+] csande17|3 years ago|reply
I took a look at Ada recently and was disappointed by how they've adopted an NPM-style package management approach. This was seemingly inspired by Rust -- Ada even calls its packages "crates" -- but the "bazillion micropackages owned by Internet randos" structure these tools encourage undermines many of the security benefits of both languages.

Does anyone know if there's a way to get a modern Ada compiler toolchain (and IDE support etc) without depending on this ecosystem?

[+] onox|3 years ago|reply
I do not know the exact rationale of the Alire devs, but Ada already uses (since 83) the word "package" to indicate a module or namespace, so calling dependencies a "crate" seems to avoid confusion with an Ada "package".

The crates of the community index [1] are somewhat vetted because they are added to the index using a PR on GitHub. You're not required to use these external crates though, you can create your own monorepo if you want.

My personal experience has been that a package manager (for any language) makes it much easier to download and build some project.

There's a decent amount of packages in the Ada standard library, but it's not up to the level of Go's. Ada has a subset called SPARK for functional specification and static verification, so you can write, and some of the crates are actually written in SPARK.

It's quite fun to write some parts of the code in SPARK and get it to prove it with the gnatprove tool (which you can get with `alr get gnatprove` and run it on your code with `alr gnatprove`).

AdaCore also has a variant of the runtime library for embedded systems that is partially proven with SPARK [2].

[1] https://github.com/alire-project/alire-index [2] https://blog.adacore.com/proving-the-correctness-of-gnat-lig...

[+] synack|3 years ago|reply
The GNAT toolchain that Alire installs automatically is built by GitHub Actions runners from the GNAT-FSF-builds [1] repository.

You can download the toolchain as a tarball from the releases page and use it separately if you'd like. If you use Alire, it'll take care of downloading and unpacking the tarball and add it to your PATH when called via alr build.

[1] https://github.com/alire-project/GNAT-FSF-builds/releases

[+] galangalalgol|3 years ago|reply
Seconded, having to grab 9 crates just to get random numbers in rust is my least favorite thing about the language. As adacore and ferrous systems work on the safety critical rust (ferrocene), I'm hoping they create a vetted and well tested subset of crates.io that I can just install from a tgz.

The fine granularity of dependencies that package managers have facilitated has made air-gapped devlopment logistically very difficult. And it makes safety or security certifications impossible.

[+] jeff-davis|3 years ago|reply
I had similar concerns (also starting with rust). But for languages that could be used in many environments (including embedded) I think a small stdlib is good.

Perhaps there needs to be a separate low-rate-of-change set of reviewed libraries that can be used more easily without dependency explosion.

[+] topdancing|3 years ago|reply
Funny how before Alire was a thing, people complained that there was no easy way to take other people's Ada code and add it to one's own software projects.

Now Alire exists and people complain that it's easy to add people's code into their own projects.

You don't even have to use Alire in the first place - every modern Linux distro ships with an Ada compiler - on Fedora just install gcc-gnat and off you go.

[+] Jtsummers|3 years ago|reply
AdaCore themselves direct you to use Alire to install what used to be their community edition. You don't have to use any of the crates if you don't want to.
[+] flexagoon|3 years ago|reply
Can you explain please? I'm not familiar with how NPM or Rust crates work, but isn't it the same package structure as used by Python and pretty much any other language with packages? What's the difference?
[+] sally1620|3 years ago|reply
This is the first time I hear about Ada package manager. You can always download GNAT, an Ada fronted for GCC, and start coding in terminal and a text editor. You don't need package manager and all of the other stuff.
[+] Jtsummers|3 years ago|reply
This appears to copy the AARM but the bottom of the site claims to be licensing everything under Apache 2.0 and neglects the actual copyrights on the text. They can be seen here:

http://www.ada-auth.org/standards/2xaarm/html/AA-TTL.html

That's not a terribly good idea in general. Interestingly, for the Style Guide they were at least courteous enough to note the original license, but not the AARM.

[+] onox|3 years ago|reply
The text at the bottom says "unless otherwise noted". The .md files for the AARM are autogenerated and it seems the legal + foreword pages are missing. These indeed need to be added. The announcement was done by an external person, but nonetheless thanks for bringing it to our attention. The website is still work in progress and is intended to be handed off to the Ada community.
[+] onox|3 years ago|reply
Title page with legal info has been added!
[+] amilios|3 years ago|reply
What is the biggest Ada-based project currently in use? Does anyone know? Is Ada more for DoD-type backend-stuff, where Fortran or C would be used, or something else? What is Ada for?
[+] csande17|3 years ago|reply
I don't know about specific projects, but the main Ada use case I've heard about is safety-critical embedded systems in heavily regulated industries. The same sort of places you might use NASA JPL's famously strict rules for C code--things like control loops for jet engines. (One of the most compelling reasons to use Ada is SPARK, a theorem prover bolted onto the compiler that can formally verify your program doesn't violate any assertions or trigger any runtime errors.)
[+] kjs3|3 years ago|reply
One example would be the Boeing 777 flight control software.
[+] bee_rider|3 years ago|reply
Was there a new release or anything?
[+] onox|3 years ago|reply
This website is just a community effort to modernize parts of the online resources, because many parts like the current Ada Reference Manual look like they're from the 90s.
[+] agumonkey|3 years ago|reply
seems like a toolchain effort to lower entry point