Hello, Blorp
Start with the program entry point, a line of output, and the run command.
Main
A runnable file defines main as the entry point. args is a List[String] containing command-line arguments.
entry.brp
func main(args: List[String]) -> Void:
print("ready")Printing
print writes a trailing newline. puts writes without adding one, and eprintln writes to stderr.
output.brp
print("one line")
puts("prompt> ")
eprintln("warning")Running A File
Use blorp run file.brp to compile and run one source file.
terminal
blorp run hello.brpExit Codes
A main returning Void exits successfully and returns an exit code of 0. A main returning Int uses the final Int expression as the process exit code.
exit.brp
func main(args: List[String]) -> Int:
print("ok")
0Example
hello.brp
func main(args: List[String]) -> Void:
print("Hello, world!")
Exit-code Version
hello-exit.brp
func main(args: List[String]) -> Int:
print("Hello, world!")
0
Try It
terminal
blorp run hello.brp