Somewhat famous article about state of asynchronous programming model of many languages, states that they have a "color" problem, which, in particular, divides the ecosystem into two seperate worlds: async and non-async. Here are properties of such a language:
- Every function has a color, either red or blue (e.g.
async def) - The way you call a function depends on its color (e.g.
await) - You can only call red function from within another red function,
SyntaxError: 'await' outside async function - Red functions are more painful to call (the idea is that if you decide to make a function red, everyone using your API will want to spit in your coffee and/or deposit some even less savory fluids in it)
- Some core library functions are red, so you can't avoid red functions
Kotlin is pretty new language, so I thought I should look into its asynchronous model. However, Kotlin transpiles to JavaScript, so I believe it has color problem more than I believe it doesn't. But its coroutines were a bit hard for me to gross and got confused, so I'm here asking Which of those properties are true for Kotlin? (and how much of color problem it solved).