I started learning the Vala programming language when I moved to GitHub, late into 2020. As of 2021 November 23rd, I don't know too much about the language. This document will go over my knowledge of the Vala programming language so far.
Comments in Vala are similar to languages like C, C++, Java, CSS, etc.
// This is a single line comment
/* This is also a single line comment */
/* This is
a multi-
line com-
ment */
This is a simple Hello World program in Vala:
void main() {
print ("Hello World\n");
}
Integers in Vala are standard and similar to most programming languages:
int x = 1;
Vala supports the float
keyword. It stores a decimal value. I have not tested its bitwise limitation yet (if it can handle 2^64)
float pi = 3.14;
Vala supports the string
keyword.
string str = ("Stringy string");
Vala supports the double
keyword (double precision floating point), similarly to how the C programming language handles it.
double trouble = 2
I don't know how to work this yet.
/!\ This example has not been tested yet, and may not work
Vala supports classes.
class valaClass() {
void main() {
print("Vala Class returns true");
}
}
/!\ This example has not been tested yet, and may not work
Vala supports the return
statement.
int value1 = 2;
return value1();
/!\ This example has not been tested yet, and may not work
break;
To this day, I am still not entirely sure what the break
keyword does, but most languages support it.
/!\ This example has not been tested yet, and may not work
-
Vala is a semicolon and curly bracket language
-
Vala uses 2 file extensions:
*.vala
or*.vapi
-
Vala is developed by the GNOME Foundation
-
I am not sure whether Vala works well outside of Linux/GNOME
-
No other knowledge of the Vala programming language