explaingit

clojure/clojurescript

9,383ClojureAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

A compiler that translates Clojure code into JavaScript, letting developers write the same language for both their server-side Java backend and their browser frontend instead of switching between two languages.

Mindmap

mindmap
  root((ClojureScript))
    What it does
      Clojure to JS
      Compiler
      Full stack sharing
    Tech Stack
      Clojure
      Java
      Google Closure
      JavaScript
    Use Cases
      Browser frontend
      Full stack Clojure
      Optimized JS output
    Build Tools
      deps.edn
      Leiningen
      Maven
    Audience
      Clojure developers
      Functional programmers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Write browser UI code in Clojure so you can share data types and logic between your JVM backend and frontend

USE CASE 2

Compile a Clojure web app down to highly optimized JavaScript using Google Closure Compiler's advanced mode

USE CASE 3

Build a full-stack application in a single language with shared code between server and browser

Tech stack

ClojureJavaJavaScriptGoogle Closure Compiler

Getting it running

Difficulty · hard Time to first run · 1h+

Requires Java and a Clojure build tool such as deps.edn, Leiningen, or Maven, familiarity with the Clojure ecosystem is strongly recommended.

Eclipse Public License 1.0, free to use and modify, but if you distribute a modified version it must also carry the EPL license.

In plain English

ClojureScript is a compiler that translates Clojure code into JavaScript. Clojure is a programming language that runs on the Java Virtual Machine and is part of the Lisp family. ClojureScript lets developers write in the same language on the server side (where Clojure runs) and also produce JavaScript for the browser or other JavaScript environments, without switching languages. The compiler is designed to produce JavaScript that works well with Google Closure Compiler's advanced optimization mode. That optimizer can significantly shrink the size of JavaScript output, which matters for web pages where download size affects load speed. ClojureScript is added to a project as a library dependency. The README lists the dependency coordinates for three common build tools in the Clojure ecosystem: Clojure's built-in deps.edn format, Leiningen, and Maven. After that, developers follow the official Quick Start guide on the project's website to set up their first project. Support and discussion happen through the Clojure mailing list, a dedicated ClojureScript user mailing list, a Slack workspace, and an IRC channel. Bug reports and feature requests go through the project's Jira instance. Contributors need to sign a Contributor Agreement and submit changes through the official channels documented on clojure.org. The project is maintained by the same team behind Clojure and is licensed under the Eclipse Public License 1.0.

Copy-paste prompts

Prompt 1
Set up a new ClojureScript project with deps.edn so I can write browser UI code in Clojure and compile it to JavaScript
Prompt 2
Enable Google Closure Compiler advanced optimizations in my ClojureScript build to produce the smallest possible JS output
Prompt 3
Set up live hot reloading for my ClojureScript app so changes instantly appear in the browser without a full reload
Prompt 4
Add ClojureScript to my existing Clojure backend Leiningen project so I can share data types between server and browser
Prompt 5
Set up a ClojureScript REPL connected to a live browser tab so I can evaluate code interactively in the running app
Open on GitHub → Explain another repo

← clojure on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.