Hello, world!

No programming language guide would be complete without a “Hello, world!” example.

Code in Calypso is organized in “statements”. These are complete lines of code ending with a semicolon. To print text to the console, you call the function println with the string of text you would like to print. To do this, you type the name of the function, followed by an opening parentheses, then the arguments (in this case, a string of text), then a closing parentheses. Enough talk, let’s get to the code!

Open the REPL and run this:

println("Hello, world!")

Calypso requires you to define a main function when you’re not running a program in the REPL. This function will always be executed at the beginning of the program. You can define a main function like this:

fn main() ->
    println("Hello, world!")
end