Test the Vala language / Engineering on Raspberry Pi

Languages are many on Raspberry Pi. Elders like C passing through the modern (Python ?) or heavy like Java, the choice is wide ! New supported The Gnome Project, Genie just settle on our Raspberry. On the official page Genie you will find the basis for use of this language. But let's start by installing what is for the language :

Update of the system

apt-get update && apt-get -y upgrade

Install the compiler VALA who supports the engineering language. Will also need you the compiler GCC.

apt-get install gcc valac-0.16

You can now create your first program : Hello World ! (Lui est vraiment universel 😉 )

init
print "Hello World"

You start compiling with the command valac.

Remains to launch the generated program : hello.

Then everything is nice but what is the point of this language ?

I'll give you the list (partial) its benefits :

Ease of programming. The code is similar to the Python (with a bit of Boo, Delphi or encode the D). So easy to understand !

Performance. There where the high-level languages use a process for interpretation (via pre compilation or not), Engineering-generated code is c with excellent performance in execution.

The possibility of using objects of type GObject. It comes (in the outline) equivalent to objective-C for Apple. Ultra practice to mount a portable graphical interface in a few lines. Only libc and Glib are needed.

Lightweight executables. The Hello World classic is 2.9 Kb and the same GTK is less than 6 Kb.

Liaison with libraries systems directly from engineering. Not of overlay like in Python for the binding example.

You this is so with a LED which flashes through a program that is less than 6 kb and without having to go through the more complex coding of C. You can integrate it easily into a GTK interface for example.

PI Home Server uses cookies with pieces of raspberries to guarantee you the best experience in the world nothing that. If you continue to come here (I hope), vous acceptez l'utilisation des cookies.OK I want !