Vala (programming language)
Paradigm | Multi-paradigm: imperative, structured, object-oriented |
---|---|
Developer | Jürg Billeter, Raffaele Sandrini |
First appeared | 2006 |
Stable release | 0.11.2[1]
/ November 8, 2010 |
Typing discipline | static, strong |
OS | cross-platform all supported by GLib |
License | LGPL 2.1+ |
Filename extensions | .vala, .vapi, .gir, .c |
Website | live |
Dialects | |
Vala, Genie | |
Influenced by | |
C, C++, C#, [D (programming language) |
Vala is a programming language created with the goal of bringing modern language features to C, with no added runtime needs and with little overhead, by targeting the GObject object system. It is being developed by Jürg Billeter and Raffaele Sandrini. The syntax borrows heavily from C#. Rather than being compiled directly to assembler or to another intermediate language, Vala is compiled to C which is then compiled with a platform's standard C compiler.
For memory management, the GObject system provides reference counting. In C, a programmer must manually manage adding and removing references, but in Vala, managing such reference counts is automated, if a programmer uses the language's built-in reference types rather than plain pointers.
Using functionality from native code libraries requires writing vapi files, defining the library interfacing. Vapi files are provided for a large portion of the GNOME platform, including GTK+.
Code example
A simple "Hello World" program:
void main () {
print ("Hello World\n");
}
A more complex version, showing some of Vala's object-oriented features:
class Sample : Object {
void greeting () {
stdout.printf ("Hello World\n");
}
static void main (string[] args) {
var sample = new Sample ();
sample.greeting();
}
}
References
- ^ "Vala Releases". 2010-11-08. Retrieved 2010-11-08.
See also
- Genie
- MonoDevelop: a GNOME programming IDE with support for Vala
- Shotwell An image organiser written in Vala
External links
- Official website, on GNOME Live!
- LibGee, a collection library for vala.
- Benchmark of Vala versus C# and C
- Val(a)IDE, an IDE for Vala
- Vala Toys for Gedit, a plugin for Gedit that adds support of autocompletion and more, to program with Vala.
- Video of Jürg Billeter talking about Vala at the Gran Canaria Desktop Summit in the summer of 2009.
- API Documentation
- Vala tutorials project on launchpad.net, a place for people who like to share their experiments with newbie Vala developers