top | item 42531518

(no title)

nytpu | 1 year ago

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)

discuss

order

ajdude|1 year ago

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-...

DaiPlusPlus|1 year ago

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)

chlorion|1 year ago

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