NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
ClojureScript Gets Async/Await (clojurescript.org)
timwis 1 hours ago [-]
I wish an alternative to JS for the front end would catch on and be something more than obscure... I'd love to use something like clojurescript, but I struggle to imagine doing so for anything but a personal side project :/ Maybe this is easier to adopt if you're already a clojure shop for the backend?
jwr 54 minutes ago [-]
Don't be afraid, it's great! I certainly wouldn't call it "obscure", I've been using it for 10 years now to compile a complex app into highly-optimized client-side code. And the community is very welcoming and mature.
oDot 1 hours ago [-]
You should try Gleam. I'm using it in production to great delight:

https://blisswriter.app/

https://blog.nestful.app/p/how-we-dropped-vue-for-gleam-and

midnight_eclair 2 hours ago [-]
fun fact: clojurescript had support for asynchronous paradigm through core.async library (CSP style) long before async/await landed in javascript itself.

edit: i'm in no way trying to diminish the value of this release, just pointing out how cool it is that you can get new language features before they are available in the host language by just adding a library to your dependencies. clojure is awesome!

KingMob 1 hours ago [-]
True, but there are many reasons to avoid core.async, especially in 2026.

It balloons up the Js artifact, has no inherent error model, and transforms into state machine code that's hard to read/debug if something goes wrong. Plus, the `go` macro encourages overly-large functions, because it can't transform code outside its own sexpr.

As one Cognitect put it, "core.async is beautiful nonsense".

stingraycharles 3 minutes ago [-]
For me it also lacks observability. It has been a few years since I last used Clojure, but I found manifold to be a much better fit for actual production code that you want to optimize.

I loved ztellman’s “everything must flow” talk on the topic.

jwr 49 minutes ago [-]
> has no inherent error model

I'll pitch in here, as I've been doing a lot of thinking about this issue and ended up writing my own (tiny) tools for handling anomalies, modeled on the very well thought-out https://github.com/cognitect-labs/anomalies categorization.

This is actually a much wider problem and not specific to core.async. Handling anomalies is difficult. It used to be that you would have exceptions and errors which would be thrown, unwinding the stack. This pattern no longer works in asynchronous code, or code that needs to pass anomalies between the server and the client. In practical applications, an anomaly might need to be returned from a function, passed through a `core.async` channel, then thrown, unwinding the stack on the server side, then caught and passed to the client side over a WebSocket, and then displayed to the user there.

Solving this well is not easy. I think my toolkit, iterated and improved over the years, is close to what I need. But I'm pretty sure it wouldn't handle all the real-world use cases yet.

But again, this is not specific to core.async in any way.

alhazrod 30 minutes ago [-]
What is your opinion on farolero[0]?

[0]: https://github.com/IGJoshua/farolero

ares623 1 hours ago [-]
And here I thought I was too dumb to grok core.async all those years ago (ps I still am)
boczez 28 minutes ago [-]
Massive, cheers dude and congrats on the release. I’d say it’s such a good time to get into Clojure/Script but, well … it has been for a while!
slifin 38 minutes ago [-]
This is important for JavaScript interop without having to include additional libraries very cool and was missing for a long time

Congratulations on the release :-)

nbardy 1 hours ago [-]
Seems like wrapping async await functions with CSP was a better way to handle this . Clojure already had a nicer pattern for this
midnight_eclair 1 hours ago [-]
this release is about exposing the host language primitives to clojurescript

core.async isn't going anywhere, if async/await works better than promise based implementation, core.async will get an update in it's .cljs parts

rockyj 39 minutes ago [-]
Nice! Now also get rid of the elephant in the room - "Google Closure Compiler" and then we can really celebrate.
Jach 20 minutes ago [-]
Is that something people want to get rid of? Back when I did some clojurescript people were pretty proud of being able to have it used automatically. What's the plan to get the same benefits? Or is the argument that the benefits aren't significant 15ish years on?
zerr 2 hours ago [-]
For the moment thought the article was about CoffeeScript... But it already supports async/await :)
rpastuszak 7 minutes ago [-]
I can finally use this little brain worm that has lived in my head for more than a decade now: IcedCoffeeScript has existed for ages https://maxtaco.github.io/coffee-script/ since well before ES got it.
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 10:17:31 GMT+0000 (Coordinated Universal Time) with Vercel.