DEV Community

mirko
mirko

Posted on • Originally published at owlcode.eu

My first experience with Vala

This article is a short resume of my first experience with Vala.

What is Vala

Vala is an object-oriented programming language with a syntax very similar to C#.
The compiler could produce a native binary or generate C code.

The current version is 0.56, meanwhile I used the 0.54.1.

The language was born in 2006 and although it hasn't reach the version 1.0 it's used in a lot of GNOME applications and it's the main choice for implementing application in Elementary OS.

Why Vala

I'm interested in the creation of GTK applications for Linux.
The possibilities I found to reach this goal are:

  • Use C, but I used it only for an exam in my first university years. I was afraid to not reach a concrete result in a short time.
  • Use Python, probably the simple solution, but I was interested in creating a native application.
  • Use Go, but my perception was that the GTK libraries for Go were immature and incomplete.
  • Use Rust, but I was intimidated by the steep learning curve.

So I decided to explore Vala because:

  • it's a language created by the GNOME Foundation with the scope to permit the implementation of native GNOME (so GTK) application at a high level.
  • it's well integrated with GTK libraries so it permits to be immediately operative.

First impressions

Some considerations after this short experience.

I have to admit that it has been not so easy to reach my goal. I think that a lot of problems and slowness has been caused by my inexperience in developing desktop applications in general.

The official Vala documentation is valadoc.org.
I found the ecosystem of libraries around the language still immature: it's not easy to found information or examples (and often when you find something it's pretty old). There isn't a standardization of the documentation of the libraries. This fact doesn't help a newbie.

Looking some examples implemented in Python, it helped me a lot to understand how to use notifications and how to implement an indicator (the main part of my little experiment).

In the next future I'm going to try again to implement other simple applications using Vala.

Pommy

Pommy is a simple timer to measure an activity duration. It's an indicator staying in the notification bar and it notifies you the end of the activity session.

It takes inspirations from gtk-pomo-indicator, a Python application I used for years to break my daily routine into work sessions, following some concepts from the pomodoro tecnique.

Pommy is released under GPLv3 and it is available here.

Top comments (2)

Collapse
 
alexmario74 profile image
Mario Santini

How about using electronjs or tauri?

As you know web development, it should be a fast and easy solution, as it is based on Javascript, HTML and CSS.

They can be slow compared to GTK app, but they can be just enough for most of the use cases.

Collapse
 
mirkoperillo profile image
mirko

Because I was interested in staying minimal (in term of resources) and in the possibility to be more integrated as possible with the desktop environments I use more (Mate and Xfce)