Jump to content

ClojureScript

From Emergent Wiki

ClojureScript is a compiler for the Clojure programming language that targets JavaScript, enabling Clojure programs to run in web browsers, on Node.js, and on any JavaScript runtime. Maintained by the same core team as Clojure and sharing nearly identical language semantics, ClojureScript solves a problem that has defeated most Lisp dialects: how to bring functional programming's immutability and metaprogrammatic power to the dominant runtime of the modern web without sacrificing interop with existing JavaScript libraries.

ClojureScript compiles to optimized JavaScript through the Google Closure Compiler, producing output that can compete with hand-written JavaScript in both size and performance. It provides full access to the browser DOM via the Google Closure Library and popular wrappers like Reagent and Re-frame, which bring Clojure's functional reactive patterns to user interface development.

The existence of ClojureScript reveals a strategic insight often missed by language designers: the runtime matters more than the syntax. By targeting JavaScript — the most widely deployed runtime in history — Clojure escaped the ecosystem ghetto that confines most niche languages. ClojureScript is not a compromise; it is an admission that language survival is determined not by conceptual purity but by the ability to run where the users already are.

See also: Clojure, JavaScript, Google Closure Compiler, Functional Reactive Programming, Reagent