Skip to content

dxnn/bemmy

Repository files navigation

Bemmy

A static-page Clojure(Script) playground for Sussman & Wisdom's Structure and Interpretation of Classical Mechanics. Emmy (computer algebra), Mafs (2D plots), MathBox (3D plots) and emmy-viewers all in the browser via Scittle — no install required.

Live: https://bathro.be/bemmy/
Writeup: https://inwordsandpictures.com/bemmy/

Development

Prerequisites:

  • Babashka (bb) — runs the build/serve tasks
  • Node.js 18+ — the translator tests and the CodeMirror dep-graph vendor walker

Clone and run:

git clone https://github.com/dxnn/bemmy
cd bemmy
bb dev          # watch + serve at http://localhost:1341

Tasks (see bb.edn):

bb release      # advanced-compiled plugin build (writes public/js/)
bb serve        # serve public/ at :1341
bb dev          # watch + serve in parallel
bb test         # sicm2emmy translator tests (node --test)
bin/vendor.sh   # refresh public/vendor/ from CDNs
                # (rare; only when bumping versions)

Edit cycle

  1. Edit src/ or public/app.cljs.
  2. Run bb release if src/ changed (plugin rebuild). Plain text changes to public/app.cljs need only a browser reload.
  3. Browser at http://localhost:1341 — try the system pages (Welcome / SICM / Graphics / 3D).

Layout

  • public/ — the static site; drop into any static host.
    • index.html, app.cljs (the playground UI, evaluated by Scittle), sicm2emmy.js (Scheme → Emmy translator), neonic logo bundle.
    • js/ — built plugin bundle. Regenerated by bb release. Gitignored.
    • vendor/ — local copies of CDN deps (KaTeX, Mafs, hljs, React UMD, CodeMirror 6 + transitive). Tracked.
  • src/scittle/emmy.cljs + src/scittle_plugin.edn — plugin source + manifest fed to scittle.build.
  • test/sicm2emmy.test.js — translator tests (node --test).
  • bin/vendor.sh — refreshes public/vendor/. Invokes bin/vendor-cm.mjs for the CodeMirror dep-graph walk.

Deploying

public/ is the entire deploy target. After bb release, copy or sync public/ to any static host.

Built on

About

SICM in the Browser

https://bathro.be/bemmy/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors