Hello, World
Every language's smallest complete program: name an entry point and print one line to standard output. Watch how much ceremony each one demands — from Perl's and Python's bare one-liners, to Go's explicit package/func main, to guji's typed sub main(): Int whose Int return doubles as the process exit code. Notice too how the string reaches the screen: a statement (print), a function (println!), a method, or a top-level expression.
“Computer language design is just like a stroll in the park. Jurassic Park, that is.” — Larry Wall
sub main(): Int {
$name = "world"
print("hello, $name")
0
}Execution begins at sub main(), which may return Unit or Int — an Int return is the process exit code, so the trailing 0 is the last expression and a clean exit. The $ sigil is part of the binding's name ($name), and double-quoted strings interpolate it directly with $name. print is a prelude builtin that writes the value plus a newline; it is guji's single v0 IO primitive.
package main
import "fmt"
func main() {
fmt.Println("Hello, World")
}A runnable Go program lives in package main and starts at func main(), which takes no arguments and returns nothing. Printing is not a keyword but a call into the standard library's fmt package, so the import "fmt" is mandatory — an unused import is a compile error. Println adds the trailing newline.
let () = print_endline "Hello, World"OCaml has no dedicated main: top-level let bindings execute in order, so let () = ... runs an expression for its side effect and asserts it has type unit. print_endline writes a string followed by a newline, and is part of the always-available Stdlib, so no open is needed.
use strict;
use warnings;
print "Hello, World\n";Perl has no entry-point function: statements at file scope run top to bottom. print is a builtin list operator, and the \n is explicit because print adds no newline of its own. The use strict; use warnings; pragmas are idiomatic boilerplate that catch typos and unsafe constructs at compile time.
say "Hello, World";Raku (formerly Perl 6) ships say, which prints its argument and a trailing newline, so the program is a single statement. Like Perl, it needs no explicit main for a script — though Raku will call a sub MAIN if you define one, wiring command-line arguments to its signature. strict and warnings are on by default.
fn main() {
println!("Hello, World");
}A Rust binary starts at fn main(), which returns () by default. Printing uses println!, a macro (note the !) rather than a function, so the format string is checked at compile time and the trailing newline is implicit. No imports are needed because println! lives in the always-imported prelude.
print("Hello, World")Python runs a module top to bottom with no required entry point, so a one-line script is a complete program. print is a builtin function (since Python 3) that adds a newline automatically. The common if __name__ == "__main__": guard only matters when a file is meant to be both imported and run directly.