Search code examples
gnomevalagenie

Relationship Between Vala and Genie


From what I have read, core Gnome development began with C and this was extended by Vala (2006) and Genie (2008). Vala syntax appears to have been aimed at the Java/C# syntax/developer, whereas Genie appears to be aimed at Python (and a handful of others).

There are also certain developers who appear to be attempting to scuttle these two great development tools - by pushing for a move to, for lack of a better term, non-native technologies like Javascript and Rust - requiring additional virtual machines or runtime binaries.

Yet there appears to be a resurgence in Vala primarily driven by the applications developers. This is clear from the rise in activity on the Vala compiler and the proposed activities of the 2018 Outreach Program where Vala is a core feature.

So this brings us to the technical relationship to Genie. From my reading, Genie only depends upon GLib whereas Vala depends upon the Gnome desktop environment. Is this relationship correct? Secondly, is Genie built into the Vala compiler valac or is it separate? From a compilation perspective, are they integrated technologies?


Solution

  • Genie is an alternative syntax for the Vala compiler. It is implemented as an alternative lexer and parser and is built in to libvala. valac is the command line front end to libvala. So yes, they are integrated technologies. If you wish to learn more about how Genie is implemented then have a read of Developing Genie. There are links on that page to the Genie source files.

    Genie has the same dependencies as Vala and Vala only depends on GLib. There have also been some attempts to even remove the dependency on GLib. For example posixvala and avr-vala.

    Vala has very good bindings to GTK+ that are kept in sync with GTK+ development. Maybe that is why you thought Vala was dependent on the full GNOME stack. Vala does provide higher level code generation routines such as casting to GVariant; the [GtkTemplate], [GtkChild] and [GtkCallback] attributes for working with GtkBuilder UI templates; the use of the [DBus] attribute for generating D-Bus interfaces and the use of the async and yield keywords for working with GIO asynchronous callbacks and callbacks in general. By 'Vala' I mean the Vala compiler, rather than the syntax. So these features are available to both the Vala and Genie syntaxes. Genie is slightly less developed in some parts, but this can be fixed by contributors. It is an Open Source/Free Software project.