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.
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.
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.
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.
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.
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."
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.
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.
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.
Ah, okay. The context in which I was sharing that was about verboseness, "extra ceremony", and "priorities of the language designers". It meant something specific in that context.
Though you could still test that it's working in a webserver, since if it came from php rather than just the webserver, it would have some additional headers like X-Powered-By.
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...
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.
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.
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
45 comments
[ 3.6 ms ] story [ 102 ms ] threadhttps://github.com/xbinner18P/leachim6S/blob/main/z/Zig.zig
99 bottles claims 1500 languages => https://www.99-bottles-of-beer.net/
http://www.rosettacode.org/wiki/Hello_world/Text
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.
But esolangs are still fun to see people's creativity though.
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.
dang, maybe we can update the link?
https://kermitproject.org/utf8.html
Handy if you want to make sure stuff works RTL .
אני יכול לאכול זכוכית וזה לא מזיק לי
But don't try it at home :-).
For most languages you're right, the into is one concept.
echo "Hello World" > file.php && php file.php
Though you could still test that it's working in a webserver, since if it came from php rather than just the webserver, it would have some additional headers like X-Powered-By.
Maybe you could create a PR for them?
RPG III?, STOS, GL Basic, Assembler for Atari ST, seems to have forgotten the fifth again...
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 …
[0] https://glbasic.com/ [1] https://tic80.com/
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
Hello world from a music programming language.