Live data from Hacker News

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

github.com

51–60 of 185 posts

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

#51

Earlier quoted context omitted.

We've had MMX for a while now, I don't think we need to wait much longer. I don't really see why you would need specific hardware to express a type in a programming language, though.

It's mostly a performance question in order to adhere to Java's memory model.

You can deliberately opt out of it though and for such a mainstream language such as Java, this just might be the sane choice.

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

#52
post #16

It's pretty interesting that while both languages still receive new features, Java seems to stay ahead of JavaScript: - Java has long had a modern replacement for Date, while JavaScript's recently standardized Temporal API still isn't supported in Safari. - Java has switch expressions, while JavaScript, despite its Scheme influence, does not. - And now Java is getting value objects, while JavaScript's equivalent tupl…

> JavaScript was not developed as a fork of Java, but much of its basic syntax still resembles Java, so I think it's fair to compare them.

It's absolutely irrelevant to compare these two languages. Calling the former "Javascript" was just a marketing trick.

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

#53

Really cool, shame that strings can’t be fully indistinguishable like Integer despite their immutability

Is there a theoretical reason why they can’t? As a layman I would assume nothing is preventing it, other than the large amount of effort it would take to implement.

From what I gathered the core problem is flattenability. It is backed by a dynamic array and you would need real templating to remove the indirection.

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

#54
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.

What I love the most is the sheer amount of thought and philosophy put into Valhalla. It transcends the binary understanding of object vs value and actually defines 4 distinct buckets:

1: Classical Object

2: Object without identity

3: Atomic Value

4: Classical Value (Tearable)

Each bucket has clearly defined performance characteristics and semantic constraints. So depending on the nature of your data, you can always get some benefit from values even if you couldn't go all the way. This is a work of art.

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

#55
post #44

Earlier quoted context omitted.

java the language is amazing the problem with it is entirely cultural. why is `IStatusChangeEntityCreationManagerFactory` everywhere? and why are the frameworks so huge and all encompassing? i think batteries included rails-style frameworks are great, but when i wrote Java, it didn't feel like rails at all none of these are language problems

I know and like Java for almost 30 years now. It is amazing how carefully the language is beeing refined. For the cultural aspect, yes, that is sadly true, but I have the feeling that the culture changes. More and more developers realize that there is a better way now (e. g. records instead of dumb classes full of getters and setters). Maybe the main problem is bloated frameworks and their stickyness. The Helidon fra…

IMHO, the main reason why Spring is huge is because it has grown organically to encompass many of the business cases/issues that one may encounter in both depth and breadth. So the http framework supports almost everything you may ever need and there is integration with every database, middleware, infra like kubernetes. (One can debate about the quality of all the lesser used modules but the main modules are pretty okay.)

On the other hand I have used Quarkus which was great until it wasn’t because a certain http feature wasn’t supported or we needed integration with an unsupported database. In enterprise that is enough reason to just choose for the batteries included option and lift along on improvements of the main framework.

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

#56
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.

Today it is a great language with a runtime that is unequaled. For heavy duty business backend server load, it is the standard choice, and rightfully so. Do I love Spring? No. Do I prefer Typescript for my little side projects? Yes.

Fortunately, there are plenty of mature alternatives to Spring these days.

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

#57
post #16

It's pretty interesting that while both languages still receive new features, Java seems to stay ahead of JavaScript: - Java has long had a modern replacement for Date, while JavaScript's recently standardized Temporal API still isn't supported in Safari. - Java has switch expressions, while JavaScript, despite its Scheme influence, does not. - And now Java is getting value objects, while JavaScript's equivalent tupl…

I personally would never compare the two. Someone said: java to JavaScript is like car to carpet. And I completely agree with that.

> Someone said: java to JavaScript is like car to carpet.

You mean the sibling who commented five minutes before you?

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

#58

What's the latest status? Is it still limited to 63-bits of data plus 1 bit for nullability?

Unless CPU instructions become widespread that allow to process 128 bits in one step, then yes. Java will have the same limitations as any other language. Other languages simply don't make this explicit.

But if I don't care for object atomicity, can I get struct-like behaviour in Java for arbitrary large types?

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

#59
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.

You are not alone.

Java remains unfairly tethered to a reputation forged over 20 years ago. Human psychology reveals a reluctance to update our worldview: once a collective consensus solidifies, it becomes very difficult to dismantle. Yet, to dismiss Java today is to overlook a remarkable evolution. Modern Java is an elegant, highly capable language, resting upon the Java Virtual Machine, which is a remarkable piece of technology.

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

#60

Earlier quoted context omitted.

Today it is a great language with a runtime that is unequaled. For heavy duty business backend server load, it is the standard choice, and rightfully so. Do I love Spring? No. Do I prefer Typescript for my little side projects? Yes.

Fortunately, there are plenty of mature alternatives to Spring these days.

Agreed but apparently BigCorp hasn’t gotten the news yet.
Post reply on HN