Vala Logo

Vala Programming Language

Vala language is a programming language using modern high level abstractions without imposing additional runtime requirements and without using a different ABI compared to applications and libraries written in C. The Vala language uses the GObject type system and has additional code generation routines that make targeting the GNOME stack simple. Vala has many other uses where native binaries are required. Vala programming language is designed to allow access to existing C libraries, especially GObject-based libraries, without the need for runtime bindings. All that is needed to use a library with Vala language is an API file, containing the class and method declarations in Vala syntax. Vala currently comes with bindings for GLib and GTK+ and many others from the GNOME Platform. Speaking about the concept and syntax Vala is close related with Swift and C# but it implements a bit different flavour specific for Linux and Unix platforms.

License: LGPL v2.1 (OpenSource)

Documentation: valadoc.org

Download Vala: Source Code

Current (stable) version: 0.56.x

Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system.
Vala is syntactically similar to C# and includes notable features such as anonymous functions, signals, properties, generics, assisted memory management, exception handling, type inference, and foreach statements.
Sample Code (Vala Syntax)
// vala language: valac --pkg gtk+-3.0 sample.vala

public string helloWorld(bool runTest) {

    string myString1 = "Hello";
    string myString2 = "World";

    int myNumber = 1;

    bool myTest = !! runTest; // cast to the same type (bool)

    string myOutput = "Test was disabled ...";
    if(myTest == true) {
        myOutput = myString1 + " " + myString2 + ", this is number: " + myNumber.to_string();
    }

    return myOutput;

}

public class MyApplication : Gtk.Application {

    protected override void activate() {

        string testResult = helloWorld(true);

        stdout.printf(testResult + "\n"); // print to console

        var window = new Gtk.ApplicationWindow(this); // create new window
        window.set_title("Vala Sample"); // add window title
        window.set_default_size(500, 200); // set default window size(width and height)
        var label = new Gtk.Label(testResult); // create a label
        window.add(label); // add a label to the window
        window.show_all(); // display the window

    }

}

public int main(string[] args) {

    return new MyApplication().run(args);

}

// end vala language