News for hackers. Stuff that matters.
Re:Virtual Threads Arrive in JDK 21, Ushering a New Era of C... by marginalia_nu on Wednesday April 12, 2023 @04:32AM (#35536610)
Big part of why native interop is rare because it's slow and awful and generally not worth it.

I don't expect a lot of code to actually use these features, but the code that does will be the low level stuff that lets the higher level stuff really perform.

Re:Virtual Threads Arrive in JDK 21, Ushering a New Era of C... by kaba0 on Wednesday April 12, 2023 @04:36AM (#35536629)
FFI makes cross-platform usage more questionable (have a look at python or node breaking a build on windows vs linux, this is very very rare in case of Java builds), and Java is more than fast enough for most use cases that it simply doesn’t need FFI for speed (like Python for example).

Also, this is a huge advantage of the system, you don’t shallowly depend on a ton of C libraries, you can be confident that your whole application to the last bit is properly abstracted (plus can be debugged and observed with the same great tooling).

Re:Virtual Threads Arrive in JDK 21, Ushering a New Era of C... by marginalia_nu on Wednesday April 12, 2023 @04:44AM (#35536669)
Eh, Java leaves quite a lot of performance on the table compared to C or Fortran. It's not as bad as Python, but if you really want to go fast, it's not quite able to compete with fine tuned native code. The Vector API might help a bit, but I don't think it will go all the way.
Re:Virtual Threads Arrive in JDK 21, Ushering a New Era of C... by MrBuddyCasino on Thursday April 13, 2023 @03:34AM (#35552219)
We'll see how far value objects and the vector API go. The lack of operator overloading makes writing scientific/numerical code a bit awkward, though this could be mitigated by using Kotlin instead.