Close

Hello World!

What better words to start a blog about physics than these? Ok, granted, “Hello World!” comes more from computer science. But as a theoretical physicist, I live at the intersection of physics, math, and computer science, and since it fits so nicely, that will have to do.

But not so fast, what does welcoming the world have to do with computer science? “Hello World” is more than just a slightly melodramatic greeting. In my field, there is probably no one who has not at one time or another racked their brains over this. Because the first task for learning any programming language is: Get your program to output the text “Hello World!” on the screen. Sounds simple? Boring? Useless? Every programming novice would probably disagree here! I still remember my first task at the lecture about the programming language C++: Program “Hello World!”. Sounds simple, but simple it is not. This was my first contact with programming at that time and it all still seemed like magic to me. I stared at the keyboard and didn’t know where to start. At some point, one of my fellow students took pity on me and helped me. “You have to start the program with #include <iostream> and then add this and that here…”. The final solution was:

using namespace std;
int main()
{
cout << “Hello World!”;
return 0;
}

Sure thing! Why the whole thing has to look exactly like this you learn sometime later. But it can also be easier. For example in Python:

print(“Hello World!”)

The program is intended to test or learn the most basic functions of a language. That is, to put together the elementary components of a program and then run it. This way I can say I speak five languages: English, French, German, Fortran and Python.

Incidentally, the world was first greeted by Brian Kernighan in 1974. This Canadian computer scientist is a co-developer of the C programming language and in that year he wrote a manual on programming in C for the employees of Bell Laboratories. The exercise became famous four years later with the first book about C: “The C Programming Language”, by Kernighan and Dennis M. Ritchie.

Why Bell Laboratories? Bell invented the telephone, what does that have to do with programming? Good question. Alexander Graham Bell received the Volta Prize for his invention in 1880 and with it a considerable sum of money. With this money he founded the Volta Laboratory, or Alexander Graham Bell Laboratory, which was originally concerned with researching sound. He used funds from the laboratory to also establish the Volta Office in 1887, which was dedicated to the education of the deaf. Bell Labs, meanwhile, and in the decades that followed, expanded its field of research to include telecommunications, mathematics, computer science, physics and materials research. The original Volta Laboratory has passed through several hands since its inception, and since 2016 Bell Labs has been part of Nokia. The indestructible quality of the work at Bell Labs has led to many research milestones, including nine Nobel Prizes. And also the programming language C, which brings us back to “Hello World”.

As you can see above, the task of programming “Hello World!” can be easier or more difficult depending on the language. While Python shines for its simplicity and elegance, C++ looks more demanding. It probably doesn’t get much more complicated than that, does it?

Challenge accepted! From my own experience, I can say that physicists love to play, and computer scientists seem to be in no way inferior to us. So-called esoteric programming languages have only been developed to test the limits of programming. For example, ask yourself: how minimalist can a programming language be? I present: Brainfuck! What sounds like a joke is actually a functioning programming language that works with only eight commands: +-<>[], and . “Hello World!” looks like this in Brainfuck:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>—.+++++++..+++.>>.<-.<.+++.——.——–.>>+.>++.

Here you can’t even recognise the words Hello or World. Not very practical, but it works and is entertaining.

Computer scientists are not only playful but often also nerds. What sounds like a cliché tends to be true very often. And whoever says nerd must also say fantasy. Terry Pratchett, for example, is a grand master of the fantasy genre. He wrote novels set in the Discworld: a flat, disc-shaped world that rests on the backs of four elephants, which in turn stand on the back of a turtle. All sorts of familiar or unfamiliar fantasy characters live on the Discworld, such as witches, wizards, dwarves, a cheese that likes to eat mice, or Death himself. And of course, good wizards need a good education, which they find at the Invisible University. This is also home to the largest magical library on Discworld, and its librarian is a wizard who has been transformed into an orangutan. He can only speak one syllable,  “Ook“, but can be understood by anyone who tries hard enough. A feast for bored nerds! The result is the programming language Ook!, a variant of Brainfuck (that sounds promising already!) with the following basic principles:

  1. A programming language should be writeable and readable for orangutans.
  2. The syntax should be simple, easy to remember, and avoid the word monkey.
  3. Bananas are good.

A successful, anti-speciesist approach to ensuring access to programming for all living beings! Rule number 2, by the way, goes back to the fact that the librarian in the original prefers the term Ape and takes the word Monkey as an insult. The three basic elements of the programming language based on this are: Ook. Ook? and Ook! and these are combined into groups of two, which in turn correspond to the eight Brainfuck elements. “Hello World” thus looks like this:

Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.

A dream for every ape lover! 🍌

You don’t like bananas that much, and fantasy is too mainstream for you? No problem! There is a language for everyone. How about Shakespeare? Programs in the Shakespeare Programming Language look like Shakespearean plays at first glance. As an illustration, here is “Hello World” again:

The Infamous Hello World Program.

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.

Act I: Hamlet's insults and flattery.

Scene I: The insulting of Romeo.

[Enter Hamlet and Romeo]
Hamlet:
You lying stupid fatherless big smelly half-witted coward!
You are as stupid as the difference between a handsome rich brave
hero and thyself! Speak your mind!
You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer’s
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!
You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.
Speak your mind!
[Exit Romeo]

Scene II: The praising of Juliet.
[Enter Juliet]
Hamlet:
Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!
[Exit Juliet]

Since the syntax certainly leaves no questions unanswered, I will leave the third scene and the second act as an exercise for motivated readers.

As you can see, there are no limits to creativity. These languages may not be very useful and in practice, they are not used for real applications (even if one could!). But they test the limits of programming and make it clear that many roads lead to the same goal. There are many ways to say hello. Short and understandable, in animal sounds, rhymes, or verses. But in the end, the message remains the same: Hello world, and welcome to my blog!


Do you like what you read? If you don’t want to miss any new posts, don’t forget to subscribe to my blog.


3 thoughts on “Hello World!

Comments are closed.