I'd love to get some clarification or thoughts fro...
# language-evolution
y
I'd love to get some clarification or thoughts from someone in the Kotlin team who worked on Coroutines' design about this: https://discuss.kotlinlang.org/t/coroutine-vs-job/22049/13 since tbh I'm starting to doubt everything I know about Coroutines now lol!
g
Thoughts about what? Looks as quite pointless bike-shedding about terms
y
It's more about what the definition of a coroutine really is? Like is it simply a continuation, or is it a more abstract term? There's multiple design questions in the thread, and so a Kotlin team response would help reduce some ambiguity
g
It’s an abstract term which has particular implementation in the language
I just want to point out that original question is pretty simple “Why does the library include an extra Job abstraction (e.g “a handle”) for tracking the lifecycle of a Coroutine”, but then discussion goes to some strange direction
y
Well and then what exactly is the implementation is the language? Yes the first question is no longer the issue here. I'm just curious about what exactly is equivalent to a coroutine in the language.
g
There are many parts of implementation
Continuation is essentially a step of coroutines state machine
but that's really not what you want to be thinking about, most of the time
kotlin compiler and stdlib kotlin.coroutines provide some basic infrastructure for transforming linear code into state machines with CPS
kotlinx.coroutines (the x is important) builds structured concurrency on top of that
when you're working with "coroutines" you're almost certainly dealing with the kotlinx.coroutines abstractions