Hacker News new | past | comments | ask | show | jobs | submit
This is nonsense. Java doesn't "compile like C or C++ or Rust or Zig" any more than Python does. "Python compiles to bytecode! you can use mypyc!" who cares? That's obviously not the point.

Unsafe is still plenty prevalent in Java, nor is the use of C++ libraries.

> sometimes with more aggressive optimisations and sometimes with less aggressive ones.

Yes, well, that's some handwaving.

> Unsafe mostly used to be used for certain memory operations before VarHandles and FFM.

Yes. It is still very prevelant.

> No, that's also inaccurate. The "massive runtime" is largely a compiler (and it doesn't matter what language that's in), and memory management, where the Rust runtime is also about as massive and written in C (the various malloc/free implementations).

Ridiculous. "largely a compiler" - it contains a JIT compiler, as in it's a runtime compiler that allocates executable code at runtime and then runs it. (a) Of course it matters what language it's in (b) JITs are an incredible source of security issues and have their own set of mitigations that have to be applied.

> where the Rust runtime is also about as massive and written in C (the various malloc/free implementations).

A ridiculous comparison.

> This is nonsense. Java doesn't "compile like C or C++ or Rust or Zig" any more than Python does.

It really does, though. Perhaps you're unfamiliar?

> Unsafe is still plenty prevalent in Java, nor is the use of C++ libraries.

My statement was that unsafe is much more prevalent in Rust than in Java, and that is true.

> Yes, well, that's some handwaving.

I'm sorry that I can't teach you principles of compilation here, but feel free to dig deeper.

> Yes. It is still very prevelant.

Much less than in Rust.

> Ridiculous... A ridiculous comparison.

You don't sound like either a runtime or compiler engineer at all, or you wouldn't have found any of this ridiculous in the least (or news). In that case, I hope that telling you that what I wrote was true might enrage you enough to learn more about these subjects, and perhaps our community will have grown by another member.

> It really does, though. Perhaps you're unfamiliar?

You won't be specific so now you're putting me in a position to have to build your argument for you. It's frustrating because the conversation is already stupid. Java is a language so calling it compiled or interpreted or AOT or JIT is already a mistake, those are implementation properties of how it is deployed.

The massively most popular implementations rely massively on JIT, even if they have varying levels of AOT support.

This is so obviously different from actual AOT languages. Hence having to call it AOT when it's Java.

> My statement was that unsafe is much more prevalent in Rust than in Java, and that is true.

That's an empirical claim. You can go ahead and support it.

> Much less than in Rust.

Riiiight. No one uses Netty, right????? They had such an easy job ditching Unsafe, right??????

> You don't sound like either a runtime or compiler engineer at all, or you wouldn't have found any of this ridiculous in the least (or news). In that case, I hope that telling you that what I wrote was true might enrage you enough to learn more about these subjects, and perhaps our community will have grown by another member.

And I recognize your name well enough that you don't know much of anything.

JIT vs AOT doesn't really make a difference in this context.
It makes a huge difference. JIT has major implications for security. It requires its own distinct mitigation techniques because it necessitates runtime code generation and execution. It's extremely complex.