Hacker News new | ask | show | jobs
Hello world in every computer language (github.com)
72 points by maydemir 1490 days ago
19 comments

Neat but Rosetta Code has been doing this for a while, would have been nice to see more people contributing in once spot

http://www.rosettacode.org/wiki/Hello_world/Text

Wow, I had no idea Rosetta Code existed and as someone who loves linguistics (and can struggle knowing how to convert one computer language to another), I think I may find this really handy. Thank you!
Rosetta Code is useful, but many of the examples are horrendous. It's most likely because an example from one language is extrapolated into others without always considering if that language or community has its own way of accomplishing something. Occasionally I still use it, and it's good when you're a junior, but I think devs should try to move beyond it.
Better yet, maybe devs who know a language well should correct the examples to be more idiomatic? It is a wiki, after all.
Yes.
THere was also PLEAC.

And the other issue is the more than one way thing, you need "flavors" of different languages.

And once you get past that, what is really needed is a standard reference implementation of a website, IO pipelines, network code, ssh libs, and tons of other things. Rosetta has a lot of crappy algorithms and paper-thin examples.

It's a good idea, but I think Stack Overflow could have implemented something far better, at least for the main languages they had armies of karma seekers for.

This repository seems to be a clone of the actual repository: https://github.com/leachim6/hello-world

dang, maybe we can update the link?

This should be emailed in, since a repo clone would essentially be content farming.
Thanks, I see many contributions dangeling on the wrong repo now, which is sad :(
In Zig print formatting is comptime (it is evaluated at compile-time). I find this so neat. You can also achieve comptime monomorphization (generics) and polymorphism (interfaces) this way. No macros or templates needed.

https://github.com/xbinner18P/leachim6S/blob/main/z/Zig.zig

And, just for good measure, here's Frank da Cruz's multilanguage Unicode compilation in many languages of the phrase "I can eat glass. It doesn't harm me."

https://kermitproject.org/utf8.html

Handy if you want to make sure stuff works RTL .

אני יכול לאכול זכוכית וזה לא מזיק לי

But don't try it at home :-).

There is a site called "99 bottles of beer" or something, which has programs in every language that printed the lyrics to that "song".

I prefer that one to "hello world", because the programs were non-trivial (they had loops, for instance, and an if-then clause)

Hello World is just a bit too trivial to get any meaningful information from any language

'Every' becomes a challenge.

99 bottles claims 1500 languages => https://www.99-bottles-of-beer.net/

Is there really a point to hello world programs? For most languages it consists of basically just typing out the string "hello world".
It’s useful for testing that you have the langauge tool chain installed and working correctly.
While I do think it would be nice to compare using a program that is slightly less trivial, it's actually useful to see for how many languages the "Hello world" program requires a lot of extra ceremony. Look how verbose the Java program is for instance. I do think this says something about the priorities of the language designers.
In that spirit...for php, you could just have "hello world\n" in a file, since it's a template language by default.
That would not test PHP installed correctly at all, just the webserver unless you run it from the console. The whole point was to test that the language is working correctly.
I don't think you understand. Php would be processing the file. Try it with the php cli.

echo "Hello World" > file.php && php file.php

That's what I meant with "unless you run it from the console". But since the purpose with PHP is usually to run it on a webserver, you want to try that it actually works with the webserver.
I think there's really only value as a first step for compiled languages so you can actually see a result.

For most languages you're right, the into is one concept.

Change Common Lisp to (print “Hello, World!”) - no need to make things complicated ;)
Yes, as well, CLisp and Common Lisp are not different languages. The examples given will work for all Common Lisp implementations.
I feel old. I did five searches on languages and none of them exists in the list.
Which languages?

Maybe you could create a PR for them?

There is enough projects to create a list of hello world programs, not sure yet another one is meaningful. And the languages are so old in my brain I would not be able to make them any more :-)

RPG III?, STOS, GL Basic, Assembler for Atari ST, seems to have forgotten the fifth again...

STOS (and AMOS in Amiga), GL Basic and assembler on Atari ST - used them all myself.

Thanks for a small trip down memory lane over the last hour reminding myself about them!

I had been thinking about writing a web version of STOS or AMOS, a little more enthused now. Still won’t happen of course …

There are a few similar projects like GL Basic [0] that works on windows and Linux. Also some "fantasy computers" that has imagined limits that you are forced to stay inside, bringing out your creative side :-) Try TIC-80 [1] for example.

[0] https://glbasic.com/ [1] https://tic80.com/

Not "in languages" but "languages and frameworks", e.g. if I counted properly Python is used in 11 different ways
Shameless plug for a clone of this I did with FizzBuzz, except submitting a solution requires submitting a Dockerfile so that we can actually run it: https://github.com/jdan/fizzbuzz-polyglot
Hello World is useful for finding out that a program is running by having it produce some effect. All these Hello World things are cute and all (like criticizing Java for having a long program simply to print the two words) but it’s become a tired fetish at this point.
https://glicol.org/tour#hellowolrd

Hello world from a music programming language.

I wrote a Coffee table book on this! https://hellobook.io/
Your Apple Pay process seems broken (gateway issue perhaps?).
Printing a website & adding a $ on it, we are living in crazy times.
Did you look at the sample pages there? It has expository research about the languages, design, and illustrations beyond just the implementations.

Though I don't personally think this is an exciting way to learn about programming languages or their history, it looks like an appealing book that a lot of work went into.

Thanks to the repo, I've just discovered Mostawesomeprogramminglanguage.
If you bundle GitHub pages with lists of "Hello World" programs, and their forks, together then "Mostawesomeprograminglanguage" appears to be a Hapax Legomenon in Google. I.e. it appears to be a joke, specifically constructed for this list, and not a real programming language.
Surely, I mean I can't imagine anyone actually using it for remotely anything serious.

But esolangs are still fun to see people's creativity though.

My favorite is missing! HP's User RPL and System RPL are missing!
Inform has i6 and i7 variants.
Jumped right to Brainfuck
the most interesting is b/BIT.bit