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 first need to include the terminal module which provides console I/O.

include "lang/terminal.vel";

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

str hello = "Hello, World!";

The term object (created by the terminal module) 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!