Some cool stuff’s going on

Although I’m one of those guys who’d like to see all platform code to be run by a jitter that can support all the programming languages, platforms and devices that we use today and in future, I got a very nice second introduction to Vala at GUADEC.

The nice thing about Vala is that it gives you a programming language that looks and feels like C# and D (generics, interfaces, properties, classes, delegates and all that in a syntax that looks almost exactly like C#), yet it’s completely compatible with GObject and GTypeInterface. That’s because the Vala compiler behind your back first compiles to a GTypeInterface or GObject before passing it to your normal C compiler.

Which sure sounds scary. Though … if you think about it for longer than a few seconds, it’s absolutely not a very bad idea at all. Especially not when it comes to integrating with existing GObject infrastructure. When it comes to having a nice higher programming language where your software’s release tarballs need nothing more than a C compiler and glib with gobject.

Vala is smart enough to also do this right, to generate clean GObject code and to allow inheritance and implementing from existing GObjects and GTypeInterfaces. It manages to get generics and reference counting to be just right (reference counting is done using smartpointer likes. It’s done for you automatically, so there’s no funky C++ syntax involved. You also have weak references to avoid embraced references).

The author is also working on automatic language binding generation to programming languages like Python and .NET. This is more easy with a Vala programmed piece of library because the Vala compiler knows from the Vala syntax that the developer did everything in a certain way (and not in one of the ten million ways that the C programming language allowed him to work).

On top of that is Rob Taylor working on his stuff to parse the C tree of a piece of C header code to an XML file. For this XML is useful because on that resulting XML we can apply XSL stylesheets. For example one that formats it into something that we can embed into the shared object file of a GObject library, to add introspection data. Or another XSL to aid a tool like gtk-doc to create an indexable API documentation database, HTML or whatever file that can then be used to be put online or to be used in tools like Devhelp or for code completion in an IDE like Anjuta.

But also something that can be utilized to fully automatically generate completely correct language bindings. On dynamic or so called “always late binding” programming languages, like Python and PHP, it could even do this at runtime. With type safe programming languages it could at compile time use this new and extra information to without any real help from a human developer, create a completely correct language binding.