9 ms·
Hello world in every computer language
- Comevius 4y agoIn 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 https://github.com/xbinner18P/leachim6S/blob/main/z/Zig.zig
- smitty1e 4y ago'Every' becomes a challenge. 99 bottles claims 1500 languages => https://www.99-bottles-of-beer.net/ https://www.99-bottles-of-beer.net/
- petee 4y agoNeat 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 http://www.rosettacode.org/wiki/Hello_world/Text
- jimkleiber 4y agoWow, 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!
- ravenstine 4y agoRosetta 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.
- lolinder 4y agoBetter yet, maybe devs who know a language well should correct the examples to be more idiomatic? It is a wiki, after all.
- ravenstine 4y agoYes.
- deleted 4y ago[deleted]
- AtlasBarfed 4y agoTHere 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.
- can16358p 4y agoThanks to the repo, I've just discovered Mostawesomeprogramminglanguage.
- deepspace 4y agoIf 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.
- can16358p 4y agoSurely, 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.
- djvdq 4y agoNot "in languages" but "languages and frameworks", e.g. if I counted properly Python is used in 11 different ways
- math-dev 4y agoChange Common Lisp to (print “Hello, World!”) - no need to make things complicated ;)
- ksaj 4y agoYes, as well, CLisp and Common Lisp are not different languages. The examples given will work for all Common Lisp implementations.
- danielandrews43 4y agoI wrote a Coffee table book on this! https://hellobook.io/ https://hellobook.io/
- aksss 4y agoYour Apple Pay process seems broken (gateway issue perhaps?).
- dankwizard 4y agoPrinting a website & adding a $ on it, we are living in crazy times.
- schoen 4y agoDid 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.
- anandchowdhary 4y agoThis repository seems to be a clone of the actual repository: https://github.com/leachim6/hello-world https://github.com/leachim6/hello-world dang, maybe we can update the link?
- OliverJones 4y agoAnd, 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 https://kermitproject.org/utf8.html Handy if you want to make sure stuff works RTL . אני יכול לאכול זכוכית וזה לא מזיק לי But don't try it at home :-).
- bmitc 4y agoIs there really a point to hello world programs? For most languages it consists of basically just typing out the string "hello world".
- nkozyra 4y agoI 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.
- mikebenfield 4y agoWhile 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.
- tyingq 4y agoIn that spirit...for php, you could just have "hello world\n" in a file, since it's a template language by default.
- Moru 4y agoThat 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.
- tyingq 4y agoI 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
- Moru 4y agoThat'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.
- Moru 4y agoI feel old. I did five searches on languages and none of them exists in the list.
- carl_dr 4y agoWhich languages? Maybe you could create a PR for them?
- Moru 4y agoThere 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...
- carl_dr 4y agoSTOS (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 …
- Moru 4y agoThere 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/ https://glbasic.com/ [1] https://tic80.com/ https://tic80.com/
- dark-star 4y agoThere 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
- chaosprint 4y agohttps://glicol.org/tour#hellowolrd https://glicol.org/tour#hellowolrd Hello world from a music programming language.
- d1stc 4y agothe most interesting is b/BIT.bit
- Drblessing 4y agoJumped right to Brainfuck
- avgcorrection 4y agoHello 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.
- prezjordan 4y agoShameless 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 https://github.com/jdan/fizzbuzz-polyglot
- anthk 4y agoInform has i6 and i7 variants.
- hp48fan 4y agoMy favorite is missing! HP's User RPL and System RPL are missing!