I recently came across software projects built with Ada - yep, that old programming language going back to the 1980s. I never used it before, so let's give it a try! :)
Screenshot: https://learn.adacore.com/courses/courses.html
With a quick search, I came across learn.adacore.com, which seems (at least at my current state of knowledge) a very valuable starting point. In order to try things out, I need an Ada development environment.
Since I don't want to clutter my system with yet another development environment, I chose to use Docker to put all in a container. This way it doesn't install any new libs/tools on my machine, I can rebuild it at any time, and I can delete the whole thing with a single command if I'm fed up with it :)
Ada uses GNAT as compiler, which is available as package in most Linux Distributions. I'm using Debian 10 here, but most others should probably do as well.
Dockerfile:FROM debian:10-slim
RUN apt-get update
RUN apt-get install -y gnat gprbuild
docker build -t ada .
docker run -v $(pwd):/data -it --name ada ada /bin/bash
This mounts the current working directory in the host to the /data directory in the container and starts a bash shell.
greet.adb:with Ada.Text_IO;
procedure Greet is
begin
-- Print "Hello, World!" to the screen
Ada.Text_IO.Put_Line ("Hello, World!");
end Greet;
root@ac8354411312:/# cd /data/
root@ac8354411312:/data# gprbuild greet.adb
using project file /usr/share/gpr/_default.gpr
Compile
[Ada] greet.adb
Bind
[gprbind] greet.bexch
[Ada] greet.ali
Link
[link] greet.adb
root@ac8354411312:/data# ./greet
Hello, World!
Anyone else using this language? Let me know in the comments!