70 comments

[ 22.8 ms ] story [ 508 ms ] thread
Related, but broader: https://www.rosettacode.org

Their Hello World implementations: https://www.rosettacode.org/wiki/Hello_world/Text#BML

Came to post the same. Rosetta Code is actually a great resource for understanding the varying capabilities of different languages—the way some tasks are trivial in some languages due to powerful built-ins, while in others they have to be built up from scratch.
haha ditto for posting the same. Anyone also catch the ending line of the README re: FizzBuzz? :)
Clearly the winner is Shakespeare (https://github.com/leachim6/hello-world/blob/master/s/shakes...):

"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."

Closely followed by Chef: https://github.com/leachim6/hello-world/blob/master/c/chef.c...

"This prints hello world, while being tastier than Hello World Souffle."

IT'S SHOWTIME

TALK TO THE HAND "hello world"

YOU HAVE BEEN TERMINATED

They could probably employ that executable tracing program to indeed make any compiler produce "hello world" eventually.
<groan> Hello World tells you nearly nothing about a programming language.

(Unless, of course, it's written in Java, in which case it's a painstaking tour of the entire programming language, requiring you to learn the concepts behind "class", "public", "static", "void", "main", and arrays, despite never actually using any of those things.)

This post doesn't claim to teach you about programming language. It actually contains exactly what it says on the tin: Hello World in every programming language.

When you pick up a dictionary, do you groan about it teaching you nearly nothing about human languages?

Not really, when learning the language, most people will see it just as "stuff you do to make a main function". It's just as you don't have to look inside stdio.h to be able to #include it for a hello world program.
Would it be possible to make something better than Hello World that would showcase even more of the universal standard features of programming languages?

Any ideas?

Maybe calculate the first 10 primes and output the result? Something like that...

It should be several examples, each showing one of the following:

Iterating over infinite lists (generators, lazy seq, whatever), polymorphism (if applicable), pattern matching (if applicable), how one would pass functions around, how one would manipulate a date, how one would read and write to a file, how one would make an http request (with some error handling!), traits/mixins (or similar, if applicable) concurrency, parallelism, and use of built in List, Map data structures. While not exhaustive, to me those feel like common building blocks to my day that would showcase how easy it is to do things in a language.

     326 ./p/pit.pit
     194 ./a/assembler_atari2600.asm
     125 ./d/DNA-Sharp.dna
     124 ./d/DNA#.dna
      94 ./b/brainf*ck-2d
      89 ./s/shakespeare.spl
      89 ./b/beatnik.beatnik
      81 ./b/BIT.bit
      68 ./t/Tao-Presentations.ddd
      65 ./c/chef.ch
Top 10 Hello World programs in number of lines.
Thanks, I was looking for this! Thought the Github language stats would show me, but they seem to be failing.
The Atari one is interesting, apparently there is no native support for any font rendering so you have to build each letter using onscreen graphics.
I kinda wish Hello World was unit tested by default
(comment deleted)
My favorite so far is Malbolge[0]: https://github.com/leachim6/hello-world/blob/master/m/malbol...

"Malbolge was specifically designed to be almost impossible to use, via a counter-intuitive 'crazy operation', base-three arithmetic and self-altering code.[1] It builds on the difficulty of earlier, challenging esolangs (such as Brainfuck and Befunge), but takes this aspect to the extreme, playing on the entangled histories of computer science and encryption. Weaknesses in the design have been found that make it possible (though still very difficult) to write useful Malbolge programs."

[0]https://en.wikipedia.org/wiki/Malbolge

chicken chicken chicken

chicken chicken chicken chicken chicken chicken

chicken

Hmmm... there is react.js, but there is no Spring.
There are thousands of programming languages, so it should be "many" rather than "every". Some important ones are missing, e.g. SNOBOL4, SASL, IPL, POP-11, SISAL, LabVIEW, Prograph.

In Full Metal Jacket (not released yet), "Hello computer" is shown at http://web.onetel.com/~hibou/fmj/tutorials/FirstSteps.html

In Prograph, it's similar. In LabVIEW, it's also similar, except that data flows from left to right.

What I want is a transpiler from every language to every other language. It doesn't need to result in performant code, just working code.
Is PLM missing? I used to program in PLM before C became popular for firmware coding.
Wow, it actually had MUMPS. I'm impressed.
I love this kind of stuff. The similarities and differences of programming languages is something of an obsession of mine.

In my free time over the last several years I've been working on a chrestomathy that collections solutions to Project Euler problems in various different languages [0]. I'm currently up to 39. It's certainly far from "every" language and in most languages I've only written solutions to the first handful of problems. I've learned it's hard to not learn a lot about a language if you do the first 7 or so problems in it.

[0] https://github.com/seaneshbaugh/rosetta-euler