Hacker News new | ask | show | jobs
by pron 11 days ago
> 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.

1 comments

> 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.
I won't comment on the rest of what you said here because it doesn't seem like you're a compiler engineer (JITs are vastly different from one another; e.g. HotSpot's C2 is more similar to LLVM than to V8's JIT), but I will just say that AOT compilers and C2 need to rely on intrinsics in exactly the same way, and it matters not a jot for security whether these intrinsics are emitted at runtime or build time (BTW, LLVM can be, and is, used as a JIT, and C2 can be, and is, used AOT).
> The massively most popular implementations rely massively on JIT, even if they have varying levels of AOT support.

What does this have to do with what I said? A JIT compiler is a compiler.

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

I don't need to convince you; I'm already convinced. If you don't think it's true, find out for yourself.

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

Pretty much they did, yes, once the right safe APIs were added.

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

Okay, but since I do work on the HotSpot JVM, and much of the world's most business-critical and performance-critical software relies on the code my colleagues and I write, the people who do need to trust that I know something about compilers and runtimes seem to already do, so it's okay if I lose a few commenters on HN.