News for hackers. Stuff that matters.
Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by pkulak on Monday May 02, 2022 @02:14PM (#31238713)
Well, this kinda thing isn't free. You need a rather large and complicated runtime to make it work. Fine for the JVM, which is already a large and complicated runtime, but it turns out that making a runtime like this optional is not really possible. So languages that don't have a runtime are stuck with async/await, which can be zero-cost.

And, to be fair, languages like Erlang and Go went this route LONG ago.

Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by moonchild on Monday May 02, 2022 @08:29PM (#31242863)
> languages like Erlang and Go went this route LONG ago

So did java! It originally used green threads, before switching to exclusively kernel threads.

Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by SemanticStrengh on Monday May 02, 2022 @02:32PM (#31238977)
Except GraalVM bring support to almost any language
Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by Comevius on Monday May 02, 2022 @02:56PM (#31239288)
Garbage collectors and preemptively scheduled virtual threads require a runtime. Even GraalVM Native Image has a large runtime for this reason. There is no free lunch here.
Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by pjmlp on Monday May 02, 2022 @03:49PM (#31239979)
All high level languages have a runtime, the only difference among them is how big it is in practice.

Even Assembly can be considered to have one, in case of microcoded CPUs.

Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by SemanticStrengh on Monday May 02, 2022 @03:19PM (#31239568)
I'm just saying the cost of developing the runtime can now easily be mutualized between multiple languages
Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev... by thfuran on Monday May 02, 2022 @02:45PM (#31239147)
That's some hefty sleight of hand.