Getting startedSlide 1 of 86
1mainGetting started

Hello, World

Grammar: file, echo-stmt
importdeclarationEOF
file = { import | declaration } EOF ;As the compiler reads it; §2.1 of the specification is out of date here.
echoexpression
echo-stmt = "echo" expression ;

Every Hive program starts at proc main(): void, in the file handed to hive run or hive build. main takes nothing and answers with nothing, and any other signature is a compile error: the command line arrives through hive.term.args() and an exit status leaves through hive.term.exit(code), both met later. A file with no main still compiles, as a library or a file of tests.

echo prints one value and a newline; the slide on echo shows how each kind of value is printed. Inside a double-quoted string, {…} puts a value in, so echo "{a} and {b}" prints both. The slide on strings has the rest.

proc main(): void {
	echo "it works"
}