Getting startedSlide 1 of 86
1mainGetting started
Hello, World
Grammar: file, echo-stmt
file = { import | declaration } EOF ;As the compiler reads it; §2.1 of the specification is out of date here.
echo-stmtSpecification §2.5
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"
}You can edit this program and run it here.Tab indents, Escape leaves the program, and Ctrl+Enter runs it.
Output
Run a program to see what it prints here.