Skip to main content

Run the first program

If you've already installed Wave in the previous installation document, let's run the first program now!

Create hello.wave file.

First, create a new file named hello.wave.

Write the code

Write the following code in hello.wave file:

fun main() {
println("Hello Wave");
}

Here, fun main() indicates the starting point of the program, and the println function outputs the text to the screen.

Run the program

Now let's run the Wave program. Open the terminal and enter the following command:

wavec run hello.wave

Check the output

When you run the program, the following output will appear:

Hello Wave

Now you can check that Wave is installed and working correctly. Congratulations! You have successfully run your first program.