logoalt Hacker News

DarkNova6today at 7:22 AM4 repliesview on HN

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.


Replies

spacechild1today at 8:18 AM

IIUC value objects can have any size, it's just that 'reference flattening' requires the object to fit into a machine word. But this is only due to how Java represents object references and its atomicity guarantees.

Naturally, a language that properly supports value semantics does not have any of these limitations.

show 1 reply
Smaug123today at 7:51 AM

I don’t understand this comment - the .NET CLR supports arbitrarily large value types. Are you referring to something like “atomic flattening of those types” instead? Because the CLR doesn’t guarantee that, and therefore supports flattening.

show 2 replies
jeroenhdtoday at 8:08 AM

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.

show 3 replies
HexDecOctBintoday at 10:26 AM

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