Re:I Believe Zig Has Function Colors
by anonymoushn on Saturday April 09, 2022 @11:05AM
(#30968645)
I don't have much to add to this. These are real issues, and we have encountered and needed to fix them, and we probably will many more times. I would like to one day use tools that don't have these problems but also don't compromise on composability.
The problem is that the library author must then code for the worst case and the compiler won’t help them; injecting preemption into synchronous code can expose things about it that used to be unobservable, but now can make the difference between success and deadlock. (Similarly to how injecting mutation into pure code can expose—and bar the optimizer from changing—things that were previously unobservable, like “in which order does map() visit elements?”.)
There still will be async-compatible and async-incompatible libraries, except now you can’t tell which one is which except by looking at the documentation—look at the lengths R5RS goes to in order to define things like returning multiple times from inside a letrec while R6RS just flat out prohibits that.
Yes, this seems to be a pro-colouring comment while elsewhere in this discussion I make what seem to be anti-colouring comments. I really don’t know what the answer is.