I’m curious about how the kotlin compiler works wi...
# compiler
t
I’m curious about how the kotlin compiler works with coroutines. Currently I’m looking the official kotlin repository(https://github.com/JetBrains/kotlin), but there are a lot of modules and it’s hard to figure out where to start. Could you guys give me some guidance?
1
r
Coroutines is a library. Try searching for suspend in the compiler. Coroutines and other libs are built on top of suspend providing a runtime implementing startCoroutine... Methods published in the suspend intrinsics of the std lib
Suspend functions are translated into Function2 with an extra Continuation argument
The compiler also controls restricted suspension over receivers
There are psi, descriptors, utilities and pretty much presence of suspension related stuff everywhere including the idea plugin for Kotlin
What is it that you are trying to accomplish? I may be able to point you to the right place since I've looked into this before
t
I have no special purpose now. Just for satisfying my own curiosity. I’ll look into it based on your comments. Thank you! simple smilearrow
👍 2