examples/gallery/00-first.hero
A minimal program that prints a number, and the first one this compiler ran.
- 8 lines
A file with a main function is a program. This one prints a number and needs no imports, project file or enclosing class.
Run it
These files introduce the language one feature at a time. This page shows the program and not a result, because no test compares their output byte for byte yet.
The program
## First
#
# The smallest program worth compiling — the M-scalars-run acceptance input.
# Its C target, written by hand, was tools/spike/01-first.c (gone since 2026-10-25);
# in M-scalars-run the emitter's output was compared against that file by eye.
function main()
print((2 + 3) * 4)
fingerprint sha256 a205436ed1cf · 1 file · index.json
Next: 01-points. All the examples.
Run one yourself: the four commands. Learn the language, or read the full specification in one file.