3 ms·
It solves the coloring problem by not having a coloring problem in the first place. Maybe I should have said "avoids the function-coloring problem".
by rdw 6y ago
It solves the coloring problem by not having a coloring problem in the first place. Maybe I should have said "avoids the function-coloring problem".
- Rapzid 6y agoI believe the example in the article "avoids the function-coloring problem" by completely avoiding its problem space of continuing the execution of an imperative block of code after starting an asynchronous task to produce some value, and then synchronizing at the production of that value. In the example each code block run in a fiber blocks at Net::HTTP.get and only continues after it returns a value. Looking at the API for Fiber.. It looks like "resume" returns the yield(generator) or fiber return value? So Fibers can be treated as a sort of Promise? As soon as you start returning fibers from methods you have the coloring problem..