News for hackers. Stuff that matters.
Re:What Color Is Your Monad by cube2222 on Wednesday February 16, 2022 @10:00AM (#30360828)
> you should just bite the bullet and make everything red

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.

Re:What Color Is Your Monad by jayd16 on Wednesday February 16, 2022 @11:52AM (#30362343)
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.
Re:What Color Is Your Monad by jayd16 on Wednesday February 16, 2022 @12:41PM (#30363032)
Kotlin does seem to do it well although Kotlin functions are still considered colored.