Live data from Hacker News

Java 17 / JDK 17: General Availability

mail.openjdk.java.net

191–200 of 251 posts

Re: Java 17 / JDK 17: General Availability

#191

Earlier quoted context omitted.

I would use records a lot more (pretty much everywhere) if I could easily derive new values from existing ones.

There are some funny ways to work with records. I can recommend this article: https://benjiweber.co.uk/blog/2020/09/19/fun-with-java-recor...

Still way too much typing compared to lombok's @Value @With.

Re: Java 17 / JDK 17: General Availability

#193

On its own, the features specifically for Java 17 aren't obviously that compelling, but the important thing is that Java 17 is an LTS, the last one of which was Java 11, 3 years ago. Since many organizations, including mine, stick to LTS releases, that means a lot of developers will get a big change in what they can do sometime in the next few months as they upgrade to the LTS. Among other things, this means that we…

I've compiled a Twitter thread with some of the key features new since Java 11 over the last few days: https://twitter.com/gunnarmorling/status/1434443970411704324 . Also includes some links to related blog posts. Perhaps interesting for some to get a quick overview what you'll get with 17 when coming from 11.

Here's the Thread Reader link: https://threadreaderapp.com/thread/1434443970411704324.html

Re: Java 17 / JDK 17: General Availability

#194
post #164
post #157

Earlier quoted context omitted.

And now it is the other way around. C# burning through the versions to catch up the versions (and not so much the content). PS: had to edit, was really just a note about the numbers not the content of the versions!!!

Catch up to what? The JDK 17 JEP list reads like a list of things that were added to dotnet years ago.

Just version numbers, not content :)

Re: Java 17 / JDK 17: General Availability

#195

Java5 and Java8 were monumental changes to the language… this update probably will have the same legacy. Can’t wait to see the benchmarks out of this bad boy once they get the compilers tuned in.

Don't new programs have to be written to use the new features?

        elapsed secs

        binarytrees,java16,7   2.478
        binarytrees,java17,7   2.475

        binarytrees,java16,3   4.644
        binarytrees,java17,3   4.574

        binarytrees,java16,2   4.765
        binarytrees,java17,2   4.772

        binarytrees,java16,6   4.608
        binarytrees,java17,6   4.594

        binarytrees,java16,4   4.733
        binarytrees,java17,4   4.808

        fannkuchredux,java16,2   45.438
        fannkuchredux,java17,2   43.921

        fannkuchredux,java16,1   10.644
        fannkuchredux,java17,1   10.382

        fannkuchredux,java16,3   41.432
        fannkuchredux,java17,3   41.110

        fasta,java16,5   1.302
        fasta,java17,5   1.255

        fasta,java16,2   4.473
        fasta,java17,2   4.325

        fasta,java16,6   1.209
        fasta,java17,6   1.191

        fasta,java16,4   3.164
        fasta,java17,4   3.202

        knucleotide,java16,5   18.224
        knucleotide,java17,5   20.063

        knucleotide,java16,3   7.383
        knucleotide,java17,3   7.332

        knucleotide,java16,6   7.447
        knucleotide,java17,6   7.373

        knucleotide,java16,4   36.777
        knucleotide,java17,4   36.712

        knucleotide,java16,1   4.979
        knucleotide,java17,1   4.851

        mandelbrot,java16,2   4.148
        mandelbrot,java17,2   4.119

        mandelbrot,java16,3   7.382
        mandelbrot,java17,3   7.348

        mandelbrot,java16,1   27.733
        mandelbrot,java17,1   27.793

        mandelbrot,java16,4   5.221
        mandelbrot,java17,4   4.415

        mandelbrot,java16,6   4.247
        mandelbrot,java17,6   4.300

        nbody,java16,3   7.410
        nbody,java17,3   7.454

        nbody,java16,2   7.459
        nbody,java17,2   7.472

        nbody,java16,5   7.006
        nbody,java17,5   7.027

        nbody,java16,1   7.823
        nbody,java17,1   7.818

        nbody,java16,4   6.739
        nbody,java17,4   6.768

        pidigits,java16,1   7.375
        pidigits,java17,1   7.891

        pidigits,java16,2   1.336
        pidigits,java17,2   1.342

        pidigits,java16,3   0.928
        pidigits,java17,3   0.926

        regexredux,java16,6   5.593
        regexredux,java17,6   5.362

        regexredux,java16,3   5.582
        regexredux,java17,3   5.313

        regexredux,java16,1   9.021
        regexredux,java17,1   8.441

        revcomp,java16,5   4.364
        revcomp,java17,5   4.392

        revcomp,java16,6   3.080
        revcomp,java17,6   3.011

        revcomp,java16,3   2.310
        revcomp,java17,3   2.369

        revcomp,java16,4   5.005
        revcomp,java17,4   5.029

        revcomp,java16,7   21.809
        revcomp,java17,7   23.196

        revcomp,java16,8   1.537
        revcomp,java17,8   1.527

        spectralnorm,java16,1   6.173
        spectralnorm,java17,1   8.016

        spectralnorm,java16,3   1.631
        spectralnorm,java17,3   1.577

        spectralnorm,java16,2   1.655
        spectralnorm,java17,2   2.334

