Hacker News new | past | comments | ask | show | jobs | submit | nytpu's comments login

It's FOSS and is actually included with GCC, but the toolchain is still a PITA to install just because no one (other than Debian and Arch Linux) bothers packaging it. I think Alire is supposed to make it easy to install but I haven't used it much: https://alire.ada.dev/

SPARK 2014 itself is the same too AFAIK, the problem is there's a lot of auxiliary static analysis tools and plugins that are gated behind AdaCore's sales wall (and of course they'd never deign to sell licenses affordable to individuals)


The situation was pretty bad a few years ago, and the licensing was confusing but it's pretty straightforward now with Alire. (AdaCore also got rid of their "Community Edition which had the weird license restrictions).

I'm doing a presentation at FOSDEM next year called "Get started with Ada in 2 minutes or less!"[1]; because (on MacOS and Linux) I can go from not having no toolchain a all to compiling hello world in under 2 minutes (I've timed it).

Here's some steps:

1. open your terminal, run the following command: curl --proto '=https' -sSf https://www.getada.dev/init.sh | sh

Congratulations, you now have Alire!

2. Run the following command: alr init --bin hello

Now you have a fully structured Ada project, gpr files and all!

3. Edit your program in hello/src/hello.adb

You can use vscode to open the hello folder with the Ada Language server, or just run "alr edit" to open your editor with all of the files built in.

4. Compile with: alr build

Alire will automatically grab the latest native toolchain (gnat, gprbuild, etc) and compile the program.

If you want to use another toolchain, such as for cross-compiling, or another version of GNAT, simply run: alr toolchains --select

5. Run the program: hello/bin/helo

On windows, you can just download the windows installer; alire is also on Freshports for the BSDs.

[1] https://fosdem.org/2025/schedule/event/fosdem-2025-5056-get-...


Your step 1 violated my very hard rule against piping curl into a shell.

…and is ironic advice for a safety-critical system, no?

——-

(Yes, I’ve read arp242.net/curl-to-sh.html - but my point being that as I’d be new to Ada then I don’t know who to trust; I’ve never heard of getada.dev therefore I don’t trust it)


It's an understandable rule, and you can definitely just download the binary from alire.ada.dev and add it to $PATH but with such a harsh stigma around how difficult it is to get the toolchain set up, GetAda follows the precedent of Rust, where you can grab the toolchain via "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" (thanks to Rustup).

It was received positively at the time:

Show HN: Getada: rustup-like installer for Ada's toolchain/package manager 194 points | 115 comments: https://news.ycombinator.com/item?id=40132373


Is it really so bad to run it twice, with cat/bat replaced with sh on the second pass? If you're really paranoid about it you could save the first run to a file, so you know for certain that the server didn't do a switcheroo for the second one, but if you think about it, that's a low-payout move for Bad Guy #N compared to just sending the pwnage the first time around.

This is beside the fact that we're talking about downloading and running a user-owned binary, which, unlike the shell script, is impractical to inspect in any detail, and has the same privileges as the shell script we're supposed to worry about.

I view "don't curl to shell" as about 90% theatrics basically. Sure, read it first, I do in fact do that. But it's a silly 'very hard rule'.


I routinely save to a file before execution, but it's not really about being attacked. It's about the fact that those scripts, in order to be "fire and forget", make many assumptions, often very large ones, about where I want things or under what user, etc.

Many of them are actually quite well-written under the hood and can be easily moved to other directories, have comments about what it is doing, etc.


Here are the Rust installation instructions, that apparently is sooo much better,

https://www.rust-lang.org/learn/get-started

> The primary way that folks install Rust is through a tool called Rustup, which is a Rust installer and version management tool.

A couple of lines below

> curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh


I'm pretty sure that gentoo also packages ada, but it doesn't get installed by default, as its behind a USE flag.


Not really much other than tangential mentions. I did write an addendum to the OP going over the secondary stack as well as where you still use normal dynamic allocation in Ada: https://nytpu.com/gemlog/2024-12-27-2

All my knowledge on it comes from some documentation on configuring the secondary stack for embedded targets and from comments+diagrams in the GCC GNAT source code (and maybe I saw a conversation on it on the comp.lang.ada Usenet group at some point…): https://docs.adacore.com/gnat_ugx-docs/html/gnat_ugx/gnat_ug... https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/ada/libgnat/...


Except they were originally "Apple Computers" until they slowly gained enough recognition to rebrand to "Apple," plus that was in 1984, there wasn't an oversatuated market of other computer brands also called "Apple," unlike "Element" which has tons of existing tech-related and non–tech-related overlap and is generic on top of it.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: