Skip to content

Using the Vala Programming Language in Embedded Systems

Recently I’ve been following the Vala programming language and using it some in embedded systems.  Vala is a new programming language that aims to bring modern programming features to GNOME developers without imposing additional runtime requirements and without using a different ABI compared to applications and libraries written in C.  A few notes and observations about Vala:

  • language syntax that resembles C#, so you can write code faster with less mistakes
  • Vala compiles to C, so it starts fast and runs fast like native applications
  • binaries are not platform independent  (like Mono or Java)
  • lots of bindings already exist, as it is very easy to write bindings to existing C libraries
  • easy to write programs that are mixed C and Vala
  • documentation is still a bit sparse, so you end up reading the binding files to figure out how to use the libraries

Much of the core Vala functionality is built on top of Glib.  Having programmed extensively with Glib, I can say programming in Vala is a lot more fun, and a lot less tedious.  Vala also provides dynamic D-Bus bindings which makes if very nice for writing system daemons or other bits of software that need to implement a D-Bus server.

As far as real world experience, in a recent application, we ported a system monitoring application from C# to Vala.  There were no real serious problems with the original application, but it started slow (7 seconds or so), and the customer wanted to reduce the boot time of the system.  Once you get past the core language syntax, the libraries for Vala are all different than C#, so most of the library function calls needed tweaked a little.  Most of the functionality was implemented with Vala, but there were a few minor functions that were implemented in C.  It now starts fast, which is what we needed.

We are also using the fsod application from the OpenMoko project in a customer project.  This is an excellent example of a well written, advanced Vala project that uses features such as plugins and D-Bus.

Watching the releases from the Vala project, it is amazing the progress this language is making.  I’m sure we’ll be hearing more about Vala in the future.