LockerGnomeTech news and nostalgia for today's technology professionals
Subscribe

Search

Retro

The earliest “Hello, world” its creators remembered was written for C’s predecessor, B

Dennis Ritchie’s archive keeps an important qualifier attached to a programming origin story that usually loses it.

Chris as a blueline print, feeding punched paper tape into a mainframe teletype
Illustration: LockerGnome

The greeting has an earlier address than many programmers expect. Dennis Ritchie’s archive points to a B-language tutorial, preserved inside a Bell Labs report, as the first Hello, world program he and Brian Kernighan remembered.

The archive’s introduction carries the qualifier: “so far as Brian and I can remember.” That makes this a documented recollection, not a certificate proving nobody anywhere printed those words earlier. A tiny sample program has enough fame without upgrading its paperwork.

Ritchie’s page identifies the report as The Programming Language B, January 1973, and explains that he edited the scanned text for the web in 1997. The report combines a tutorial by Kernighan with a reference by Steve Johnson. The preserved setting is the Honeywell 6070 time-sharing system at Bell Labs.

The tutorial itself is aimed at people already familiar with files, editing and programming in another language. Its early examples teach program structure, variables and output before moving into the rest of the language. The welcome mat assumes you can already find the building.

That context changes how the famous greeting reads. Printing a little text gives the learner a visible result while several invisible things have to cooperate: the source exists, compilation works, the program runs and output reaches the terminal. It is a small demonstration with a surprisingly large support staff.

A modern tutorial that starts by installing half a toolchain before revealing any result can lose that advantage. The useful first success has a narrow question to answer: can this environment execute a program and show its output? The hello is a receipt, with far fewer line items than a production system.

The archive also warns that the HTML comes from OCR and points scholars toward page images to check possible transcription mistakes. That is an unusually helpful caveat in an origin story. A punctuation mark in a program is executable information, and scanning can turn a minor visual error into an entirely different example.

Someone comparing the historical program with a modern translation should therefore keep the layers separate. The old source demonstrates the language and environment documented there. A current implementation may preserve the greeting while using a different compiler, character representation or runtime. Familiar output does not make those programs identical twins.

Ritchie’s introduction adds that C had already taken over B’s role in early Unix by the period he describes. The report preserves a language at a transition, while the beginner’s greeting survives beyond the machinery that first carried it. That is a useful reminder that teaching conventions can outlive the systems they introduce.

Future histories will probably keep shortening the anecdote because the short version fits on a slide. The primary page gives a better version: a dated report, named participants, an actual tutorial and a stated limit on memory. The remaining uncertainty is recorded in the sentence people are most tempted to omit.

B said hello first. Probably.

More Retro

Every Retro story →