Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

async/await is nice, but futures/promises and core.async in Clojure are more powerful and useful.


Citation please?

Clojure has some awesome libraries, but unless you can show some use cases where futures/promises and core.async make it possible (or even just easier) to implement functionality compared to async/await (or F# async) I'm not inclined to take your word for it.


CSP gives you everything async/await gives you, plus more. Channels can act as throw away promises, or as continual streams of events. Add to that the power of alt! (http://clojure.github.io/core.async/#clojure.core.async/alt!) and you got some very powerful primitives. There's nothing about async/await that's really new. You can implement these on top of yield (C#/Python), or with any language that supports the pausing and resuming of execution.

In Clojure CSP is implemented as a library (core.async), no changes to the compiler needed. Now that's power.

(disclosure, I helped write core.async)


I agree, async is much more flexible and powerful when it's a library feature (as it is in F#) as opposed to being a built-in language feature (as it is in C# 5).

core.async looks very well-rounded, congratulations on a fine job.


Replying to myself, since I can't edit my post anymore --

Futures and promises aren't unique to Clojure. For example, AliceML had them ages ago.

After thinking it over, I'm going try implementing them for my ExtCore library for F# (https://github.com/jack-pappas/ExtCore). Thanks to the GP for the idea.


async/await is just a generator function that yields promises. It is implementable even in node.js if you enable --generators flag.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: