3 ms·
Java has gone full circle. Java had green threads in 1997, removed them in 2000 and brought them back properly now as virtual threads. I'm kinda glad they've
by ysleepy 5mo ago
Java has gone full circle.
Java had green threads in 1997, removed them in 2000 and brought them back properly now as virtual threads.
I'm kinda glad they've sat out the async mania, with virtual threads/goroutines, the async stuff just feels like lipstick on a pig. Debugging, stacktrackes etc. are just jumbled.
- gf000 5mo agoI don't think comparing 97's green threads to virtual threads ever made sense. Like their purpose/implementation everything is just so different, they don't share anything at all.
- delusional 5mo agoJava didn't really "sit it out". It launched CompletableFutures, CompletionStages, Sources and Sinks, arguably even streams. All of those are standard library forms of async programming. People tried to make it catch on, but the experience of using it, The runtime wrapping all your errors in completion exceptions, destroying your callstacks, just made it completely useless.
- jen20 5mo agoEvery Java codebase using something like Flux serves as a datapoint in favor of this argument - they're an abomination to read, reason about or (heaven help) debug.
- iknowstuff 5mo agoIn Rust debugging and stacktraces are perfectly fine because async/futures compile to a perfect state machine.
- comex 5mo agoThey are not perfectly fine. If a task panics then you will get the right stack trace, but there is no way to get a stack trace for a task that’s currently waiting. (At least not without intrusive hacks.)
- tcfhgj 5mo agoWould this be considered an intrusive hack? https://docs.rs/tokio/latest/%20tokio/runtime/struct.Handle.html#method.dump https://docs.rs/tokio/latest/%20tokio/runtime/struct.Handle....
- rwoerz 5mo agoThey stopped at the Promises level with CompletableFuture that lead to "colored frameworks" like WebMVC vs. WebFlux in Spring.
- Sankozi 5mo agoWho is they? Java has moved past those promise based API and avoided async/await mistake.