Live data from Hacker News

Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

infoq.com

431–440 of 555 posts

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#431
post #408
post #387

Earlier quoted context omitted.

Yes, one is a command line command, the other is a part of a build description file, so false equivalents.

Is this a joke? Or you didn't really get the simple point that build description file is not mandatory or even required for other mentioned languages.

But dependencies are somehow needed for Java (otherwise, what are you excluding? Log4j is not there by default)? How is that a fair comparison?

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#432
post #423
post #384

Earlier quoted context omitted.

How does a language favor copy/pasting? Do you mean it makes code reuse harder?

> How does a language favor copy/pasting? It favors as a culture. A little copying is better than a new dependency Just like Java has culture to setup a single http endpoint one typically adds 50-60 little jar files of Spring Boot starter.

> Just like Java has culture to setup a single http endpoint one typically adds 50-60 little jar files of Spring Boot starter

No, you add a single annotation..

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#433
post #392
post #85

Earlier quoted context omitted.

A first class citzen would have support for MAUI, and something better than VSCode like macOS gets VS4Mac.

Does Java even have a MAUI equivalent? There are other open source frameworks for GUI apps. This feels like goal post shifting.

The point is cross-platformness and windows does have MAUI, so not having it on linux means it is not a first-class target.

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#435

Earlier quoted context omitted.

Java's got like the safest most soft-punching NPEs in any language that's got them though. They're so safe you can use them as flow control devices.

yes, but please don't - there's a good dear.

  try { return true; }
  finally { return false; }

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#436
post #119

Earlier quoted context omitted.

I think there are still a few changes in the pipe before Java is quite what it could be in terms of performance. Project Valhalla, and the foreign function and memory APIs in particular.

For non-trivial problems GC performance will be much more important, and Java will beat out go in that category with flying colors.

It is more of generate more garbage / collect more garbage (Java) vs Not generating that much garbage in first place (Go).

This is use case for writing GC benchmarks developers not for typical enterprise CRUD developers.

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#437
post #404

Earlier quoted context omitted.

I've timed it, it's very slow because it uses reflection to generate the model. The annotation processor doesn't let you avoid this step unfortunately. Native images do.

But that step only has to run as part of building it. It doesn’t have to run at every invocation. How did you try to run it? From the documentation: > The picocli-codegen module includes an annotation processor that can build a model from the picocli annotations at compile time rather than at runtime. > Enabling this annotation processor in your project is optional, but strongly recommended. Use this if you’re intere…

I use it but you have misunderstood what it does. It builds a model in memory and then you can use that to do other tasks at build time. It doesn't persist the model in a form that the app itself can use to start up faster.

See here:

https://github.com/remkop/picocli/issues/539

Although looking over that issue, it looks like maybe reflection was never proven to be the source of the slowdowns.

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#438

Earlier quoted context omitted.

I wrote Java code for 20+ years and I can tell you exactly why I prefer Go: it produces native binaries. I mean, it’s also less verbose, easier to start a new project, faster to startup, has far fewer configuration knobs, has native dependency management, is far easier to build CI/CD for, compiles more quickly, has very few NPEs gotchas, has value types, and avoids idiomatic boilerplate. Go is far from perfect, but i…

That was one reason I liked Go as well, it's no longer the case though, you can produce native binaries with GraalVM.

Last time I used GraalVM, there were huge holes in what language features were supported, compiling dynamic code was hit-or-miss, and also its cross-compilation story was not good (requires you to compile it on the target architecture). Perhaps my information is out-of-date now?

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#439
post #223

Earlier quoted context omitted.

Citation needed; first off, verbosity is not the problem, verbosity is NEVER the problem; any significant codebase will end up with millions of LOC (and tokens) regardless of language choice. Second, Java's infamous for having VeryLongClassNameFactoryBeans on the one hand, and deep class hierarchies on the other, with new classes being declared for everything. Third, it depends. You can set up a HTTP server in two or…

To be clear, you think this (using the web server built into the JDK): HttpServer server = HttpServer.create(new InetSocketAddress(8000), 0); server.createContext("/test", http -> http.sendResponseHeaders(200, -1)); server.start(); Contains too much magic?

No, but nobody's going to use it. They're gonna Spring Boot all the things anyway, no matter how small the task, because "you might need it in the future". CRUD API with 4 endpoints? Spring Boot! Logging server? Spring Boot! That's where the magic is.

Re: Virtual Threads Arrive in JDK 21, Ushering a New Era of Concurrency

#440
post #187
post #176

Earlier quoted context omitted.

As a language java's not that bad at this point. But it still has cultural issues. Every java project I encounter tends to be overengineered, has tons of useless boilerplate code and ends up throwing mile-long stack traces as a result. Also, somehow maven manages to be even more unreliable than npm as a package manager. I still frequently encounter situations which seem to only get resolved by throwing away my .m2 fo…

Completely agree with you. I stopped working with Java not because the language or the ecosystem. I stopped working with Java because Java developers and their culture of over-engineering everything defending it as "clean code" and "good practice". But this seems a taboo topic in a culture infested with "good practice gurus".

Theoretically, choosing a JVM language with a good culture seems like a very attractive option. Scala has its own cultural issues, but maybe Kotlin gives you most of the nice parts of Scala without attracting the type astronauts? Maybe Clojure is an option as well, if you're willing to give up static typing? I'm leery of a language with the full power of Lisp macros, but from a distance, the Clojure culture seems to be very pragmatic.
Post reply on HN