News for hackers. Stuff that matters.
Re:Java 26 is here, and with it a solid foundation for the f... by zadikian on Tuesday March 17, 2026 @06:37PM (#47419310)
Lack of virtual threads was its biggest remaining problem because this made the common ways of doing cooperative multitasking very ugly. Go's big thing was having that from the start. Maybe now that Java has it too, it's set?

Though JS will still have the least boilerplate because of the way it handles types.

Re:Java 26 is here, and with it a solid foundation for the f... by deepsun on Tuesday March 17, 2026 @08:04PM (#47420064)
IMO, Kotlin coroutines are better of Go's goroutines, although they are a little different beasts to compare honestly (apples and oranges). Go inits goroutines on stack, but min size is 4KiB, so it's not trivial to grow them. Also you need to watch over and destruct goroutines manually to prevent memory leaks (using

   var wg = sync.WaitGroup
   defer wg.wait()

   wg.Add(1)
   go func() {
      defer wg.Done()
   }
)

And create a separate channel to return errors from a goroutine. Definitely more work.

Re:Java 26 is here, and with it a solid foundation for the f... by zadikian on Tuesday March 17, 2026 @08:18PM (#47420151)
It is, but your typical backend code isn't dealing with that most of the time. You can just use blocking I/O in handlers.
Re:Java 26 is here, and with it a solid foundation for the f... by Ternari on Tuesday March 17, 2026 @11:17PM (#47421244)
>you need to watch over and destruct goroutines manually to prevent memory leaks

No, you don’t. Any stack-allocated resources are freed when the function returns. WaitGroup is just there for synchronization.

Re:Java 26 is here, and with it a solid foundation for the f... by HendrikHensen on Wednesday March 18, 2026 @03:33AM (#47422678)
Kotlin coroutines don't really exist. They're a (very neat) programming trick to support coroutine-like behavior on the JVM which doesn't support coroutines. If you look at the bytecode it produces, it honestly is a mess. And it colours your functions too: now you have be ever careful that if your function is running in a coroutine, there are certain things you should absolutely avoid doing in that function, or any function called by that function (like spinning the CPU on loop without yielding). In Go, you don't have to worry about any of this because the concurrency is built-in from the start.

Also I don't understand "it's not trivial to grow them". It is trivial to grow them, and that's why Go went this way. Maybe only 0.1% or fewer of use-cases will ever find any issues with the resizing stack (in fact probably the majority of uses are fine within the default starting stack size).

Re:Java 26 is here, and with it a solid foundation for the f... by gf000 on Wednesday March 18, 2026 @04:00AM (#47422890)
> Kotlin coroutines don't really exist. They're a (very neat) programming trick to support coroutine-like behavior on the JVM

Well, guess how coroutines are implemented in Rust/C++/everywhere else!

Nonetheless, I do think that java virtual threads are superior for the vast majority of use cases and they are a good default to reach for for "async" like code.

Re:Java 26 is here, and with it a solid foundation for the f... by HendrikHensen on Wednesday March 18, 2026 @03:30AM (#47422651)
I think there is something to say for compiling to native code, having binaries in the ~25 MiB range, being able to run in distroless containers, being able to run a web application with less than 100MiB of memory and startup times measured in milliseconds rather than seconds (sometimes dozens of seconds).

Don't get me wrong, I like Java and don't very much like the Go language. But Java has a lot to improve upon still.

Re:Java 26 is here, and with it a solid foundation for the f... by gf000 on Wednesday March 18, 2026 @03:58AM (#47422881)
Small java programs start up well in the milliseconds.

I don't really think it's fair to compare some old jboss monstrosity doing the job of a whole kubernetes cluster to a dumb hello world server written in go.

Sure, java startup time is and will probably always be worse than putting everything into a single binary - but it is way overblown in many discussions. I have a bunch of Quarkus services on my home server and they start up immediately.

Re:Java 26 is here, and with it a solid foundation for the f... by ludovicianul on Wednesday March 18, 2026 @05:59AM (#47423643)
With Quarkus (and other new frameworks) you can have webapps with less than 100MiB. Startup times in a couple of miliseconds. CLI apps, with limited number of third party libraries are under 40-50MiBs.
Re:Java 26 is here, and with it a solid foundation for the f... by lenkite on Wednesday March 18, 2026 @08:33AM (#47424934)
You can have a <20MiB Graal-compiled binary for a Java project if you use a lean framework like Micronaut. Memory footprint is 5–40 MB RSS.
Re:Java 26 is here, and with it a solid foundation for the f... by winrid on Wednesday March 18, 2026 @08:43AM (#47425068)
But with graal isn't the min compile time on avg hardware like a minute?
Re:Java 26 is here, and with it a solid foundation for the f... by gf000 on Wednesday March 18, 2026 @10:28AM (#47426236)
Yeah, but you only have to do that before shipping. You can just test/develop with "normal" java, you even get hot-reloading.