Sunday, August 28, 2011

Vereinfachte Ausgangsschrift - A couple of code lines.

Indien: Kochi

To get started with vala you need the vala-to-c-compiler valac, common development tools and libraries.
Detailed instructions about the needed build tools can be found at the GNOME Development Tools page. And the most recent vala compiler can be obtained from the official vala page. Vala is packaged for all major distributions, e.g it can be installed on Fedora using yum:

$ sudo yum install vala

If all requirements are met, put the lines below into a file named printargs.vala:

void main (string[] args)
  foreach (var arg in args)
    print ("Argument: %s\n", arg);

As we have got some code now, we need to compile it using valac, the compiler which compiles vala to c and subsequently calls a c-compiler to build an executable.

$ valac printargs.vala
$ ./printargs some arguments
Argument: ./printargs
Argument: some
Argument: arguments

If you wonder what C-Code valac generated, call valac with the following switches:

$ valac --save-temps printargs.vala
$ cat printargs.c

Friday, August 26, 2011

Wenn es sich bezieht - Progress on OpenStack in Fedora

Lately Mark McLoughlin made some great progress in packaging several OpenStack components for Fedora. Because of his work, all important OpenStack components (Nova, Swift, Glance) will land in Fedora 16.

Friday, August 19, 2011

Lose Enden - What it is all about.

Indien: Kochi

The release of GNOME 3 included more than a visual overhaul. The underlying libraries were partly cleaned up and gained new features.

One of these features that gained more ground was gobject introspection (gi). Libraries using GObject can then easily be called from languages like python or Javascript if the support introspection.

This is where vala jumps in. Vala is language which tries to support the C# syntax but uses GObject and compiles to C, which then is compiled into binaries using common C compilers.

So what is the benefit? As all executables and libraries created by vala or based on GObject, their functions and classes etc. can be called natively from gjs (a JavaScript interpreter) and python (using pygi)
Also most GNOME related libraries are build using GObject.

This leads us to the situation where you can use a scripting language and have access to a comprehensive stack of libraries regarding the GNOME desktop environment.
  • Rapid development? JavaScript.
  • Layout? Glade.
  • Style? CSS.
  • Library? Vala.
It's not just theory. Look at gnome-shell or gnome-documents.