Velo by Example: Hello World

Our first program will print the classic "Hello, World!" message. Here's the full source code.

To print output, we create a Terminal — a native class, so no include is needed.

Terminal term = new Terminal();

We declare a variable hello with type str and assign it a string value.

str hello = "Hello, World!";

The term object provides print and println methods for output.

term.println(hello);

To run the program, save it as hello.vel and use Gradle.

$ ./gradlew run --args="hello.vel"
Hello, World!