Live data from Hacker News

JEP 401: Value Objects (Preview) merged to OpenJDK master

github.com

181–185 of 185 posts

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#181
post #175
post #103

Earlier quoted context omitted.

Such hacks will slowly stop working (without explicitly allowing it from the command line.) In this example, it would throw an IllegalAccessException, because java.base doesn't open java.lang.

Doesn’t field.setAccessible(true) already throw on a modern version?

Exactly.

You can make it not throw by adding `--add-opens java.base/java.lang=ALL-UNNAMED` or similar to the command line, but breaking things like this is becoming harder.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#182
post #15

I feel lonely in that: I mostly love Java as a language. The lack of value types is the biggest impediment to certain types of performance. I am really looking forward to this evolution of the language.

The tooling could be better, though. I wish it came with more batteries included, and it renovated that old Java cli split per commands, following a bit what golang did: - java run - java build - java test - java fuzz-test - java format - java lock - java lsp - etc. Along with a better support of posix long form flags like ‘--version’.

[dead]

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#183
post #180

Earlier quoted context omitted.

Well, yes. True that for long-running apps JVM seems to be tuned. I meant the kind of "perf-to-the-instruction" thst native can generate vs other considerations.

One thing we C++ programmers know, though, is that direct control over instructions helps performance in small programs but can hurt it in larger programs. E.g. it is really hard to enjoy the performance benefits that moving collectors and JITs can bring in large C++ applications.

I am not sure of the real life difference of this. You can tweak C++ a lot, you can make caches, etc your own with memoization and others.

True that you would need to build it by hand and, at that time, maybe it is better to just pick something tried and tested for that use case.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#184
post #180

Earlier quoted context omitted.

One thing we C++ programmers know, though, is that direct control over instructions helps performance in small programs but can hurt it in larger programs. E.g. it is really hard to enjoy the performance benefits that moving collectors and JITs can bring in large C++ applications.

I am not sure of the real life difference of this. You can tweak C++ a lot, you can make caches, etc your own with memoization and others. True that you would need to build it by hand and, at that time, maybe it is better to just pick something tried and tested for that use case.

It's not so easy. The pattern you'd want to try and match or beat moving collectors is arenas, and they're really not trivial to use in C++ (or Rust). The only low-level language that supports them well is Zig. But even then, evolution of the program can often require large architectural changes.

So yes, in principle it's possible to match and perhaps somewhat exceed Java's performance in C++, even in large programs (just as, in principle, it's possible to match and exceed C++'s performance in Assembly), but we don't care about what's possible in principle; we care about what we can achieve with the budget we have. Or put another way, C++ has better performance/effort than Assembly, and Java has better performance/effort than C++ in large programs (perhaps not in all domains, but in important ones). The JVM was designed to (among other things) specifically make it easier to overcome some known performance problems that large C++ programs experience.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#185
post #184

Earlier quoted context omitted.

I am not sure of the real life difference of this. You can tweak C++ a lot, you can make caches, etc your own with memoization and others. True that you would need to build it by hand and, at that time, maybe it is better to just pick something tried and tested for that use case.

It's not so easy. The pattern you'd want to try and match or beat moving collectors is arenas, and they're really not trivial to use in C++ (or Rust). The only low-level language that supports them well is Zig. But even then, evolution of the program can often require large architectural changes. So yes, in principle it's possible to match and perhaps somewhat exceed Java's performance in C++, even in large programs…

> we care about what we can achieve with the budget we have

100% agree on this. This is the last driver for everything else in professional environments.

Related: I think C++ safety being driven by profiles and not the Safe C++ stuff that was proposed violates the economic assumption in so many ways that it was the wrong choice for C++.

Post reply on HN