Moldable Live Programming for Clojure
github.com
github.com
I'm also using it for some Clojure mentoring/training, so providing my mentees with runnable, changeable examples to explore jumpstarts their understanding.
I wish I could share images easily here; one of my exercises is looking for a solution to a chess puzzle on a 4x4 board. The board state is a map, but with a little meta-data, Clerk will present it as a 4x4 chess board (that is, there's a function that renders the board map to HTML which is presented).
Under the covers, Clerk is doing a lot of work to analyze each code block in a notebook, to determine dependencies so that it can efficiently recalculate changes and control execution ordering.
Emmy and Clojure2d have also adopted clerk for their docs with impressive results: https://clojure2d.github.io/clojure2d/docs/notebooks/noteboo...
Clerk has been fantastic for rendering 2D and 3D... I just finished a 3D graphics API and am frankly blown away at how great Clerk made this experience.
Here are my recent 3D rendering "tester" Clerk notebooks (over MathBox), for fun:
- https://emmy-viewers.mentat.org/dev/examples/manifold/pq_kno...
- https://emmy-viewers.mentat.org/dev/examples/mathbox/functio...
- https://emmy-viewers.mentat.org/dev/examples/manifold/fdg
- https://emmy-viewers.mentat.org/dev/examples/manifold/pq_kno...
And another Clerk notebook with a bunch of calculus etc in 2D scenes, over Mafs.dev:
Wouldn't immutability and lexical scoping go a long way here? What am I missing that would explain why notebook people (in general, not this project) have not long ago decided that exposing execution order is a bug?
The execution order is implied from the skeuomorphism of the notebook form.
This is why the notebook paradigm is not generally suitable for software development. They're well suited to using code to get answers from data, for learning, and for trying things out. But you wouldn't use them for building your next SaaS product (unless that product is a site for hosting notebooks..., or you're making Mathematica).
It's a really nice way to introduce people Clojure without needing them to download anything (not even a text editor) and get started playing with data.
Is there something simular for common lisp?