Title here
Summary here
Our first program will print the classic “hello world” message. Here’s the full source code.
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello_World is
begin
Put_Line ("hello world");
end Hello_World;To run the program, compile the code into an executable using gnatmake.
$ gnatmake hello_world.adb
$ ./hello_world
hello worldSometimes we’ll want to build our programs into binaries. In Ada, the gnatmake command handles both compilation and linking.
First, compile the code:
$ gnatmake hello_world.adb
$ ls
hello_world hello_world.adb hello_world.o hello_world.aliWe can then execute the built binary directly.
$ ./hello_world
hello worldNow that we can run and build basic Ada programs, let’s learn more about the language.