Vala is an object-oriented programming language, with syntax inspired by C#.
With a self-hosted compiler that generates code in C that uses GObject, it was created to be used in developing applications for GNOME, and was later adopted by Elementary OS.
In one of the videos we made on Performance Tests with Programming Languages, Vala was in 1st Place as the fastest in the Round 2 and in 3rd place in the ranking final second only to C++ and C, but it was ahead of languages such as: Perl and Rust.
To install the Vala programming language you can use your operating system’s package manager. Example on Ubuntu:
The letter c at the end refers to the compiler!
Hello, World!
in ValaAfter the Vala compiler is properly installed, you can test Hello, World! with the code below:
Create a file name (example): main.vala
Note that the file extension is
.vala
And include the code below:
To compile, use the valac
command, but it may be that only this compiler is available along with the version on your system, for example: valac-0.56
. So, this would be the command for you to compile:
If your system has another version, type
valac
and then press the TAB key for your terminal’s auto-complete to show the available version.
Automatically it will compile the binary: main
, so to run it just use ./
:
For more information about Vala visit the official website.