Fix macro expansion in REPL; update roadmap to reflect actual capabilities
This commit is contained in:
+62
-32
@@ -2,49 +2,79 @@
|
||||
|
||||
## Phase 0: Compiler Core ✅
|
||||
- [x] Clojure Reader (EDN parser)
|
||||
- [x] Reader supports: lists `()`, vectors `[]`, maps `{}`, strings, keywords, symbols, numbers, booleans, nil
|
||||
- [x] Reader supports: quote `'`, syntax-quote `` ` ``, unquote `~`, unquote-splicing `~@`
|
||||
- [x] Reader supports: comments `;`, read-all
|
||||
- [x] AST → Nim Emitter
|
||||
- [x] CLI (`compile`, `run`, `read`)
|
||||
- [x] CLI (`compile`, `run`, `read`, `repl`)
|
||||
- [x] Special forms: `def`, `defn`, `fn`, `let`, `if`, `do`, `quote`
|
||||
- [x] Arithmetic operators
|
||||
- [x] Human and JSON REPL
|
||||
- [x] Special forms: `when`, `cond`
|
||||
- [x] Arithmetic operators: `+`, `-`, `*`, `/`
|
||||
- [x] Comparison operators: `=`, `not=`, `not`, `<`, `>`, `<=`, `>=`
|
||||
- [x] Core functions: `println`, `map`, `filter`, `reduce`
|
||||
- [x] Runtime type system: `CljVal` with `nil`, `bool`, `int`, `float`, `string`, `keyword`, `symbol`, `list`, `vector`, `map`, `fn`, `atom`
|
||||
|
||||
## Phase 1: AI-Native Tooling 🔄
|
||||
- [x] JSON REPL mode
|
||||
- [x] Batch evaluation
|
||||
- [x] Structured errors
|
||||
- [ ] File operations (`file/read`, `file/write`)
|
||||
- [ ] Git operations (`git/commit`, `git/push`)
|
||||
## Phase 1: Macro System ✅
|
||||
- [x] `macroexpand`, `macroexpand-1`
|
||||
- [x] `syntax-quote`, `unquote`, `unquote-splicing`
|
||||
- [x] `gensym`
|
||||
- [x] `defmacro` (user-defined macros)
|
||||
- [x] Built-in macros: `->`, `->>`, `and`, `or`, `when`, `when-not`, `cond`
|
||||
- [x] Built-in macros: `cond->`, `cond->>`, `doto`, `as->`, `some->`, `some->>`
|
||||
- [x] Built-in macros: `for`, `doseq`, `dotimes`
|
||||
- [x] Built-in macros: `when-let`, `if-let`
|
||||
- [x] Built-in macros: `comment`, `assert`, `with-open`
|
||||
|
||||
## Phase 2: REPL & Tooling ✅
|
||||
- [x] Human REPL (`:help`, `:defs`, `:clear`, `:ns`, `:quit`)
|
||||
- [x] JSON REPL (`--json`) with structured I/O
|
||||
- [x] Batch evaluation (`eval-batch`)
|
||||
- [x] Structured errors (type, message, form, line)
|
||||
- [x] Session persistence for `def`/`defn` definitions
|
||||
|
||||
## Phase 3: Nim Interop ✅
|
||||
- [x] Call Nim functions: `(nim/math/sin x)`, `(nim/strutils/toUpper s)`
|
||||
- [x] C FFI via Nim `importc`
|
||||
|
||||
## Phase 4: AI-Native Tooling 🔄
|
||||
- [ ] File operations from REPL: `(file/read "path")`, `(file/write "path" "content")`
|
||||
- [ ] Git operations from REPL: `(git/status)`, `(git/commit "msg")`, `(git/push)`
|
||||
- [ ] nREPL protocol compatibility
|
||||
- [ ] Tool-call format for AI framework integration
|
||||
|
||||
## Phase 2: Persistent Data Structures
|
||||
- [ ] Persistent Vector (HAMT)
|
||||
## Phase 5: Persistent Data Structures
|
||||
- [ ] Persistent Vector (Hash Array Mapped Trie)
|
||||
- [ ] Persistent Map (HAMT)
|
||||
- [ ] Persistent Set
|
||||
- [ ] `conj`, `assoc`, `dissoc`, `get`, `get-in`
|
||||
- [ ] `nth`, `first`, `rest`, `last`, `count`
|
||||
- [ ] `nth`, `first`, `rest`, `last`, `count` on persistent collections
|
||||
- [ ] Transients for batch mutations
|
||||
|
||||
## Phase 3: Clojure Core Library
|
||||
- [ ] Seq functions: `map`, `filter`, `reduce`, `range`
|
||||
- [ ] String functions: `str`, `pr-str`, `slurp`, `spit`
|
||||
- [ ] Meta: `meta`, `with-meta`, `type`
|
||||
## Phase 6: Clojure Core Library
|
||||
- [ ] `range`, `repeat`, `cycle`, `iterate`
|
||||
- [ ] `take`, `drop`, `partition`, `interleave`, `concat`
|
||||
- [ ] `str`, `pr-str`, `println`, `prn`
|
||||
- [ ] `slurp`, `spit`, `read-line`
|
||||
- [ ] `meta`, `with-meta`, `vary-meta`
|
||||
- [ ] `type`, `instance?`, `satisfies?`
|
||||
|
||||
## Phase 4: Macro System
|
||||
- [ ] `defmacro`
|
||||
- [ ] `syntax-quote`, `unquote`, `unquote-splicing`
|
||||
- [ ] `gensym`
|
||||
- [ ] Core macros: `->`, `->>`, `and`, `or`, `when`, `cond`
|
||||
## Phase 7: Project Compilation
|
||||
- [ ] Compile entire projects (not just single files)
|
||||
- [ ] Namespace system (`ns`, `require`, `use`)
|
||||
- [ ] Module caching for faster REPL startup
|
||||
- [ ] Dependency resolution
|
||||
|
||||
## Phase 5: Nim Interop
|
||||
- [ ] `nim/import` — Import Nim modules
|
||||
- [ ] `nim/call` — Call Nim functions
|
||||
- [ ] C FFI declarations
|
||||
## Phase 8: Self-Hosted REPL
|
||||
- [ ] Compile forms in memory (no temp files)
|
||||
- [ ] Fast REPL startup (< 100ms)
|
||||
- [ ] Hot code reloading
|
||||
|
||||
## Phase 6: Optimization
|
||||
- [ ] AOT project compilation
|
||||
- [ ] Module caching
|
||||
- [ ] Self-hosted REPL (compile in memory)
|
||||
|
||||
## Phase 7: Concurrency
|
||||
- [ ] Atoms (CAS)
|
||||
## Phase 9: Concurrency
|
||||
- [ ] Atoms (compare-and-swap)
|
||||
- [ ] Agents
|
||||
- [ ] core.async channels (simplified)
|
||||
|
||||
## Known Issues
|
||||
- `->>` threading macro with nested `map`/`reduce` requires proper macro expansion context
|
||||
- REPL definitions are re-compiled from scratch on each evaluation (slow but correct)
|
||||
- No true persistent data structures yet (runtime uses Nim seq/tables)
|
||||
|
||||
Reference in New Issue
Block a user