Language page — context, influences, and learning notes on the 100hellos site.
Source on GitHub (100hellos/vala)
docker run --rm --platform="linux/amd64" 100hellos/vala:latest
Read the repo README, or fork the project and customize it.
For an interactive shell:
docker run --rm --platform="linux/amd64" --entrypoint="" -it 100hellos/vala:latest zsh
Vala is a high-level programming language that brings modern language features to the GNOME ecosystem, compiling to fast native code via C. It offers a clean, C#-like syntax, GObject integration, and powerful features like signals, properties, and type inference—all while producing efficient binaries.
This directory's hello-world.vala demonstrates several Vala features:
// Step 1: The simplest Hello World in Vala
void main () {
print ("Hello World!\n");
}
// Step 2: Using a class and properties
class Greeter : Object {
public string message { get; set; }
public Greeter (string msg) {
this.message = msg;
}
public void greet () {
print ("%s\n", message);
}
}
// Step 3: Using signals (Vala feature)
signal void greeted (string who);
void main_with_features () {
var greeter = new Greeter ("Hello World!");
greeter.greeted.connect ((who) => {
print ("Greeted: %s\n", who);
});
greeter.greet ();
greeter.greeted ("World");
}
// Uncomment to run the feature-rich version
// main_with_features();
print.Greeter class with a property and a constructor, showing OOP in Vala.signal feature, allowing event-driven programming.Vala is a great way to write modern, fast, and maintainable code for the Linux desktop and beyond!
Content type
Image
Digest
sha256:6449720e6…
Size
175.3 MB
Last updated
4 months ago
docker pull 100hellos/vala