6 ms·
I made a poster showing how one might write a Hello World program in 39 different programming languages, and even different versions of some common languages li
by troymc 10mo ago
I made a poster showing how one might write a Hello World program in 39 different programming languages, and even different versions of some common languages like Java:
https://troymcconaghy.blog/2025/01/13/39-hello-world-programs/ https://troymcconaghy.blog/2025/01/13/39-hello-world-program...
- throwaway150 10mo agoCool poster! If you don't mind me asking, would you share what tools you use to create this poster? You've got syntax highlighting going on there too. What did you use for that?
- iTokio 10mo agoYou just have to read his blog, it is short and he answered everything. > he used python and xelatex > https://github.com/ttmc/hello-world-ways https://github.com/ttmc/hello-world-ways
- troymc 10mo agoYep, and for syntax highlighting, I used the minted package [1]. Internally, minted uses the Pygments library [2]. [1] https://ctan.org/pkg/minted https://ctan.org/pkg/minted [2] https://pygments.org/ https://pygments.org/
- throwaway150 10mo agoThanks!
- pron 10mo agoNice, but as of JDK 25 (the preview JEP 445 has become the permanent JEP 512), the canonical Hello World in Java is: void main() { IO.println("Hello World"); }
- troymc 10mo agoThanks, I made a note to update that someday.
- prmoustache 10mo agoNot a java developer but why the void? Shouldn't your main function and program return an integer?
- gavinray 10mo agoThe return type of a Java main is the JVM platform return type Sending system signals is external to the JVM platform
- tadfisher 10mo agoI believe that is a C-ism, where the C runtime calls your main() and exits the process with the return value. The Java equivalent is System.exit(int status).
- saagarjha 10mo agoSince it seems like you work on Java, would you mind taking a look at https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8366730 https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-836673..., where this syntax does not work for shebangs?
- pmdr 10mo agoObjective C is by far the weirdest on that list.
- watersb 10mo agoSmalltalk, but in C
- saagarjha 10mo agoObjective-C is basically Java so I wouldn’t call it that weird.
- gnabgib 10mo agoObjective-C is significantly (11 years) older than Java. 1984: https://en.wikipedia.org/wiki/Objective-C https://en.wikipedia.org/wiki/Objective-C 1995: https://en.wikipedia.org/wiki/Java_(programming_language) https://en.wikipedia.org/wiki/Java_(programming_language)
- saagarjha 10mo agoCorrect, Java was designed with a strongly influence from Objective-C.
- gnabgib 10mo agoOne might even say Java is basically Objective-C
- saagarjha 10mo agoNo, Java never took anything good from the language.
- pjmlp 10mo agoSun folks disagree, https://cs.gmu.edu/~sean/stuff/java-objc.html https://cs.gmu.edu/~sean/stuff/java-objc.html https://en.wikipedia.org/wiki/Distributed_Objects_Everywhere https://en.wikipedia.org/wiki/Distributed_Objects_Everywhere Sure, they could have taken a bit more, like proper AOT instead of it being a feature only available in third party commercial JDKs, or some low level niceties like C#.
- realo 10mo agoThis is super cool! Now someone should make a similar poster with Hello World sent to a serial port. Bonus points if it is a RS485 port. Some language that seem to look good might show their true ugly face...