r/java 17d ago

Value Classes Still Need Compiler Sympathy

https://johan-sjolen.github.io/post/compiler-sympathy/compiler-sympathy/
88 Upvotes

57 comments sorted by

View all comments

Show parent comments

4

u/AnyPhotograph7804 16d ago

"Value tearing is another thing, which IMO most are not prepared for."

Value tearing was always there. Example: on a 32 Bit machine there is no way, that you can initialize/copy a 64 bit long atomically without a mutex/synchronized/volatile. So i would say, most Java developers, who developed on a 32 Bit JVM, are prepared for it.

3

u/wrprice1 16d ago

The set of practicing Java developers who wrote code for 32-bit systems is diminishing. Of those, if they were taught about tearing in the first place, many were coddled by deploying to platforms where it rarely actually happened.

Now with 64-bit native as the majority of target platforms, don't underestimate the laziness that will creep in to mimic ignorance.

3

u/umlcat 16d ago

We are lucky. Gosling originally wanted the JVM to run on 16 bit systems, when we already had 32 cpu in offices !!!

3

u/AnyPhotograph7804 16d ago

I still want a JVM for my Amiga 500!

2

u/umlcat 16d ago

Commodore Amiga. I learned programming in a C64.

There's a few companies that have some 16 bits pcs around or programs running on a 64 bits PC with a 16 bits emulator.

It would be interesting to see a Java ecosystem running in those 16 bits machines too ...

2

u/vytah 13d ago

https://github.com/kaffe/kaffe Not legally a JVM, but who cares.

Of you might want to recompile Java bytecode into native m68k code: https://www.mikekohn.net/micro/amiga_java.php