Re: Java 17 / JDK 17: General Availability

#196

I'm curious if it would be possible to remove null from Java. There's already support for Optional. I mean I guess a lot of code would stop compiling, or could it be deprecated somehow.

Why would "remove null" be better than the Dart approach — "When you opt into null safety, types in your code are non-nullable by default, meaning that variables can’t contain null unless you say they can." ?

https://dart.dev/null-safety

Re: Java 17 / JDK 17: General Availability

#197

I've been out of the loop with the Java ecosystem, but has the transition from Java 8 to 11 completed where most of folks here work? I was also curious about large ecosystems like Hadoop and their moves from 8 to 11.

I work in finance, hedge fund kind of stuff. My team has its main apps on 11, with a long tail of minor services on 8. One other team in the company has been keeping up with each release (brave souls!). Most others are in a similar place to us.

I've been interviewing lots of candidates recently, and i usually chat a bit about what versions they've used. Only one is using 11, the rest are on 8. One only finished migrating to 8 this year!

Re: Java 17 / JDK 17: General Availability

#198

Reportedly, not much "big new stuff" got into this release (maybe next time), but it's an LTS so it's not the best time for that anyway.

The new FFM API looks really cool. Still incubating but having better native interop I think could really be a big win. Most developers will never touch that stuff but having the ability to manage native, off-heap memory and safely(ish) make native calls will be great.

I wrote an app which used JNI to call into C++ code. I ended up refactoring it to spawn subprocesses written in C++, and communicate with them via RPC. Not because JNI was difficult, but because errors in the C++ can take down the whole app otherwise. All the performance and ergonomics improvements in the world wouldn't persuade me to give up that safety barrier.

Unless i rewrite the native parts in Rust, of course :).

Re: Java 17 / JDK 17: General Availability

#199

Earlier quoted context omitted.

Kotlin does it, but it's next to useless because the ecosystem makes heavy use of null.

what? I don't feel it's "pointless" at all. Many popular Java libraries and frameworks (including Spring) use nullability annotations which can be interpreted correctly by Kotlin. It's true that I can't be 100% sure not to get NPEs, but I think it's close enough and I've rarely seen NPEs in Kotlin codebases.

Indeed, Kotlin's null handling is great. NPE's in Kotlin code aren't common.

Re: Java 17 / JDK 17: General Availability

#200

I would like to ask a question, in order to elicit the detailed and considerate comment that HN is known for. It's not intended to inflammatory in any way shape or form! I am not a Java developer. I am one of those users who has a bad memory of using Java desktop apps in ~2001 where they ate a ton of ram, seemed horrendously slow, and had example "Hello Worlds" that are reminiscent of Enterprise FizzBuzz [1]. At some…

For a while, there were some nitty, edge case, "UFO" types of differences between OpenJDK and the Oracle JDK. But that's mostly been resolved. Oracle owns "Java", that is the name, the trademark, etc. In that sense, OpenJDK is "not" "Java". But operationally, this is moot. But it has impact in other areas. What was originally "Java Enterprise Edition" was transferred over to the Eclipse Foundation, but they couldn't…

> All of the JEE packages were "javax.enterprise.". Oracle wouldn't give up the "Java" part in order to not dilute its trademark, so now its the "Jakarta Enterprise Edition", and all of the packages are being renamed to "jakarta.enterprise.". I mention this just as an example of the hoops the community going through, even today, over what's happening with java.

That is quite a change, and probably not very backwards compatible?

Post reply on HN