lang-clojure-eval
v0.0.29
Published
Lezer-based Clojure Codemirror 6 extension with live evaluation
Downloads
82
Readme
lang-clojure-eval
A Codemirror 6 language extension based on the Lezer Clojure parser, with inline-evaluation support via the Small Clojure Interpreter (SCI).
API Reference
Java interop
Since many commonly used Java methods are not accessible because we are in a JavaScript environment, a limited subset have been ported into Clojure for compatibility. If you'd like to use one that has not been ported, please file an issue and we'll see what we can do.
Status
Alpha. Certainly contains bugs. There is a live demo running which is continuously built from the main branch.
- ✅ Implement Lezer parser
- ✅ Hook up Clojure interpreter
- ✅ Eval-cell
- ✅ Eval-at-cursor
- ✅ Eval top-level form
- ✅ Display results inline
- ✅ Implement clear-events
- ✅ Publish to npm
- ✅ Create test suite
- ✅ Test published package
- ✅ Handle errors
- ✅ Pretty-print eval result
- ✅ Truncate very long eval result
- ✅ Handle infinite loops
Run demo locally
npm install
npm run dev
Dev
To compile sci.js from the Clojurescript source:
npx shadow-cljs release sci
Credits
- The lang-clojure extension provides the Lezer parser, highlighting and formatting information.
- Evaluation functionality ported from Nextjournal's clojure-mode.
- SCI compiled to ESM with shadow-cljs.
- 4ever-clojure for the nice stacktraces