Monday, July 14, 2008

Wading through Ada Programming

I got to "experience" programming in Ada back at college first. Back then, I remember having used a certain version of GNAT. It was for Win95 if I remember it right.

Now, I tried to get the same environment for my notebook to help me answer an FMA question. Never did I realize that it would be that hard. I spent more than 6 hours to get the GNAT Programming Studio (GPS) IDE going for me but eventually, I had to raise up my arms in surrender in the end. Getting my ADB file, (a simple Hello World program for crying out loud,) to work in the IDE consumed a lot of my time as the compiler and build messages were too cryptic. The scarcity of related material from the internet helped me reach the conclusion that were I to get the stuff going, it would only be because I had already sacrificed time I should be spending for other important stuff too.

Thanks to this Mississippi College resource, I was able to get some stuff going through the command line. It was not as pretty but it got what I wanted done: to test some named compatibility scenarios in Ada. The essence was particularly in the GNAT (compiler) User's Guide page.

In particular, the following lines of code could be used to generate the executable given a hello.adb file:

gnatgcc -c hello.adb
gnatbind hello
gnatlink hello

or simply:

gnatmake hello.adb

Thanks to Dr. Bennet for the helpful information.

No comments: