Developer Roundtable - Clojurescript
“Vaporwave hot dog stand”
This developer roundtable, Casey showcased learnings from his experience using ClojureScript. He is a senior UI/UX engineer and worked at Flagrant previously. He created a game with ClosureScript called Counterspell that was inspired by Strands, the New York Times game.
But first, what is ClojureScript? ClojureScript lets developers write code in a style known as functional programming, and then run that code anywhere that JavaScript can (like web browsers). It is built on top of Clojure, which is a programming language and a dialect of Lisp on the Java platform. ClojureScript uses immutable data structures, or more plainly, once you create information you cannot change it. Additionally, from what I have read from blog posts and related content, ClojureScript fixes a lot of pain points that Javascript has like inconsistent type comparisons, truthy/falsy inconsistencies and unintended type conversions to name a few. To read more about this, here is an article that goes more in depth than this surface level explanation.
Now that we got the foundation for what we are talking about out of the way, let’s get into the meaty bits.
Counterspell, the game Casey created to learn ClojureScript, had a main goal to create words on the board from the options of letter tiles. After you create 3 words, a score will show on the screen letting you know, scrabble points style, the amount of points left on the board. So, the goal is to find 3 words with the highest points so that the remaining letter tiles will be the smallest amount possible. He learned a lot about ClojureScript and here are some take-aways.
The Wins
Interactive development: The whole idea with interactive development is you are taking the notion of REPL (Read-eval-print-loop), all the way to its logical conclusion. You have your text editor and the running session connected to each other. Casey showed an example of the editor open and looking at all the state he had stored in one file (atom file). When changes were made on the running local server, you could see the states of variables, updating in real time. So if he were to select three letters in the application running on his local server, you could see those letters show up in this file live. And this is true also in reverse. If he makes changes on the variable states, those changes show up on the application that is running locally. Pretty neat!
Structure editing: lisp code has all the parentheses and nested lists everywhere describing the tree structure of your program.
Clojure immutable data structures: As described above, if you describe a vector somewhere, you can count on that always referring to the same vector. Even if someone else comes along and tries to get another reference to that vector. This solves the errors that can occur if you have aliases to the same data structure and multiple places where you are editing it.
The Frustrations
Mental model error: Conflating seq and vector.
Sequence abstraction (seq) is one of the central organizing ideas to Clojure’s standard library. A seq is a logical list but it is specifically an abstraction. Like a vector or a list or an inherited Javascript type. The core definitions of seqs are: the function first, which gives you the first thing from the list, and rest, which gives you everything else. Sounds simple but the ramifications are super powerful. Important to know, seqs are lazy. Which means they’ll only evaluate members of the seq that you are asking about specifically.
Vectors are ordered, indexed, immutable collections of values. A fundamental data structure in Clojure, kind of like arrays in other languages. But the big difference is the immutability. A property of vectors is that they are associative unlike seqs. You can care about any position on them, just like an array. Associative means that we’re mapping between key and values but Clojure takes it a step further and says, since vectors are mapping keys that are integers, they are also associative.
The issues with the mental model error was thinking that seqs and vectors are interchangeable. This is obviously not true. The abstraction goes one way. Lots of confusion was had when working with vectors of vectors but using seqs.
Big functions: The base of this is more tactical. Mistakes were made due to being in an unfamiliar programming language. In functional programming, specifically Clojure, the functions are smaller than anticipated. In JavaScript it’s easy to write a big messy first draft and then pull out smaller functions from that bigger one. This is a mistake in Clojure. You want to start small and build the big out of the small. One of the big benefits for doing it this way, is you accrete an abstraction layer around your data by writing small functions.
Overall, it seems like from the conversation that ClojureScript is a really nice expansion and allows for some awesome interactive development as long as you keep the underlying organizing ideas of Clojure in mind. Happy coding!
If you’re looking for a team to help you discover the right thing to build and help you build it, get in touch.
Published on April 10, 2026