John Rose et al has announced recently that java w...
# coroutines
n
John Rose et al has announced recently that java will get fibers a.k.a coroutines ;)
d
do you have a link?
s
Not very exciting, Java can get most of kotlin features and it still won't have them all, or the conciseness. Or most importantly, null safety
n
@defhlt Look for devoxx 2017 John Rose on YouTube
👍 1
@sreich yup that's correct. But legacy is a big and interesting factor. Plus performance is another factor that natural gives java some leverage.
s
Performance of what gives Java leverage? Kotlin is more performant in many areas
n
If you run compute intensive routines like nbody and redux etc you'll see some margin
s
You've actually properly benchmarked this? I don't see how that could possibly be the case.. it's all JVM byte code, and kotlin has other nice things such as inline
n
Yes inline and string interpolation are really good in Kotlin but if you use a similarly tightly packed java code there'll be some margin there
s
this sounds like some real hand waving. and you can do the same in kotlin..ergo java isn't "more optimized"
n
If you argue that way, then runtime intrinsics add a tiny cost too. Can't do anything about that. But that's not the whole point either.
Also don't forget every top level val and fun you add here and there will incur class loader cost. Roughly these factors add up to the margin I'm taking about. But I'm pretty confident that Kotlin compiler/runtime team will improve that further.
I have published back my Kotlin ports yet. I have no idea when and where did you comprehend that I'm basing on assumption rather than findings. But that's fine. It's the internet after all.
i
@nimtiazm I think his assumption was reasonable given that he already asked you if you have benchmarks and you ignored the question. If you have data to support your (unlikely) claim then please show it.
1
p
@nimtiazm that wasn’t an announcement at all, just one of many post-valhalla ideas
n
Of course Oracle’s safe-harbor statement says it can be all vaporware 🙂 . However, experience says whatever those engineers disclose to the public is whatever they’re working on. Yes it’s unclear if it’ll be java 10 or 11 or 12 but the kind of competition they’re getting from languages like Kotlin, they’ll do it sooner than later.
p
coroutines were categorically ruled out for java 10 by mark reinhold.
the talk you are referring to contains ideas for the next 10-20 years of the jvm. most of these things aren’t actively being worked on.
(in a product sense)
the most serious work on java coroutines I’m aware of to date is: http://ssw.jku.at/Research/Papers/Stadler11Master/Stadler11Master.pdf