4 ms·
we're mixing up language implementation issues and the underlying primitives. https://github.com/athos/kitchen-async https://github.com/athos/kitchen-async off
by ithkuil 7y ago
we're mixing up language implementation issues and the underlying primitives.
https://github.com/athos/kitchen-async https://github.com/athos/kitchen-async offers a macro-based pure clojure expansion/unwinding of calls to functions returning promises, in a way that is similar to what javascript does with their treating of functions annotated with the async keyword that invoke other functions through the await keyword.
For me, the interesting bit is more in the difference in the primitive building block: a channel of values (where nil is disallowed) vs the result of a "computation" which can either succeed or fail.
The channel approach is the most minimal; in fact you can implement a "computation" on top of the channel approach by passing tuples of (result, error) in a channel and then closing it.