September 3rd, 2007

  • evan

vala: gobject-specific language

Vala looks like a C sugar layer that uses the GObject object model along with C# syntax. I totally worked on something like this for a while! Gnome apps use a stylized version of C involving tons of macros to hack in language features like inheritance, signals, and interfaces; it's always been a pain but was considered necessary to let other languages bind in at a "low enough" level. And Glib covers roughly the domain of the STL as well as a huge amount of cross-platform portability code, so it almost feels like it belongs at the "native library" level of a language. My (and surely their) thinking was: if you just sugar up the syntax you (hopefully) end up with the same programs but with much less pain and free support/compatibility from all the existing C libraries.

Another interesting aspect of this is that the semantics are more or less fixed by C and GObject, giving them less rope to hang themselves with. Programmers love to create languages but they usually do it at the syntax level and neglect the semantics, so you often end up with these obscure features meant to address a particular itch without consideration to how it fits in to the rest of the language. Unfortunately there are some corners where they are trying to improve, like in memory management, and this document on reference handling doesn't give me a lot of confidence...