In foo.vala:
foo.vala
void main (string[] args) { stdout.printf ("Hello world!"); }
To compile the source into the foo binary:
foo
valac foo.vala
To compile and run the source:
vala foo.vala