My favorite language is F#, but Ada is also interesting.
mkdir src
Put in this source directory the ada "main" file , hello.adb :
Create a gpr file , syntax is not always obvious, hello_world.gpr :
Execute the following script , compile_run :
mkdir src
Put in this source directory the ada "main" file , hello.adb :
Code:
with Text_IO;
use Text_IO;
procedure hello is
begin
Put_Line("Hello world!");
end hello;
Create a gpr file , syntax is not always obvious, hello_world.gpr :
Code:
project Hello_World is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Exec_Dir use "bin";
for Main use ("hello.adb");
package Compiler is
for Switches ("Ada") use ("-gnat2022", "-O2","-B","-d","-g");
end Compiler;
package Builder is
for Executable ("hello.adb") use "hello.exe";
end Builder;
end Hello_World;
Execute the following script , compile_run :
Code:
export CC=clang20
export CXX=clang20++
export GCC=clang20
rm -vfR ./obj/*
rm -vfR ./bin/*
gnatmake -vl -we -P hello_world.gpr
./bin/hello.exe