| .github/workflows | ||
| design-notes | ||
| dist | ||
| public | ||
| src | ||
| test | ||
| .gitignore | ||
| closebrackets.ts | ||
| deps.edn | ||
| index.html | ||
| main.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| scratch.json | ||
| style.css | ||
| vite.config.js | ||
bobbi-lisp
A browser-based interactive Lisp environment for learning Clojure
Bobbi-lisp is based on MAL (Make-a-Lisp), which is a pedagogical Lisp interpreter inspired by Clojure. In a nutshell, this means that it has a set of built-in data structures besides lists, and is designed for functional programming using immutability by default with an atom type for controlled mutation. A goal is to support as much of Clojure as possible so it can be used for teaching Clojure.
I'd estimate that the goal is around 50% complete by quantity, though the unimplemented half is likely much more involved than the first.
Live demo
The coding environment is live on Codeberg Pages: https://bobbicodes.codeberg.page/bobbi-lisp/
Differences from Clojure
-
No multimethods/protocols. Chris Houser (Chouser) has created a sketch of protocols which is included but nothing uses them yet.
-
No deftype, defrecord
-
Namespaces. At this point they are not a high priority because this tool is meant for doing simple exercises and not writing production software. However, there are many functions which have slashes in their name to support patterns such as
str/join,Character/digit, etc.
Zippers have been implemented, and are available as a library that can be loaded:
(require "zip")
I plan to update this section regularly with detailed descriptions of various features as I make progress.
Running
In the project root, run:
npm install
npm run dev
Testing
The application has a built-in testing framework based on 185 coding exercises taken from 4clojure and Exercism. To run it, uncomment the last line of main.js:
testExercises()
Test the reader:
run_test(reader_tests)
The reader now supports everything Clojure does with the exception of namespaced keywords. That means hex/octal integers and Unicode chars.
Related projects
bobbi-lisp-core - Just the interpreter, available as an NPM library for use in other projects
bobbi-lisp-audio - Sample-based music sequencer using the Web Audio API
bobbi-lisp-svg - Render SVG paths