Hello, world!
The shortest complete Pluvial program prints a greeting and exits:
println("Hello, world!")Run it with the compiler:
pluvial hello.plu# => Hello, world!The pieces
Section titled “The pieces”#starts a line comment.println(x)writesxto standard output followed by a newline. It accepts any value type (int,float,bool,string,array<T>,Result<T>,T?— the same set understood byprint(x)).print(x)is the same, without the trailing newline. Use it to assemble a line in pieces.- Statements end at the end of the line. Pluvial does not use a statement terminator.
A bare expression is not displayed by default. The previous “evaluate-and-print” behavior was removed; output is always explicit via print or println.
Trying it in the REPL
Section titled “Trying it in the REPL”Run pluvial with no arguments to start an interactive session:
$ pluvialPluvial REPL — type 'exit' to quit> 1 + 23> "hello".to_upper()HELLO> int x = 5> x + 16> def double(int n) int { return n * 2 }> double(7)14> exit$The REPL keeps one VM instance for the whole session. Globals, functions, and struct definitions persist across lines; the value stack and call frames are reset between lines.
In REPL mode (and only in REPL mode), a bare expression is implicitly displayed — typing 1 + 2 prints 3. In file mode the same line evaluates and discards the result.
You can re-declare and re-type a global at the top level (int x = 5 then string x = "hi" is allowed). Re-defining a def or struct is rejected, the same as in file mode.
A compile error or runtime error keeps the session alive: the error block is shown and the prompt returns. Press Ctrl-D or type exit (or quit) on its own line to end the session.