- compiler.janet: fix core-pr-str mapping — was pointing to core-str (line 221) - core.janet: add core-pr-str (string/format-based serialization with proper quoting), add core-every-pred (variadic predicate composition), wire both into core-bindings - cljs-port-5.janet: restore var-dynamic? test, with-meta preserves test, add pr-str keyword and every-pred assertions - PLAN.md: update to current state — all phases 0-14 checked off, 316/317 316 ok, 1 fail (pre-existing, unchanged)
3.5 KiB
3.5 KiB
Jolt — Complete Implementation Plan
Architecture Goal
Minimal Janet bootstrap → SCI/CLJS Clojure source runs on Jolt.
Three layers:
- Janet runtime: types.janet, reader.janet, evaluator.janet, compiler.janet (~4,200 lines)
- Clojure core: core.janet (~1,400 lines), phm.janet (~200 lines)
- Clojure source (.clj files loadable at runtime): stdlib modules, SCI
Current State
| Metric | Value |
|---|---|
| Total tests | 317 |
| Passing | 316 |
| Failing | 1 (lang.cljc deftype — deferred to Phase 15) |
| CLJS test files ported | ~15/60 |
| Total assertions | 860+ across 24 test files |
| Source lines | ~5,600 (7 core .janet files) |
Phase Plan
Phase 0-10: Foundation ✓
| Phase | Description | Status |
|---|---|---|
| 0 | defn bug fix, bare symbol resolution |
✓ |
| 1 | Var/Namespace system, ns form extensions | ✓ |
| 2 | PersistentHashMap implementation | ✓ |
| 3 | Var system: var-get/set/?, alter-var-root, intern, binding | ✓ |
| 4 | deftype/defrecord completion | ✓ |
| 5 | Multimethods + Hierarchy | ✓ |
| 6 | Reader extensions: tagged literals, :jolt/tagged handler | ✓ |
| 7 | LazySeq + PersistentHashSet | ✓ |
| 8 | Protocol system: defprotocol, extend-type, extend-protocol, reify, satisfies? | ✓ |
| 9 | REPL fixes: buffer-based output, collection rendering, cond fix | ✓ |
| 10 | Standard Library: clojure.string, clojure.set, clojure.walk, clojure.zip, clojure.edn, clojure.java_io, jolt.interop, jolt.shell, jolt.http | ✓ |
Phase 11: Fix Pre-existing Failures ✓
types.janet:ns?now accepts both structs and tablescore.janet:commentmacro wired into core-bindingssci/lang_stubs.clj: minimal SCI type stubs for bootstraptest-load-sci.janet: load stubs before SCI source files- Result: SciVar fixed. 1 remaining (deftype with
#?@— Phase 15)
Phase 12: Core Feature Completion ✓
applysupport in evaluator + compilerstrhandles nil correctly- 6 CLJS test files created (~120 assertions)
#()anonymous fn reader with%,%1,%2arg handling
Phase 13: Protocol Completion ✓
- reify dispatch: protocol methods work on reified objects
#()reader macro with gensym-based%arg handling- IFn protocol support in default invocation arm
- clojure.walk loads and
keywordize-keysworks - 4 test sections: reify dispatch, anon fn, extend-type, walk loading
Phase 14: Extend CLJS Ported Tests ✓
cljs-port-2.janetexpanded: 10 sections (12-21), 35→60 assertionscljs-port-5.janetcreated: sections 22-24, destructuring, metadata, fn compositionpr-strcompiler fix: maps to newcore-pr-str(notcore-str)every-predadded to core.janetvar-dynamic?andwith-metatests restored
Phase 15: SCI Bootstrap
- Complete
sci.langnamespace with Var type - Load remaining SCI namespaces
- SCI test runner
- Fix SciVar
#?@deftype issue
Phase 16: Remaining Core Library + Tests
- Port ~20 remaining CLJS test files
- Fix found gaps:
&rest destructuring,seqnil handling, vector/list equality eval,syntax-quotecompletion
Phase 17: Optimization
- Compiler improvements: inline small core functions
- PersistentHashMap dynamic bucket growth
- Benchmarks
Phase 18: Standard Library Completion
- Complete EDN reader/writer
- Complete java.io wrappers
- clojure.zip tests
Implementation Order
- ✅ Phases 0-14 (completed)
- Phase 15 (SCI bootstrap) — critical path
- Phase 16 (remaining test porting + feature gaps)
- Phases 17-18 (optimization, stdlib)