Commissioned for this museum · after the language first released by Graydon Hoare, 2010

hello, world

Rust·2010·3 lines·43 bytes

Curator’s note

Three lines, and the interesting character is the exclamation mark.

println! is not a function. The ! marks a macro, and it is a macro rather than a function because Rust checks format strings at compile time: give it a placeholder with no argument to fill it and the program does not build. A function could not do that, because by the time an ordinary function runs, the format string is just a string. The punctuation is the language admitting that this thing works differently from everything around it — which is more honesty than most languages offer about their printf.

For a language with a reputation for difficulty, note what is absent. No lifetimes, no borrows, no unsafe, no types written down at all. The machinery Rust is famous for is machinery you meet when you need it, and the first program does not need it.

This is also the only work in the hall whose language could not be collected, only commissioned. Rust is dual-licensed MIT or Apache-2.0, and this museum excludes anything Apache touches — so the greeting on the wall had to be written here rather than taken from the source tree. The licence attaches to the artifact, never to the language it is written in.