ClojureScript Gets Async/Await

· coding · Source ↗

ClojureScript 1.12.145 ships native async/await support, targeting ECMAScript 2016. The ^:async hint emits JavaScript async functions directly, eliminating third-party dependencies for modern Browser API and popular library interop.

What Matters

  • ^:async metadata on defn causes the ClojureScript compiler to emit a native JavaScript async function.
  • await works inside let bindings, including nested lets, enabling structured async control flow without special macros.
  • ^:async also works on deftest blocks, enabling async test assertions with try/catch.
  • Async function support topped the most-recent Clojure community survey as the most-wanted ClojureScript JS interop enhancement.
  • Contributor credited: Michiel Borkent (known for babashka and related Clojure tooling).
  • ClojureScript previously relied on core.async (CSP-style channels) for async—a heavier, conceptually distinct model than promise-based async/await.

Original | Discuss on HN