Generated by DeepSeek V3.2| ClojureScript | |
|---|---|
| Name | ClojureScript |
| Paradigm | Functional programming, Lisp |
| Designer | Rich Hickey |
| Developer | Cognitect |
| Latest release version | 1.11.60 |
| Latest release date | 21 December 2023 |
| Typing | Dynamic typing, strong |
| Influenced by | Clojure, Scheme, Common Lisp, Haskell |
| Operating system | Cross-platform |
| License | Eclipse Public License |
| Website | https://clojurescript.org/ |
ClojureScript. It is a compiler for the Clojure programming language that targets JavaScript. Developed as a sister project to the JVM-based Clojure, it enables developers to write expressive, functional code for web browsers and other JavaScript engine environments. By leveraging the Google Closure library and compiler, it produces optimized, production-ready code, allowing the same language and paradigms to be used across both server-side and client-side development.
ClojureScript emerged from the work of Rich Hickey and the team at Cognitect, seeking to extend the principles of Clojure to the ubiquitous web platform. It compiles directly to JavaScript, making it compatible with all major web browsers like Google Chrome and Mozilla Firefox, as well as platforms such as Node.js and React Native. The language inherits its core philosophy from Lisp, emphasizing immutable data structures, first-class functions, and a powerful macro system. This design allows developers to build complex, interactive applications for the World Wide Web while maintaining a consistent development experience with its JVM counterpart.
A primary feature is its emphasis on immutability and persistent data structures, which are provided by the core library shared with Clojure, simplifying state management in dynamic applications. The language incorporates software transactional memory and core.async libraries for managing concurrency and asynchronous operations. Its REPL-driven development workflow, integrated with tools like Figwheel, supports rapid feedback and hot reloading. Furthermore, it utilizes the Google Closure Compiler for advanced dead code elimination and minification, often resulting in smaller web application bundles compared to many JavaScript framework alternatives.
The ecosystem is supported by a variety of build tools and development environments. The primary build tool is Shadow CLJS, which simplifies configuration and integrates seamlessly with the npm ecosystem. Traditional tooling includes Leiningen and the Clojure CLI tools, often used with plugins like Figwheel Main. Development is commonly done within editors like Visual Studio Code with the Calva extension or IntelliJ IDEA with the Cursive plugin. The community also maintains libraries such as Reagent and Helix for building user interfaces atop React, and Fulcro for full-stack applications.
It is designed for seamless interaction with the host JavaScript environment. Developers can directly use JavaScript objects and arrays via the js/ namespace and call any JavaScript library or API, including those from the npm registry. The language provides the cljs-oops library for convenient property access and supports JavaScript interop syntax for method calls and property lookups. This allows integration with major frameworks like React, Vue.js, and Angular, as well as Node.js modules, enabling the use of existing ecosystem tools and libraries.
It is used for building sophisticated single-page applications and interactive web dashboards across various industries. Notable companies adopting it include Nubank, Walmart, and Apple for internal tools. The re-frame library, built on Reagent, is a popular pattern for managing application state in the MVVM style. Beyond the web, it targets mobile app development through React Native and desktop applications via Electron. Its use in projects like Metabase and Light Table demonstrates its strength for data visualization and developer tooling.
Category:Clojure programming language family Category:JavaScript programming language family Category:Lisp programming language family Category:Cross-platform software Category:Programming languages created in 2011