Live data from Hacker News

Java 20 / JDK 20: General Availability

mail.openjdk.org

241–250 of 356 posts

Re: Java 20 / JDK 20: General Availability

#241
post #94

Earlier quoted context omitted.

It's interesting how the introduction of "modules" has forced so many to stick with C++17 and Java 8.

C++ has barely any feature complete compiler implementations and build systems aren’t ready for all of its additions, either (CMake and modules in particular). libstdc++ and libc++, gcc and clang are all not ready for production use or rather untested and/or buggy. Unless you’re targeting MSBuild Visual Studio Solutions and Windows only, C++17 is currently the most up to date, stable, and battle-proven version.

> gcc and clang are all not ready for production use or rather untested and/or buggy.

Which items from this table are lying about GCC v11 support of C++20? [1] Which of the features are buggy in GCC v11-12?

[1] https://en.cppreference.com/w/cpp/compiler_support#cpp20

Re: Java 20 / JDK 20: General Availability

#242
post #118
post #40

Earlier quoted context omitted.

I prefer this one: Java Forever And Ever Movie (Java vs Windows .Net) https://www.youtube.com/watch?v=RnqAXuLZlaE

Awesome but today this would be a different story line ... maybe: two old conservatives (Java and C#) re-inventing themselves to fight against the hipsters (Go, Swift, JS, ...) ;)

JS is older than C#.

Re: Java 20 / JDK 20: General Availability

#243
post #122

Earlier quoted context omitted.

Aren't records and init only setters in C# also a way to favor immutable types and fix setters in properties? (Not trying to criticize, I really want to know).

Kind of. It gets you close. With the Builder pattern, you can easily define complex relationships for your class inner state. Like maybe if A & B are specified, then C shouldn't be specified. But if C is specified, then D should have a default value. Etc. These types of initialization requirements are not easily duplicated with C# init-only construction. Instead, in C# you have to rely on the callers to know exactly…

Do you have an example of how builders work in Java?

Re: Java 20 / JDK 20: General Availability

#244

Earlier quoted context omitted.

It's a shame "C with classes", as C++ originally was, didn't stick around for parallel development. I work with C daily and I'm well aware of its many shortcomings (e.g. its huge list of undefined behavior and its PDP11-centric view of modern architectures), but with some effort I believe it could function as a semi-portable second-level intermediate representation. Nim uses it as such, IIRC. Compiling to C first wou…

Rust ?

Rust compiles to C and then passes that C to a C compiler to generate machine code?

Re: Java 20 / JDK 20: General Availability

#246
post #92
post #78

Earlier quoted context omitted.

IMO you're neglecting the thousands of improvements in the HotSpot runtime.

They aren’t critical to most applications, and are invisible to most developers.

As a Java developer you should really set up at least some basic monitoring and perform load testing from time to time.

And even in the unlikely event you don't see any improvement with recent versions of the runtime, something like Spring Boot 3 requiring Java 17+ isn't exactly "invisible" in the Java world.

Re: Java 20 / JDK 20: General Availability

#247

Earlier quoted context omitted.

I haven't looked into CLR in a long time, but it feels like it has a fraction of JVM's adoption and community size. Microsoft also seems to be prioritizing Typescript and Node internally with its recent moves.

At the risk of starting a flame war, the CLI and the coreCLR are fare superior VM and platform from a technical stand point. A lot of the features schedule for jave 21 / project Valhalla are just basically catching up to modern VM design. Of course there is more to the choice of a platform than just the technical differences.

There would be a world for this argument if the CLR had anything even remotely resembeling hotspot runtime optimization.

What you describe is the result of different philosophies/priorities. CLR focuses on static compile-time optimization, while the JVM is a highly dynamic construct with unmatched runtime analysis. In the 90s, there was a hope that with sufficient escape analysis, the need for user-defined primitives would vanish, which is why value types have not been done prior.

By themselves, accessing values via stack and not by reference is technically trivial. The problem lies in backporting that kind of stuff.

Re: Java 20 / JDK 20: General Availability

#248
post #90

I'm curious what is meant by a "preview feature, or second preview feature, or..." in a released product?? I don't suppose they are going to remove it later. So in what way is it a preview? Are they signalling that it might have breaking changes in the future?

Yes, they reserve the possibilty to completely redo or even remove these preview features. They are not enabled by default, you have to opt in with a compiler flag.

ok, that makes some sense.

Re: Java 20 / JDK 20: General Availability

#249
post #177
post #174

What are some good primers to understand the prominent new Java features? Not just in 20, but since, say, 8. Asking as someone who would like to be cursorily familiar with Java, but does not use it day to day. I'm very familiar with things like auto type inference, pattern matching, multi-line strings and structured concurrency from other languages, so I'm not looking for an introduction to Java. I'm looking for some…

Boring answer... but Chat GPT? I asked it what was new in Java 8 and it enumerated a number of features. I could proceed to ask it about more details for each, and then continue Java version by version and I think it would be quite exhaustive. The other day I did something similar for cell biology. As a layman I wanted to learn more about DNA, mRNA, tRNA, translation, transcription, mitosis, miosis, etc. I think I le…

RP @johl@mastodon.xyz: I wish more people understood that "I want the computer to generate a natural language text that sounds like a plausible answer to a question about x" and "I want the computer to answer a question about x" are two very different problems.

https://aus.social/@johl@mastodon.xyz/110050185180546324

Re: Java 20 / JDK 20: General Availability

#250
post #174

What are some good primers to understand the prominent new Java features? Not just in 20, but since, say, 8. Asking as someone who would like to be cursorily familiar with Java, but does not use it day to day. I'm very familiar with things like auto type inference, pattern matching, multi-line strings and structured concurrency from other languages, so I'm not looking for an introduction to Java. I'm looking for some…

I've been trying to get caught up while job searching after being laid off, and have found YouTube to be a pretty good source, the Java language advocates are all very keen to show off all the shiny new stuff. Also definitely recommend the JEPs as one of the other sibling comments did. All of the "Data Oriented Programming in Java" stuff is I think especially relevant, Brian Goetz had a good article on InfoQ about it.
Post reply on HN