Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.
The classic "Hello, world" example in Vala:
using GLib; public class Sample : Object { public Sample () { } public void run () { stdout.printf ("Hello, world!\n"); } static int main (string[] args) { var sample = new Sample (); sample.run (); return 0; } }
Store the code in a file whose name ends in ".vala", such as hello.vala
, and compile it with the command:
valac -o hello hello.vala
This will produce an executable file called hello
.