Live data from Hacker News

Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

jvm-weekly.com

211–220 of 464 posts

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#211

A lot of the comments on here are a bit unfair on what is great work being done and even more awesome work (JEPs) in the pipeline for the future. If Java was a child, imagine it being brought up by loving parents for the first few years (Sun) then it was thrown in a garage with some other children and neglected by its evil guardian (Oracle) Neglected and unloved till JDK 8, its basically been playing catch up. So whe…

>> I will continue to enjoy writing once and deploying anywhere!

Except to the browser, iOS, embedded systems...

WebAssembly is the real write once deploy anywhere tech now. JVM had its turn and lost.

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#212
post #27
post #23

Earlier quoted context omitted.

> The stewardship of Java seems rather lacking In what way? If anything Java's main developers (employed by Oracle for the most part, working on the completely open source and free OpenJDK) are extremely knowledgeable and are responsible a big jump in how fast the platform evolves. They have added proper algebraic data types to the language, delivered virtual threads and garbage collectors that decouple pause times f…

> They have added proper algebraic data types to the language No they haven't. E.g. they added a class that superficially looks like Option but subtly breaks the rules that Option is meant to follow, ensuring that no-one can ever manage to migrate existing codebases away from using `null`.

[deleted]

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#213

Earlier quoted context omitted.

How can Kotlin do it?

Probably with hacks. Did you know a final field in Java can change its value? And I'm not talking about his reflection to make it non-final. With ordinary code only, you can read a final field before it's been initialized, so it still holds its default zero value. For example "final int x = calcX();" and have calcX print the value of x, it will be zero. There's a whole bunch of specification language describing how c…

Nothing stops me from sticking my dick into a blender either, yet it works fine for most of the things (the blender). Both Java’s notion of final and Kotlin’s nullability work great for 99.999 use cases and you really need to go out of your way to break them.

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#214
post #132

Earlier quoted context omitted.

Could you actually explain/exemplify any of the gotchas and what's been made better (or is this just handwaving)?

Part of the reason Java hasn't reified generics is because C# did and it was a real big headache that also limited non-C# languages on the C# runtime (CLI?). Everything had to be recompiled to work with newer C# runtimes. While it's pretty easy to run a bunch of language on the JVM (Javascript, python, ruby, clojure) doing the same for C# is somewhat a nightmare, particularly for non-type aware languages. For example…

I don’t think that’s the case. You can absolutely implement a type-erased language on top of the CLR. Your language will just have the same constraints of a type-erased language like Java.

Having reified generics in the CLR just lets you store more type information. There isn’t much of a trade off for CLR end-users.

Compare this to the constraints and workarounds that Kotlin and Scala have due to type-erasure on the JVM.

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#215
post #211

A lot of the comments on here are a bit unfair on what is great work being done and even more awesome work (JEPs) in the pipeline for the future. If Java was a child, imagine it being brought up by loving parents for the first few years (Sun) then it was thrown in a garage with some other children and neglected by its evil guardian (Oracle) Neglected and unloved till JDK 8, its basically been playing catch up. So whe…

>> I will continue to enjoy writing once and deploying anywhere! Except to the browser, iOS, embedded systems... WebAssembly is the real write once deploy anywhere tech now. JVM had its turn and lost.

Embedded systems? Like sim cards? There's even real time Java, I think they used it for some missile guidance stuff aswell at some point

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#216

Earlier quoted context omitted.

> The whole attitude and process around this and the other topics gives me very little faith that Java can be steered in a sensible direction here. I agree. The stewardship of Java seems rather lacking - particularly when compared to that of .net, where MS etc. mostly seemed to make the correct decisions from the start. Does Java even have any value or mindshare at Oracle nowadays? The company seems to be a datacentr…

.NET made different decisions. I was at a conference on scientific programming in Java very early on that Geoff Fox put on up at Syracuse and we had a list of requests from Sun that they didn't give us but Microsoft gave many of them right away. On the other hand I really like Java's all-virtual approach to inheritance because the .NET model gives programmers more ways to screw up and get confused. Both languages sli…

Java stagnated for quite a while. Seemed like everyone was stuck on Java 6 for about a decade. But JDK8 was a huge step forward. Lambdas, streams, and a date/time API that is the best I've seen.

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#217

> But the difference in memory is fundamental. The JVM can now store the values themselves in the array, laid out densely one after another: 8 bytes per point (plus a possible null flag), in a contiguous block. No headers per element. No pointers. No jumping around the heap. How much was this article proof-read? Didn't they just get finished talking about how heap flattening won't work for objects with > 64-bit repre…

I'm confused about the 2008 Bloomberg article image in the first slot... right after implying the effort started in 2014. With nothing mentioning anything in there.

Is there a way we can request a "flag as AI garbage" downvote for articles? Or should we just flag them?

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#218

Earlier quoted context omitted.

Part of the reason Java hasn't reified generics is because C# did and it was a real big headache that also limited non-C# languages on the C# runtime (CLI?). Everything had to be recompiled to work with newer C# runtimes. While it's pretty easy to run a bunch of language on the JVM (Javascript, python, ruby, clojure) doing the same for C# is somewhat a nightmare, particularly for non-type aware languages. For example…

I don’t think that’s the case. You can absolutely implement a type-erased language on top of the CLR. Your language will just have the same constraints of a type-erased language like Java. Having reified generics in the CLR just lets you store more type information. There isn’t much of a trade off for CLR end-users. Compare this to the constraints and workarounds that Kotlin and Scala have due to type-erasure on the…

You CAN do it, but it's much more difficult.

And as far as I'm aware, both kotlin and Scala don't really suffer due to type erasure.

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#219
post #75

Earlier quoted context omitted.

> The whole attitude and process around this and the other topics gives me very little faith that Java can be steered in a sensible direction here. I agree. The stewardship of Java seems rather lacking - particularly when compared to that of .net, where MS etc. mostly seemed to make the correct decisions from the start. Does Java even have any value or mindshare at Oracle nowadays? The company seems to be a datacentr…

First, your parent comment misunderstood what the section they were critiquing is referring to. It's not about nullability (which is orthogonal) but about reference/value projections. Now, as a member of the Java team (although I'm not directly involved in Valhalla), I'm obviously biased so let me just say that both designers and fans of programming language features would do well to remember two things: 1. Opinions…

What's wrong with what .NET did with threads? Having async tasks sharing the GUI thread seems like a nice feature. Will we be able to use virtual threads and structured concurrency with Swing, e.g. to wait for a background task in an event listener?

Re: Project Valhalla, Explained: How a Decade of Work Arrives in JDK 28

#220
post #211

Earlier quoted context omitted.

>> I will continue to enjoy writing once and deploying anywhere! Except to the browser, iOS, embedded systems... WebAssembly is the real write once deploy anywhere tech now. JVM had its turn and lost.

Embedded systems? Like sim cards? There's even real time Java, I think they used it for some missile guidance stuff aswell at some point

> Embedded systems? Like sim cards?

Serious question: I remember the old installer, six billion devices or whatever. I’ve heard about Java ME, old set-top boxes and DVD players, etc.

But how much of that is active today. I can’t say I’ve ever seen a job listing for an embedded Java developer or even Java ME in my entire career. Are people actually still using it?

Post reply on HN