I don't think its so easy. Go goes a bit too far and makes the scheduling pre-emptive which can make targeting a specific thread (like a UI thread) harder.
I think an ideal language would need to support cooperative threading and binding to specific thread contexts.
Re:What Color Is Your Monad
by yencabulator on Friday February 18, 2022 @06:03PM
(#30392343)
You can make goroutine == OS thread with a single function call, where it matters: https://pkg.go.dev/runtime#LockOSThread
Re:What Color Is Your Monad
by metaltyphoon on Wednesday February 16, 2022 @12:39PM
(#30362988)
Don’t know much but i thought Kotlin did this.
I agree! It's also what I've been seeing in i.e. Scala, where everything is converging to a single Monad. And in that case, monads are basically unnecessary. The point of them is to be able to customize your function colors.
Just use a language whose semicolon/newline semantics reflect the functionality you'd otherwise get with your "red" monad stack.
For me that means Go, where everything is async by default.