Ada programming language is one that I like the most. I now am struggling to learn this amazing language. Someone say that the first programming language your learn will affect so much on the future of how you learn another language. Yeah, that’s true. My first programming language is Visual Basic 6.0. And, every time I study new language, then I try to compare both the language: VB and the language I am learning.
Now it is time to Ada. Ada is more close to Pascal, but advanced version. For you who familiar with Pascal, I think there will be no problem for you to learn Ada, as well. This language is easy to read, reliable, and… fast, I think.
And now, I will share my experience on installing Ada compiler (GNAT) and how you can code Ada in Ubuntu Linux.
Install Ada Compiler
To install Ada compiler. Open the terminal window, then write: sudo apt-get install gnat.
Edit Ada files using ViM
ViM is good enough for being the Ada editor. Even though you can use ViM for editing C as well. I will give a basic view of how to use Vim.
- type “vim [file_name].adb”, by doing this, the ViM will set the syntax to Ada. Don’t worry, you can write the file name even though you don’t really have the physical file. You can save the file later.
- If you want to save. You have to write a command in vim. To activate a command, press Ctrl + C (Ctrl and C at the same time).
- Type “:w” to save/to write. Type “:q” to quit. Type “:wq” to save and then quit. Here is the VIM command cheat set
- To compile. Type; gnat make [filename].adb
- Then, you can run/lunch the file also via the terminal.