Live data from Hacker News

Java 12

jdk.java.net

21–30 of 478 posts

Re: Java 12

#21

Meanwhile, most enterprise apps still seem to only work with JRE 8. And those which I know of have elected to replace Java rather than upgrade.

What stacks are being picked by enterprise for these sorts of projects? C#?

Re: Java 12

#22
I understand why Java has to keep on chugging along, but I feel bad for the people that have to be a part of it. It's like watching people keep coal trains going while people are moving to cars.

Why? Besides being owned by Oracle, which is enough of a reason to never use Java ever again, it's also lost the niches that brought it into existence. Java no longer runs everywhere. Java on the web is dead, and you can now write ubiquitous apps in basically every language. There's no reason to deal with the JVM and it's domain knowledge when you can write a nimble Go app for your backend and a Javascript app that will run on mobile, web, or desktop. A VM language? You mean v8 sandboxing and web workers; WASM which lets me write C, C++, and Rust all of which can talk to Javascript APIs. All of my services are stateless and ephemeral. Crashing is expected, and I can use host monitoring tools instead of introspecting the JDK. On the cloud it gets even worse for Java. Why use a meaty framework like Spring when I want to just spin up a bunch of micro services, or have an API gateway kickoff a bunch of lambda jobs.

Java also took OO in so many terrible directions. OO defined by it's creator looks nothing like the enterprise OO that big business sold to commoditize programming, which now only exists as a ball and chain on legacy systems.

One day Java will be like Cobol. There's probably a lot of money for Java developers for many more decades, but god I do not envy anyone that has to do it.

Re: Java 12

#23

Still nothing to handle checked exceptions in streams properly... sigh.

I share the conclusion of the other statically typed JVM languages (Scala, Kotlin): checked exceptions are bad.

If they are officially bad, remove them from the language. It's a backwards-compatible change. Currently we are in a weird situation, when standard library does not work well with each other. It's like making iPhone without USB-C cable and Macbook without USB-A port.

Re: Java 12

#24

Anybody know how the graal project ties in with all of this? Is oracle effectively developing 3 different JVMs (OpenJDK, Oracle JDK, GraalVM)? Or is there some sort of convergence plan? From what I understand, graal has made a lot of headway with language interop, as well as a handful of specific memory optimizations and native compilation, but overall is lagging in pure throughput/latency performance behind hotspot.…

> overall is lagging in pure throughput/latency performance behind hotspot

Twitter use Graal in production - I think it's about 13% faster for them on their real workloads. If you send a Tweet it's going through Graal.

Re: Java 12

#25
post #11

Earlier quoted context omitted.

or using the switch as an expression System.out.println(switch(day) { case MONDAY, FRIDAY, SUNDAY -> 6; case TUESDAY -> 7; case THURSDAY, SATURDAY -> 8; case WEDNESDAY -> 9; });

That's much nicer. Anything else added to Java recently to reduce the boilerplate? I haven't used Java much in 5-6 years. Glad they are iterating faster.

Local type inference[1] means you can write:

  var foo = new Map();
The static initialisation methods on collections[2] let you write

  var foo = List.of(1, 2, 3);
It's still clunkier than many newer languages but it is improving.

1. https://developer.oracle.com/java/jdk-10-local-variable-type...

2. https://docs.oracle.com/javase/9/docs/api/java/util/List.htm...

Re: Java 12

#26

Meanwhile, most enterprise apps still seem to only work with JRE 8. And those which I know of have elected to replace Java rather than upgrade.

8? I see more 7 or even 6. Until recently I actually thought 8 was the latest until I needed to develop a small project and discovered we were at 11.

Actually, looking at the version history, I guess it's not weird that I thought 8 was pretty recent, as until 1.5 years ago (Sept '17) it was actually the latest and it is still supported until 2020 (unlike 9 and 10).

    v6  2006
        2007
        2008
        2009
        2010
    v7  2011
        2012
        2013
    v8  2014
        2015
        2016
    v9  2017
    v10 2018 
    v11 2018 again
    v12 2019

Re: Java 12

#27
post #6

The most interesting new feature I think is the Shenandoah GC. The summary from [1]: "Add a new garbage collection (GC) algorithm named Shenandoah which reduces GC pause times by doing evacuation work concurrently with the running Java threads. Pause times with Shenandoah are independent of heap size, meaning you will have the same consistent pause times whether your heap is 200 MB or 200 GB." The original algorithm…

GC pauses have been one of the major barriers to using garbage collected (read: higher-level) languages for game development. This could open up the JVM for games, which could have some exciting implications.

Re: Java 12

#28
post #6

The most interesting new feature I think is the Shenandoah GC. The summary from [1]: "Add a new garbage collection (GC) algorithm named Shenandoah which reduces GC pause times by doing evacuation work concurrently with the running Java threads. Pause times with Shenandoah are independent of heap size, meaning you will have the same consistent pause times whether your heap is 200 MB or 200 GB." The original algorithm…

> Pause times with Shenandoah are independent of heap size

I expect this needs to be taken with a chunk of salt, since a smaller heap can only require so much GC...

Re: Java 12

#29
post #19

Meanwhile, most enterprise apps still seem to only work with JRE 8. And those which I know of have elected to replace Java rather than upgrade.

What are they replacing it with?

I see a lot of business apps that use Java on the client side with the JRE. From my observation, they're tending to move towards HTML5 clients, rather than updating to more modern Java versions. The fact that the January 2019 security update, 8u201, is the last version of Java 8 commercial entities can use for free, has pushed this a bit, it seems.

Re: Java 12

#30
post #6

The most interesting new feature I think is the Shenandoah GC. The summary from [1]: "Add a new garbage collection (GC) algorithm named Shenandoah which reduces GC pause times by doing evacuation work concurrently with the running Java threads. Pause times with Shenandoah are independent of heap size, meaning you will have the same consistent pause times whether your heap is 200 MB or 200 GB." The original algorithm…

> Pause times with Shenandoah are independent of heap size I expect this needs to be taken with a chunk of salt, since a smaller heap can only require so much GC...

> I expect this needs to be taken with a chunk of salt, since a smaller heap can only require so much GC...

Pause times. Not GC times. Shenandoah pauses to scan the root set only. The size of the root set doesn't grow with the size of the heap.

You can have a large root set and a tiny heap, or a tiny root set and a massive heap. They're entirely independent.

Post reply on HN