Vala - Documentation

Getting Started

Here is a staged approach to get familiar with the Vala compiler, related tools and the Vala language:

The first thing to do is install Vala for your platform and compile a small program to show everything is working.

The second activity is to skim over the Sample Code on this page and choose a topic that interests you. Compile one or more sample programs from that topic area and pay special attention to the use of the --pkg option with valac . This tells the Vala compiler which library binding the program should use. Cross-reference the name of the package with its API documentation at Valadoc.org. Valadoc.org is a great resource for finding bindings to libraries and becoming familiar with a library's API (Application Programming Interface).

The third activity is to get familiar with third party build tools and code editors. If you are unfamiliar with such development tools then a good set of starting options are an up to date version of GNOME Builder for editing Vala code. Then a build tool like Meson or CMake. GNOME Builder can create Meson build files and Autovala can create both Meson and CMake build files. These tools are useful for larger projects.

The fourth activity is to get inspired! Visit some of the Projects Developed in Vala linked to from this page. As a taster visit Akira and BirdFont. These are all GUI (Graphical User Interface) applications using the GTK 3 toolkit. Corebird and Gradio also use special attributes in Vala code to trigger Vala's code generation routines that make using GtkBuilder user interface files a lot easier. In those two projects' source code repositories look for files ending in .ui and the use of [GtkTemplate] , [GtkChild] and [GtkCallback] attributes in Vala code.

The fifth activity is to become familiar with the resources available about the Vala language. The Vala syntax is heavily influenced by C#, but it is better to start looking at the Vala Tutorials available. If concepts like strong typing and objects aren't familiar to you then documentation for C# may help explain the underlying idea, but focus on the concept rather than the C# syntax. The syntax in Vala may be different. The Tutorials linked to on this page cover Vala itself and explanations for those coming from a C# or Java background. Vala also has a Reference Manual available online, for download as a PDF and as a Devhelp package available through distributions.

Vala is a community driven project so the sixth activity is to share your experiences. This helps consolidate your understanding and offer insight to others. Blogs posts and shared code repositories are common ways of doing this.

Tutorials

If you want some tips before start hacking in Vala, take a tutorial and see what you can do with this.

If you find any mistakes in the tutorials on wiki.gnome.org please feel free to correct them.

The Vala Reference Manual

The Vala Reference Manual for the latest Vala release is available from vala-project.org as:

The Vala Reference Manual is also available for your installed version of Vala as DevHelp from your distribution. For Red Hat based distributions, like Fedora, the package is vala-doc . For Debian based distributions, like Ubuntu and elementary OS, the Vala API version is also used in the package name. For example vala-0.40-doc is the documentation package for the Vala 0.40 API.

The manual is a work in progress and we welcome corrections and additions from the user community. The current draft can be found at Vala Reference Manual [Draft].

Genie

Genie is another programming language supported by the Vala compiler with a syntax closer to Python.

Genie programming language

Genie Tutorials, Blogs and Code Examples - a page listing links to numerous tutorials, articles, blogs, code examples and projects

Developing Genie - a useful starting point if you want to improve the Genie scanner and parser, includes communication channels for developers and a detailed guide on downloading and compiling the Vala source code

Bindings

Vala has bindings to over 250 libraries. A good starting place is to read valadoc.org. This site holds bindings' API documentation generated by Vala's valadoc tool. The site is currently hosted by Elementary OS. A desktop focused operating system with apps written in Vala.

List Of Bindings - The list aims to be comprehensive. Bindings are listed by how they are distributed: upstream libraries; Vala; the Vala Extra VAPIs repository and individuals

Generating Bindings - Using GObject introspection to generate a binding

Vala and GObject Introspection - write in Vala and use from Ruby, Python, Lua, JavaScript and other languages!

Writing VAPI files manually - A document that explains how to write VAPI files for a C library manually, without GObject introspection

Other Resources

Places to discuss and ask questions

Sample Code

If you have trouble compiling an example try the latest release of Vala. Some distributions ship with older versions of Vala which may lack some features. Also make sure that the respective libraries are installed along with their header files (e.g. *-devel packages on RedHat/Fedora/SuSE, *-dev packages on Debian/Ubuntu).

Language Features and Introductory Samples

Basics: Collections, Files, I/O, Networking, IPC

Functional programming

Gpseq Library

Other features

Compose Library

Compose is a Functional templating for Vala.

Features

lazy evaluation using callbacks with native environments

it's reusable since nodes can be isolated in functions

it provides minimal compile-time correctness

HTML5 elements support

GUI Programming

Multimedia and Graphics

GNOME Platform

GLib Samples

Database Access

Other

Deprecated Samples (Examples using deprecated libraries such as GNOME 2 panel applets)

Projects Developed in Vala

Vala Specific

By Daniel Espinosa

VDA - Is a set of interfaces to access Data Bases written in Vala. There are a set of classes implementing VDA interfaces using GDA as backend. Allowing to use its features. A native backend is an implementation of VDA interfaces using the C and/or a Vala bindings of a database engine.

GXml - An XML library

GVLS - GNOME Vala Language Server (GNOME Builder(already in)|Elementary Code|Gedit)

GTK Specific

libgtkflow - A universal library for drawing flow graphs with Gtk 3

GTK DnD Order ListBox widget by doublehourglass

GCanvas - A Clutter based canvas written in Vala

gtktester - Library with widgets for Gtk+ widget tests

Caroline - A simple Cairo Chart Library for GTK and Vala



Applications / Applets / Other Projects

Elementary

Sequeler - SQL Client built in Vala

Karim - Graphical interface for command-line tool youtube-dl

Files - File browser designed for elementary OS

App Template - A template for desktop applications written in Vala

VServer - VServer opens an http server in the desired folder

Minder - Mind-mapping application for Elementary OS

Spice-up - Create Simple and Beautiful presentations

FeedReader - Modern desktop application designed to complement existing web-based RSS accounts

Discontinued Projects(> 6 years)

Companies that use/have used Vala