tl;dr:
- Simplicity of the tech stack to run a full-stack “Hello world”. Emancipate from Java and Clojure.
- Tooling to support editing the “hello world” into something else. Emancipate from Emacs.
- Compatibility with modern deployment options, e.g. serverless. Emancipate from the server.
- Comprehensive examples for beginners to start from a working environment, especially for full-stack & serverless. Emancipate from the appalling documentation (some documentation is always necessary).
In the spirit of Christmas Mary Poppins, I have decided to make a list of nice things to have for beginners in ClojureScript. The kind of things that cause friction and put me down, honestly. It may be different for other beginners. It may be useful for anyone wondering “What do beginners struggle with?”, or how to help beginners to get up to speed with ClojureScript. Hoping this is useful for anyone.
The first problem is the dependencies from the tooling for Clojure and Java. Doing full-stack in Clojure & ClojureScript was nice because it allowed the use of the same language, reducing cognitive load when compared to Java & JavaScript (or anything & JavaScript). Today, Node.js allows for JavaScript in the backend, and using Clojure & ClojureScript comparatively increases the cognitive load by having not two languages but two tech stacks. Lein and the rest of the tooling for Clojure is wonderful, but it needs to be redundant for full-stack ClojureScript projects.
The second is the dependencies from the tooling for Emacs. IIRC: Try to install Cava, the recommended and possibly most comprehensive plugin for VSC, the most popular IDE, and if you happen to be using the vim keyboard configuration you are basically greeted with a “uh, oh, you should not have done that…” There are good tools for well supported languages, but the two most important IMHO are:
- Reformatting when saving, which should include parinfer IMHO.
- Linting while writing (or occasionally), highlighting found problems like unused dependencies and efficiency problems (accessing members through reflection was one of the potential performance problems IIRC).
- Code navigation and more advanced features are also nice to have, as long as they do not conflict with developer choices and other tools.
In fairness, these tools exist. What is missing is an easy unopinionated integration with ClojureScript and non-emacs IDEs (esp. VSC e.g. when using vim keyboard settings).
An easy way to address all of this would be easily runnable “hello world” projects. They should look like this:
git clone <hello_world_url> && cd hello_world
yarn install && yarn run
Before:
- Requirements: git, yarn (which already includes node.js).
- Nice to have: popular IDE with a non-conflicting plugin.
i.e.
- It should be a
clone & run
approach, not a RTFM with a few thousandsetup & config
steps. - To make this possible, two things are required: a simple tech stack, and examples that use it.
Also nice to have: yarn build:production
, exporting to JS, to deploy easily in serverless platforms, like Google App Engine, Amazon Lambda, Supabase, Vercel, Netlify, surge.sh, GitHub pages, etc. The final conversion to JS is a significant friction point, e.g. see online tools like CodePen, allowing to share code snippets in languages compiling to JavaScript easily, but not ClojureScript. Jamstack and static pages are probably a nice way to have something nice to attract beginners, with the equivalents of Gatsby and Eleventy, but until the serverless part is similarly seamless, other languages compiling to JavaScript will keep the upper hand.
In summary:
- Simplicity of the tech stack to run a full-stack “Hello world”. Emancipate from Java and Clojure.
- Tooling to support editing the “hello world” into something else. Emancipate from Emacs.
- Compatibility with modern deployment options, e.g. serverless. Emancipate from the server.
- Comprehensive examples for beginners to start from a working environment, especially for full-stack & serverless. Emancipate from the appalling documentation (some documentation is always necessary).
The syntax and semantics of the language were never a problem. Clojure for the Brave and True is more than enough to be able to read Clojure and ClojureScript code, and there is in general a healthy community for questions, reading code examples, open-source projects, etc. Rather than writing hundreds of pages about how wonderful the feedback loop is with Figwheel (so that beginners will be motivated to cross the chasm to the Clojure world), just throw it in for free in the welcome package git clone && yarn start
.
I can imagine among the usual responses there will be something like: “that is not the Clojure way, here we favor configuration over convention”, which, fair enough, you do you. I simply wanted to mention that the advantage of Clojure & ClojureScript for homogeneous full-stack was a good moat, and made the moat keeping beginners at bay perhaps even necessary. “Linux is user-friendly and selective with its friends”, and so was Clojure, and that is perhaps good; selectivity favors quality over quantity. But with Node.js that moat was destroyed, and the quality-quantity balance broke. I think Clojure and ClojureScript are still much better languages than JavaScript, and other languages compiling to JavaScript, but there is strength in numbers, and without addressing these friction points for beginners, I think ClojureScript will gradually slide into irrelevance, which is sad, being probably the best front-end language we will ever see. A possibly fair but unexpected criticism of this post could be “thank you captain Obvious/Hindsight!”
In any case, as I said, I hope this helps.
PS: possibly all of this exists, but there is a “needle in a haystack” feeling to it.