←back to thread

Java Hello World, LLVM Edition

(www.javaadvent.com)
200 points ingve | 1 comments | | HN request time: 0.207s | source
Show context
troymc ◴[] No.46181738[source]
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-program...

replies(4): >>46181790 #>>46181936 #>>46182649 #>>46183494 #
pmdr ◴[] No.46182649[source]
Objective C is by far the weirdest on that list.
replies(2): >>46184102 #>>46188470 #
saagarjha ◴[] No.46188470[source]
Objective-C is basically Java so I wouldn’t call it that weird.
replies(1): >>46188475 #
gnabgib ◴[] No.46188475[source]
Objective-C is significantly (11 years) older than Java.

1984: https://en.wikipedia.org/wiki/Objective-C

1995: https://en.wikipedia.org/wiki/Java_(programming_language)

replies(1): >>46188529 #
saagarjha ◴[] No.46188529[source]
Correct, Java was designed with a strongly influence from Objective-C.
replies(1): >>46188549 #
gnabgib ◴[] No.46188549[source]
One might even say Java is basically Objective-C
replies(2): >>46189835 #>>46189853 #
saagarjha ◴[] No.46189835[source]
No, Java never took anything good from the language.
replies(1): >>46189860 #
pjmlp ◴[] No.46189860[source]
Sun folks disagree,

https://cs.gmu.edu/~sean/stuff/java-objc.html

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

replies(1): >>46190156 #
saagarjha ◴[] No.46190156[source]
I was talking about good parts of the language
replies(1): >>46190182 #
pjmlp ◴[] No.46190182[source]
Like [] and @ all over the place, C lack of safety, and manual memory management?

Because I don't see what else good Java has left out, besides AOT in the box and unsigned types.

replies(1): >>46190627 #
saagarjha ◴[] No.46190627[source]
Uh, the entire runtime?
replies(2): >>46191360 #>>46195890 #
1. jeberle ◴[] No.46195890[source]
I would look to the UCSD p-System as a precedent to the JVM. Both are byte-code interpreted VMs. Gosling used the p-system earlier in his career, prior to joining Sun.

https://en.wikipedia.org/wiki/James_Gosling#Career_and_contr...

The Objective-C runtime is very small: just enough to do late-bound fn calls to a tree of class defs. All on top of C.