Nice talk about what is under the hood of llvm coroutines:
https://www.youtube.com/watch?v=Ztr8QvMhqmQ▾
v
voddan
03/17/2017, 6:30 AM
Very interesting. AFAIKT, they never even considered stackless coroutines (what kotlin does)
My guess is that Kotlin woun't need the LLVM support because they are in the compiler
g
gildor
03/17/2017, 7:55 AM
@voddan Their implementation is stackless (compile time)
v
voddan
03/17/2017, 8:37 AM
@gildor Why they need the LLVM support then?
g
gildor
03/17/2017, 8:39 AM
@voddan I’m not a familiar with LLVM, I just watched this talk and coroutines in their implementation is stackless and it works on llvm level - http://llvm.org/docs/Coroutines.html
d
dmitry.petrov
03/17/2017, 9:48 AM
@voddan LLVM support is required if you want coroutines to be as optimized as regular code. Note that (skipping details related to compiler internals) in the end the suspend calls are inlined, and it "feels" just like regular imperative code.