Hello, World!

#hello-world#c#bernoulli-numbers-algorithm#ada-lovelace#charles-babbage

The program that every programmer knows, and has most likely written at least once. But where does it come from and why is it so common and well known? In this article we will take a deep dive at the first program that was ever written and how it leads to the first appearance of Hello, World! We will see how many languages implement it and why is it being used today.

Ada's Note G

First ever program written

Hello, World! was not the first program ever written, neither it was the last one. But what exactly was the first program ever written, for what kind of computer was it written, and how long ago was that? The answer to this question can be twofold: what is the first (theoretical) program and what is the first executed.

First theoretical program

Back in 1843, roughly 100 years before the first appearance of Hello, World!, an English mathematician, Ada Lovelace, published her notes on the Babbage’s seminar about his own Analytical Engine. Out of those notes, the Note G, one is considered as the first algorithm tailored for implementation on computer. The Note G described a method for calculating the sequence of Bernoulli numbers. Unfortunately, Charles Babbage never completed this work on the Analytical Engine and the first program ever written was never run. Regardless, many consider Ada Lovelace as the first computer programmer for her contribution.

First executed program

While Ada’s algorithm for calculating the sequence of Bernoulli numbers never came to fruition, the program written by Tony Kilburn did. He wrote a program that calculated the highest proper factor of 2^18. It achieved that by trying every integer from 2^18-1 downward. The Manchester Baby, the first electronic stored-program computer, ran this program and completed 2.5 million operations in 52 minutes of execution. This was the first program that was stored in electric memory and executed by a computer.

Hello, World! in italic

Origin of Hello, World!

Many know Hello, World! from The C Programming Language book, however this is not its first appearance. A predecessor to Hello, World! program was written in B programming language and it appeared first in A Tutorial Introduction to the Language B.

B programming language

Ken Thompson and Dennis Ritchie (remember that name!) developed B programming language back in 1969 at Bell Labs. This language laid the groundwork for C. Its design had great influence on later languages and it represents a critical milestone in computer history as it bridges BCPL and modern programming languages.

The very first Hello, World! program

In 1972, three years after B programming language release, Dennis Ritchie wrote A Tutorial Introduction To The Language B. Here Hello, World! program makes its first appearance. The program is not as straightforward as its C version. It is used to describe the use of external variables - variables that are available to all functions. “hello, world” string is then output to console by printing each variable separately.


main( ) {

 extrn a, b, c;

 putchar(a); putchar(b); putchar(c); putchar(’!*n’);

}

a ’hell’;

b ’o, w’;

c ’orld’;

Brian Kernighan and Dennis Ritchie

First appearance in its current form

Shortly after A Tutorial Introduction To The Language B’s release, Dennis Ritchie developed B’s successor - C programming language. The C programming language saw its release in 1972, three years after its predecessor. But Hello, World! hasn’t evolved in its known form we all know today.

The C Programming Language

In 1978, 6 years after C’s initial release, Dennis Ritchie partnered up with to author The C Programming Language. The first edition of this book introduced C programming language as used in early Unix systems, while the second edition adopted the ANSI C standard, formalizing modern C syntax and features.

Hello, World!

The C Programming Language not only introduces us to the C language, but it also gave us the very first Hello, World! program. It was the first program example in this book, and its purpose was a quick introduction to C and its compile process.


#include <stdio.h>

main() {

    printf(“Hello, World!\n”);

}

Where is it used

Hello, World! is (almost) everybody’s first program - including myself! Despite being introduced in its most known form almost 50 years ago, it remains relevant. Throughout the years, almost every other programming language adopted it. But why is it so commonly used?

Simplicity

Hello, World! offers a great introduction to core syntax while not being overwhelming, mainly because of its simplicity. It shows a basic program structure that is a minimal requirement for creating a new program. This is a great starting point towards learning a new language and building knowledge upon that.

Universality

