The simplest Thorn program, walked through in detail.
Create hello.th:
write("hello world")
Compile and run:
thorn build hello.th ./hello
Output: hello world
write() prints any value to standard output. No semicolons. No required main() for simple scripts.
For larger programs, use section main:
section main {
task run() {
write("hello world")
}
}
if (start) {
main()
}
start is on when run directly, off when imported.
Copyright ©2026 Thorn Language Project. All Rights Reserved