Clojurists Together project update #2

I should have shared it earlier, but this is my second project update for the work funded by Clojurists Together: Clojurists Together | May 2023: Short Term Project Updates

Inline evaluation via SCI

I’m very excited about this feature because it transforms the online editor into a proper interactive Clojure environment. When the track was first launched in 2021 we received some valuable feedback from fellow Clojurists, who said that the online editor was quite lacking to someone familiar with using an editor connected REPL. I too consider this an inseparable part of the Clojure development experience, so this is something I’ve wanted to do for a long time.

Once I prototyped the desired behavior using Nextjournal’s clojure-mode, the next task was to figure out how to best integrate it into the existing Ruby on Rails/React application while making as minimal impact on the codebase as possible. The first thing I tried was to use scittle to load SCI via the <script> tag. This worked great, but I wanted something more modular and realized the best thing to do would be to make it into a proper plugin for Codemirror 6 and package it as an npm library similar to @nextjournal/lang-clojure which I was able to fork and use as a template, which is itself based on @codemirror/lang-javascript. This makes it extremely easy on the website team because it simply replaces the legacy plugin used previously, with the added benefit of creating a Clojure-evaluation plugin that can be used by the rest of the Clojure community to build highly interactive editors on the web. Repo: GitHub - bobbicodes/clojure-eval: Clojure language support for the CodeMirror code editor


Revised existing exercises:

  • Basic intro - I tried to give special attention to the very first lesson, because for the majority of students this is their first contact with Clojure and I take that as a considerable responsibility. Its objective is to provide the fastest possible onramp to get the student started without them needing to immediately look anywhere else. Since Exercism is all about teaching new languages to folks who already know how to code, our target experience level is someone who has never seen Clojure, Lisp, or functional programming concepts before, but is fluent in at least one other language. So far, feedback has been very positive :)

  • Lists exercise - This one needed to be revamped because the idiomatic solution included threading macros, which were not yet taught at that point. So this exercise now teaches threading macros, and the Card Games exercise (see below) is being ported from the Python track because it is a better exercise for teaching list operations.

New concept exercises in progress:

Concept exercises planned:

  • Lists - Card games
  • Atoms
  • Threading macros
  • Protocols - My idea for this is to do something inspired by emmy, which is a very nice example of protocols. For example, an exercise involving defining operations for complex numbers would be cool. A long term vision is to create a mathematics mini-course, since Clojure is superb for this and more people should try it! The main part of the syllabus takes priority, however.
  • Partition, juxt, for
  • Associative destructuring
  • Multiarity, variadic, anonymous functions

New practice exercises

  • Yacht
  • Zipper

Test runner upgrade

The learning exercise test suites now include metadata linking each test case to its respective task in the instructions. This enables a better user experience, because now after the tests are run, there is a button to return the student to the proper place.


Besides allowing me to work on this full time, the funding enabled me to adopt two beautiful kitty cats! Now, coding is even more fun. Many thanks to all who made this possible.


Pics or it didn’t happen! ;)

1 Like

Aw, adorbs!

I have been working on Clojure this month. I prefer to work locally, but did notice the autocompletion in the online editor. Fantastic work! :blue_heart:

1 Like

Actually none of the editor stuff is merged yet, I’ve still got lots of work to do there. The current autocomplete is actually pretty crude, like the symbols it returns are not even Clojure :sweat_smile:

OMG. Naomi is Over. It. :joy_cat:

Awesome awesome work, and an awesome update! :heart: