|
|
|
|
|
by nytpu
541 days 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) |
|
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-...