This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Vala - Documentation

Documentation Website

GNOME Wiki is being retired. Vala documentation resources are available at: docs.vala.dev

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

Vala Reference Manual

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.

Contributions to the Vala reference manual are always welcome. To add content, fix some typos or more, go to the GitLab repository. The reference manual source code is in doc/manual.

Genie

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

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.

Other Resources

Places to discuss and ask questions

Recommended:

Other:

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

  1. Work-stealing and managed blocking task scheduling: Similar behavior to Go scheduler

  2. Functional programming for data processing with parallel execution support: An equivalent to Java's streams (map, flat map, order by, filter, fold ...)

  3. Futures and promises

  4. Task scheduling - WIP

  5. Parallel sorting

  6. Fork-join parallelism

Other features

Compose Library

Compose is a Functional templating for Vala.

Features

GUI Programming

Multimedia and Graphics

GNOME Platform

GLib Samples

Database Access

Other

Projects Developed in Vala

Vala Specific

By Daniel Espinosa

GTK Specific

Applications / Applets / Other Projects

elementary

Discontinued Projects(> 6 years)

Companies that use/have used Vala


2024-10-23 11:37