[HN Gopher] Ada Programming Language
___________________________________________________________________
Ada Programming Language
Author : jayp1418
Score : 48 points
Date : 2022-09-18 18:32 UTC (4 hours ago)
(HTM) web link (ada-lang.io)
(TXT) w3m dump (ada-lang.io)
| csande17 wrote:
| 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?
| galangalalgol wrote:
| 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.
| smaddox wrote:
| > 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.
|
| Cargo has a vendor feature: https://doc.rust-
| lang.org/cargo/commands/cargo-vendor.html
|
| Is there some language ecosystem that is better?
| rascul wrote:
| > Seconded, having to grab 9 crates just to get random
| numbers in rust is my least favorite thing about the
| language.
|
| I've noticed that crates can often include default features I
| don't want or need. If you don't include the default features
| ('cargo add --no-default-features rand' is what I did) then
| the only other crate pulled in is rand_core. I've gotten into
| the habit of reviewing the features and only including the
| ones I need. I don't know if there's a better solution that
| could be implemented somewhere upstream but this works for
| me.
| jeff-davis wrote:
| 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.
| galangalalgol wrote:
| A small stdlib is good, and any crate that can, should allow
| for no_std. I think originally the justification for a small
| stdlib was so that people didn't deprecate parts of it with a
| better 3rd party lib. They would bring libs into std as it
| became obvious they were the de facto standard already. They
| just haven't been terribly aggressive about doing that.
|
| I think if there was a no_std package and stdlib+ vetted and
| slower to change package (and available through yum or apt or
| a tgz instead of crates), safety and security critical
| applications would move towards it more quickly. It would
| also make air-gapped development networks easier to
| provision.
| synack wrote:
| 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
| csande17 wrote:
| Nice, thanks for the tip!
| sally1620 wrote:
| 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 wrote:
| 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.
| onox wrote:
| 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...
| amilios wrote:
| 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 wrote:
| 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.)
| Jtsummers wrote:
| 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 wrote:
| Title page with legal info has been added!
| onox wrote:
| 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.
| bee_rider wrote:
| Was there a new release or anything?
| agumonkey wrote:
| seems like a toolchain effort to lower entry point
| onox wrote:
| 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.
| [deleted]
___________________________________________________________________
(page generated 2022-09-18 23:02 UTC)