Hello, World! is a simple program, which makes easy to implement in other programming language. It uses constructs that are supported by almost every other programming language. This makes it a good to not only for beginners, but even for experienced developers that are learning a new language as it provides quick feedback to many quirks and features of new programming language.

Legacy

Why? Because legacy! Hello, World! program became popular because of its appearance in The C Programing Language, making many educators use it as a good introduction to programming. Nowadays, this tradition still keeps going strong.

Implementations in other languages

There are over 8000 programming languages out there. Of those, only about 100 are in active use. While we are already familiar with B and C programming languages, there are a few more examples of “Hello, World!” programs in other, a bit more bizarre, languages.

ArnoldC

ArnoldC programming language is a language that uses for keywords one-liners spoken by Arnold Schwarzenegger. There are 32 keywords that are references in Arnold’s movies, such as The Terminator, Predator, and Total Recall.


IT’S SHOWTIME

TALK TO THE HAND “Hello World”

YOU HAVE BEEN TERMINATED

Chef

Chef programming language resembles a cooking recipe. Each program is called a recipe. Recipes should be easy to prepare and delicious. These recipes may appeal to cooks with different budgets, and should use metric units, although some imperial units may be acceptable.


Hello World Souffle.

This recipe prints the immortal words “Hello world!”, in a basically brute force

way. It also makes a lot of food for one person.

Ingredients.

72 g haricot beans

101 eggs

108 g lard

111 cups oil

32 zucchinis

119 ml water

114 g red salmon

100 g dijon mustard

33 potatoes

Method.

Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl. Put

lard into the mixing bowl. Put red salmon into the mixing bowl. Put oil into

the mixing bowl. Put water into the mixing bowl. Put zucchinis into the mixing

bowl. Put oil into the mixing bowl. Put lard into the mixing bowl. Put lard

into the mixing bowl. Put eggs into the mixing bowl. Put haricot beans into

the mixing bowl. Liquefy contents of the mixing bowl. Pour contents of the

mixing bowl into the baking dish.

Serves 1.

Malbolge

Malbolge programming language is a language designed to be almost impossible to use. Named after the eighth level in Dante’s inferno, it offers a counter-intuitive “crazy operation”, base-three arithmetic, and self-altering code.


(=<`$9]7<5YXz7wT.3,+O/o’K%$H”‘~D|#z@b=`{^Lx8%$Xmrkpohm-kNi;gsedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543s+O<oLm

INTERCAL

INTERCAL programming language’s name is an abbreviation for “Compiler Language With No Pronounceable Acronym”. Authors created INTERCAL with the goal of not sharing any similarity to other programming languages. They intentionally designed it to be difficult to use and understand, similar to Malbolge.


DO ,1 <- #13

PLEASE DO ,1 SUB #1 <- #234

DO ,1 SUB #2 <- #112

DO ,1 SUB #3 <- #112

DO ,1 SUB #4 <- #0

DO ,1 SUB #5 <- #64

DO ,1 SUB #6 <- #194

DO ,1 SUB #7 <- #48

PLEASE DO ,1 SUB #8 <- #22

DO ,1 SUB #9 <- #248

DO ,1 SUB #10 <- #168

DO ,1 SUB #11 <- #24

DO ,1 SUB #12 <- #16

DO ,1 SUB #13 <- #214

PLEASE READ OUT ,1

PLEASE GIVE UP

LOLCODE

LOLCODE programming language takes inspiration from lolcat internet meme. It closely resembles the kitty pidgin natlang of the lolcat phenomenon.


HAI 1.2

CAN HAS STDIO?

VISIBLE “HAI WORLD!!!1!”

KTHXBYE

🏁 Final Thoughts

Hello, World! has made an impact few other programs made. Since its first appearance over 50 years ago, it is still relevant and widely used in education. Brian Kernighan originally implemented it in the C programming language, and included it in The C Programming Language, establishing its legendary status. There has not been a program that simple and yet so impactful like Hello, World!

2025-05-19