8 ms·
Show HN: Getada: rustup-like installer for Ada's toolchain/package manager
One of my goals with Ada is to have a one-liner copy-paste terminal command for people to install Ada so they can get to coding in just a few minutes. After extensive testing I feel like it's ready for general release[1].
Getada was inspired by Rustup[2] and aside from the init script is written entirely in Ada.
It's completely open source and you can check out the readme and code on github[3]. It currently supports all non-windows platforms that Alire has an official release for, which at present is Linux (glibc) and MacOS. If you try running it on an unsupported platform, it tries to point you in the right direction. For example, you can install Alire on windows with an already-existing installer.
It downloads the latest version of Alire[4] (Ada's toolchain and package manager, similar to Cargo) for your platform as a zip file to a temporary directory and then extracts it to a binary directory. By default the temporary directory (configure with "-t /directory" or "--tmp=/directory") defaulted to $TMPDIR or /tmp. The config directory is ~/.getada (change via "-c /directory", "--cfg=/directory", or $GETADA_CFG), and the alr and getada binaries go in ~/.getada/bin (configure with ""-b /directory", "--bin=/directory", or $GETADA_BIN). It also tries to add the file to your path by dropping a "env.sh" file into ~/.profile/ (disable with -p or --no-path).
If you don't allow executables in temporary or home directories, you can change all of these via environmental variables or passing parameters.
You can remove it all by running: getada --uninstall
Now you can create a brand new Ada project with: alr init --bin my_project (How to use Alire[5] for more details)
Since one of the biggest complaints about Ada is getting the toolchain [6], I hope this can solve a lot of problems for newcomers to the language.
[1] https://www.getada.dev https://www.getada.dev
[2] https://rustup.rs/ https://rustup.rs/
[3] https://github.com/aj-ianozi/getada https://github.com/aj-ianozi/getada
[4] https://alire.ada.dev/ https://alire.ada.dev/
[5] https://www.getada.dev/how-to-use-alire.html https://www.getada.dev/how-to-use-alire.html
[6] https://programming.dev/comment/9438211 https://programming.dev/comment/9438211
- rami3l 2y agoAs a current Rustup maintainer with a bit of Ada background I gotta say: nice work! I do feel Ada as a language is way ahead of its time, but when I was learning it (a while before the first Alire release) I was also puzzled by dev environment setup. I guess the Rust experience has shown the importance of a friendly onboarding experience, so I’m very glad to see Ada is going this direction as well with Alire and now Getada :)
- glass-z13 2y agoI don't know if it's the algorithm but for the past few months i've been seeing bits and pieces in random places about ada. Is there a reason the language is seeing more traction lately? I would assume the whole White House "approved" languages had something to do with it
- ajdude 2y agoAda's been steadily making a reassurance I think since safer languages like Rust had started to gain traction. It appeared for the first time ever on the stackoverflow survey for example. It used to be hampered down by confusing licenses but around 2021 those constraints were lifted when Adacore's "GNAT Community Edition" was retired. This was around the time Alire (works similar to if you combined Rustup with Cargo) came on the scene which meant getting the FSF version of the compiler was as trivial as running "alr toolchain --select". The most recent standard came out in 2022 along with a more centered community. Most of the ada community was living in a newsgroup (comp.lang.ada) until a year ago, and now ada-lang.io is gaining a lot of traction. Then Alire 2.0 just recently came out which made everything even more streamlined. Ada has been my favorite language for years, so I'm happy to see more people noticing it.
- brabel 2y agoI tried learning Ada a few years ago and was really put off by GNAT. Installation was something straight out of the 80's and I just forgot about it after a little fussing around without getting anything working. Great to know that's no longer the experience with Ada, I might finally get it and try to start a project using it.
- riku_iki 2y ago> Ada's been steadily making a reassurance I think since safer languages like Rust had started to gain traction Why one would use Ada now when it looks like there are much stronger contenders in this space: rust for close to metal and C#, Java, Go for slower programs?
- 2y ago
- jjgreen 2y ago[flagged]
- rizky05 2y ago[dead]
- brabel 2y agoBecause downloading an installer from the same website you curl from is so much safer, right? /s
- jjgreen 2y agoYes, it is. Because the server can detect curl | sh, serve different content and you will never know about it. Discussed numerous times on this site. https://web.archive.org/web/20230304061743/https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-server-side/ https://web.archive.org/web/20230304061743/https://www.idont...
- nicce 2y agoYeah, but your trust is always on the domain owner anyway.
- yjftsjthsd-h 2y agoUnder what threat model would that matter?
- brabel 2y agoWhen you download an installer, unless you reverse engineer it you also have no idea what it's doing. As others said, you must trust the domain you're downloading from in both cases. I really don't understand why people still argue about it. When you study security threat models, you should immediately understand that there's no difference from a security point of view. Perhaps the only alternative that's more secure is when you install the package from a package manager or app store... as in that case you have some sort of guarantee that the binaries are "vetoed" by someone who knows what they're doing it, hopefully.. i.e. you transfer your trust to the package manager's owners/maintainers... but you still need to trust the package publisher is not bent on trying to get you, because if they are, they will still find ways around package managers.
- fer 2y agoOn a related note, here's a throwback for old-timers: https://adagide.martincarlisle.com/ https://adagide.martincarlisle.com/
- agsacct 2y agoone of my old professors. Blast from the past!
- inamberclad 2y agoI'm a little confused - is this just a wrapper around https://alire.ada.dev/ https://alire.ada.dev/ ? That tool itself isn't very hard to install.
- ajdude 2y agoGetting alire installed involves downloading the zip, extracting the binary, and moving the binary to a directory in $PATH. If you're on a mac, you also have to run an "xattr" command on the tool to get it running. I've seen the last parts get newcomers tripped up so Getada takes the rustup approach. It uses github's api to retrieve the latest published release of alire[1] and then downloads and extracts it to a specified directory in $HOME. Then it creates an env file[2] and sources that file in .profile and/or .zshenv. It also logs everything that it does so it can undo it later with getada --uninstall [1] https://github.com/alire-project/alire/releases https://github.com/alire-project/alire/releases [2] Here's roughly what the env file looks like that it creates https://github.com/AJ-Ianozi/getada/blob/main/src/shells.adb#L53 https://github.com/AJ-Ianozi/getada/blob/main/src/shells.adb...
- zilti 2y agoThat is literally a bash oneliner - pipe curl into tar, and have it unpack to ~/.local/bin.
- Karellen 2y ago> Getting alire installed involves downloading the zip, extracting the binary, and moving the binary to a directory in $PATH. If you're on a mac, you also have to run an "xattr" command on the tool to get it running. Is that considered a high bar for software developers to get right?
- trollian 2y agoHow is this not called "Byron"?
- nmz 2y agoStop being smart. The tool is called GetAda, what does it do? It gets ada. What would byron do? will you remember 3 years from now?
- jclulow 2y agoWell then surely it should be "UpdAda"? (I hardly...)
- timeon 2y agoHow about "AddUp"?
- fiddlerwoaroof 2y agoWhat happens when the community decides this one isn’t good enough and comes up with a replacement? The problem I’ve always had with these descriptive names is (a) they are often hard to google because they conflict with all sorts of documentation about the problem space and (b) when they’re deprecated, they become a trap for beginners. “Cute” project names are better for the same reason as we don’t name children and pets random English phrases describing them.
- xyproto 2y agoDoes this make it possible to use Ada and SDL2 on Linux?
- synack 2y agoSDLAda has been around for a while: https://github.com/Lucretia/sdlada https://github.com/Lucretia/sdlada You can add it as a dependency to your Alire project: `alr with sdlada`
- nmz 2y agoWhy can't you use sdl on ada? You can use raylib fine enough. https://www.youtube.com/watch?v=MUISz2qA640 https://www.youtube.com/watch?v=MUISz2qA640
- xyproto 2y agoI've had issues with the combination of Ada + SDL2 + Linux in connection with https://github.com/xyproto/sdl2-examples https://github.com/xyproto/sdl2-examples. Raylib is cool, though.
- Lucretia9 2y agoLook at the "Linking" section https://github.com/ada-game-framework/sdlada https://github.com/ada-game-framework/sdlada I'm looking into getting it all automated through pragma's and gpr's.
- ultra_nick 2y agoBringing Ada into the 21st century bit by bit.
- sitzkrieg 2y agoOther ecosystems are still catching up in some ways
- owlstuffing 2y agoYep, happy to see it, well deserved. Def a sleeper with tons of potential. Comprehensive IntelliJ-level IDE tooling could bring Ada to the forefront where it belongs. Would be nice anyway.
- adezxc 2y ago> Since one of the biggest complaints about Ada is getting the toolchain [6], I hope this can solve a lot of problems for newcomers to the language. It might be just me, but Alire isn't great, I tried it multiple times, it's great for getting complicated dependencies e.g Utilada, but I go for GPRBuild as it just avoids all the fuss when programming across Linux/macOS. I might try a hard switch at one point as I didn't use Alire 2.0.0 that much, so maybe it's better now.
- anta40 2y agoalire is similar to virtualenv, yes? Every time you create a project, a fresh Ada toolchain will be downloaded.
- Lucretia9 2y agoAlire is a frontend to the toolchain, including gprbuild, it just handles grabbing the projects as well.
- adezxc 2y agoYes, but it kinda locks you into running 'alr build' and adds other things inside 'config' directory like user's distro and other things. My guess it's probably great when you already have a done project and want to publish it, but if you want to compile your code ASAP, it's much easier to avoid it completely (except for pulling packages)
- 2y ago
- ithkuil 2y agoThis! Tooling ease of use matters! A lot of interesting tech died off or never took off because the tooling was just too cumbersome to setup and use.
- zilti 2y agoAh yes, when using your package manager is too cumbersome...
- dijit 2y agoHonestly I think a lot of the Rust zealotry is because the tools are amazing. If it was just rustc on it's own I doubt it would have people chest-thumping like they do. I say this, as a lover of Rust: precisely because of Cargo, rustup and the crate system.
- hu3 2y agoEve more so in Go where the single standalone executable can: - run code - build code - format code - generate code - profile code including flame graphs - run tests and report performance down to allocations - benchmark code - manage packages - manage workspaces - scan and vet suspicious code It's amazing how much a 2 character command can do.
- jchook 2y agoAnd yet, the number of times 3rd party Go code has died on my macOS machine due to a segfault...
- jrockway 2y agogofmt is actually a separate command.
- hu3 2y agoIndeed! And it can be called from go command too: go fmt main.go https://pkg.go.dev/cmd/go#hdr-Gofmt__reformat__package_sources https://pkg.go.dev/cmd/go#hdr-Gofmt__reformat__package_sourc...
- didip 2y agoThis is amazing. devX matter a lot for adoption. I keep hearing about Ada a lot but the learning experience were difficult when I tried it.
- kevlar700 2y agoDid you come across? https://learn.adacore.com https://learn.adacore.com
- max-privatevoid 2y agoJust use Nix
- zilti 2y agoOr Guix
- throwaway81523 2y ago> One of my goals with Ada is to have a one-liner copy-paste terminal command for people to install Ada so they can get to coding in just a few minutes. After extensive testing I feel like it's ready for general release[1]. I never had trouble with this? Apt-get install gnat or similar has always worked for me. I only played around with Ada though, never did anything serious with it. Installing from source wasn't too bad either. But, trying to install spark from source was a big mess back in the day. I don't know about now.
- 01HNNWZ0MV43FF 2y agoDistro package managers often lag by a bit, hence the explosion of language-level package managers in the last... when did NPM come out... 14 years
- tormeh 2y agoWhat's cool about rustup is having many different versions of the same toolchain installed at the same time, and automatically using the appropriate toolchain version for a project. That's downright magical.
- ajdude 2y agoYeah, that's another major benefit; I can get different toolchain versions or even cross-compile to different architectures via "alr toolchain --select"
- apitman 2y agoI got my start programming through an avionics apprenticeship. My first project was porting an Ada project to C. Still hurts my heart to think about now that I'm experienced enough to appreciate a lot more of the implications.