top | item 46844615

(no title)

cryptos | 29 days ago

In the end, even Java code becomes machine code at some point (at least the hot paths).

discuss

order

stefs|29 days ago

yes, but that's just one part of the equation. machine code from compiler and/or language A is not necessarily the same as the machine code from compiler and/or language B. the reasons are, among others, contextual information, handling of undefined behavior and memory access issues.

you can compile many weakly typed high level languages to machine code and their performance will still suck.

java's language design simply prohibits some optimizations that are possible in other languages (and also enables some that aren't in others).

pron|28 days ago

> java's language design simply prohibits some optimizations that are possible in other languages (and also enables some that aren't in others).

This isn't really true - at least not beyond some marginal things that are of little consequence - and in fact, Java's compiler has access to more context than pretty much any AOT compiler because it's a JIT and is allowed to speculate optimisations rather than having to prove them.