Commit Graph

17 Commits

Author SHA1 Message Date
dimgigov 48e64aec7f fix: +1 test (198/233, 85%) — identity/conj variadic for update test 2026-05-09 20:37:37 +03:00
dimgigov 88a04f8b67 feat: +11 more tests (194/233, 83%) — array stubs, cons/atom/cycle variadic, string escaping, empty/case 2026-05-09 20:14:31 +03:00
dimgigov 6633c3708d feat: +13 tests (184/233, 79%) — case, hex/radix, protocol/record stubs, doseq destructuring 2026-05-09 19:53:08 +03:00
dimgigov f79a2591d4 fix: expand variadic list + add runtime stubs — 174/233 (74%)
Runtime: cljCompare, cljSubvec, cljRand, cljRandInt, cljRandNth,
cljRandomSample with native Nim implementations
Emitter: expanded variadic function list for correct seq[CljVal] calling

Results: 174/233 passed (74%)
  clojure.string: 8/8 (100%)
  clojure.core: 166/225 (74%)
2026-05-09 18:21:14 +03:00
dimgigov cb69df4ee2 fix: reader #" #uuid dispatch, emitter metadata/fn/def fixes, runtime stubs
Reader: #" regex literals and #uuid"..." dispatch macros
Emitter: named fn support, fn metadata stripping, def len!=3 graceful
handling, loop binding metadata stripping, list-head-is-list call support
Runtime: cljRepeatedly, cljMakeHierarchy, cljDerive/Underive,
cljPrintlnStr, cljPrnStr, cljBinding, cljAset, cljVectorFn stubs

Results: 164/233 passed (70%), clojure.string 8/8 (100%)
2026-05-09 17:59:24 +03:00
dimgigov 624837ac7a fix: 70% test suite pass rate (164/233)
Emitter: iterative worklist-based form processing (no more stack overflow),
type conversion functions (float/int/double/long/short/byte/boolean),
metadata stripping in def/defn/defn-, to-array runtime mapping

Macros: namespace-qualified macro resolution (t/deftest -> deftest),
when-var-exists macro restored, are/testing/is/thrown? built-in macros

Runtime: cljToFloat, cljToInt, cljToBool, cljToArray conversion wrappers,
cljVolatileBang, cljDeliver, cljDoall, cljDorun, cljDropLast,
cljShuffle, cljFnil, cljIntern stubs

Results: 164/233 passed (70%)
  clojure.string: 8/8 (100%)
  clojure.core: 156/225 (69%)
2026-05-09 17:33:12 +03:00
dimgigov e6859568b3 fix: clojure test suite compatibility — 145/225 passing (64%)
Reader: #? reader conditionals with :default, #?@ splicing, char literals,
N/M suffix and ratio parsing, comma as whitespace, number parsing fix
for negative BigInt/Decimal/Ratio literals

Emitter: mangleName trailing/double underscore fixes, scope stack for
local var tracking, symbol-as-value emits cljSymbol() not bare identifier,
macro-expanded do-unwrap in processForm, emitBlock multiline wrap,
indentCode helper, when-var-exists emitter form, variadic apply fix,
fn proc spacing fix, def indent fix

Macros: deftest, is, testing, thrown?, are, when-var-exists builtins;
rewritten and/or using gensym; improved for/doseq/dotimes; cond->
and cond->> threading fixes; threading macro insert fixes

Runtime: sorted-map, sorted-set, sorted?, array-map, object-array,
hash-map, hash-set, inf, nan; assoc extended to vectors

Test runner: #?@ splice unwrapping, removed conflicting defmacro stubs
2026-05-09 16:14:44 +03:00
dimgigov a9ad83c509 fix: general equality (=) for all types, add type predicates & collection fns, test suite docs
- Fix: = now uses cljEqual/cljMultiEqual instead of numeric-only cljNumEq,
  so (= :a :a), (= "a" "a"), (= [1 2] [1 2]), (= nil nil) etc return true
- Fix: ns forms inside unwrapped (do ...) are skipped instead of emitting
  broken Nim comments inside cljRepr()
- Fix: defmacro forms go to defs section, not wrapped in discard cljRepr()
- Add 18 type predicates: keyword?, symbol?, string?, number?, integer?,
  float?, vector?, map?, set?, list?, seq?, coll?, sequential?, fn?,
  boolean?, true?, false?, some?
- Add collection fns: second, ffirst, nfirst, peek, pop
- Add keyword/symbol ops: keyword, symbol, name, namespace, key, val
- Update eval interpreter = to handle structural collection equality
- Add test_single.py + test_vals.clj for Clojure test suite runner
- Add docs/en/07 and docs/bg/07 for cross-dialect test suite compatibility
- Update README with test suite documentation link
2026-05-09 12:17:10 +03:00
dimgigov ba0b300917 feat: add fullscreen TUI and project updates
- New TUI screens: Main Menu, Compile, Run, REPL, AI Generator, AI Settings, Help
- AI configuration persisted in ~/.config/cljnim/config.json
- Added illwill dependency for terminal UI
- Updated experiments, examples, docs, and core modules
2026-05-09 01:53:23 +03:00
dimgigov 88866872be Bugfixes: add cljQuot/cljRem to runtime, quot/rem to interpreter. Cleanup: remove unused processAgentActions and sequtils import. 164 tests pass. 2026-05-08 20:45:36 +03:00
dimgigov 30fde68fed Phase 9: Agents (send/await/deref) + core.async channels (chan, >!, <!, close!, go). All phases complete. 2026-05-08 20:28:51 +03:00
dimgigov b67962dbba Phase 5/6 complete: Transients, meta/with-meta, instance?
T5.5 Transients (transient/persistent!/conj!/assoc!)
  - Mutable builder for batch vector/map operations
  - Use with let bindings for proper ordering

T6.10 meta/with-meta — metadata on any CljVal via ref object field
T6.11 instance? — type predicate (instance? :integer 42)

Also marked T9.1 Atoms as done (already implemented earlier)

86 tests pass, all examples work.
Phases 0-6 now complete. Phase 7: 2/4 tasks done.
2026-05-08 19:48:35 +03:00
dimgigov 19ef69bf5b Phase 6: slurp, spit, read-line, range 3-arg, repeat/cycle/iterate, interleave
Phase 6 Clojure Core Library now complete (except meta):
- T6.3: slurp (alias for file/read)
- T6.4: spit (alias for file/write)
- T6.5: read-line (stdin input)
- T6.6: range with 3 args (start, end, step)
- T6.7: repeat, cycle, iterate (eager implementations)
- T6.9: interleave
- Updated TASKS.md and ROADMAP.md
2026-05-08 19:24:06 +03:00
dimgigov 6dfc2a9308 Phase 5: HAMT Persistent Map + Persistent Set, 86 tests pass
- T5.3: HAMT Persistent Map (lib/cljnim_pmap.nim)
  O(log32 n) assoc/dissoc/get with structural sharing
  16 unit tests, ckMap migrated from seq to HAMT

- T5.4: Persistent Set backed by HAMT map
  ckSet with conj/disj/contains?/get, set literal #{}

- Fix: cljContains/cljCount return CljVal (not bool/int)
- Fix: equality in generics via explicit cljEq parameter
- Updated roadmap, task board, CI/Makefile
2026-05-08 19:13:09 +03:00
dimgigov d763e25638 Phase 5: HAMT Persistent Vector + CI fixes
- Add lib/cljnim_pvec.nim: 32-way HAMT Persistent Vector with structural sharing
- Migrate ckVector from seq[CljVal] to PersistentVector[CljVal] in runtime
- Fix recursive pushLeaf bug (nil nodes at depth > 2)
- Fix defn/if return value bug: replace discard with result = in proc bodies
- Fix cljNth to accept CljVal index
- Add len and [] overloads for PersistentVector seq compatibility
- Add tests/test_pvec.nim (14 tests)
- Update .gitlab-ci.yml to nim:2.2.10 and add test_pvec
- Update docs/ROADMAP.md and add PHASE5_HAMT.md
2026-05-08 17:58:00 +03:00
dimgigov b239dd959b AI git commit test from Clojure 2026-05-08 17:11:12 +03:00
dimgigov 87d6028487 Phase 1-4: Reader, Runtime, Macros, Nim Interop — 543x faster than JVM Clojure
- Reader: maps, sets, syntax-quote, dispatch macros, metadata
- Runtime: CljVal type system, 80+ core functions (collections, strings, math, IO)
- Emitter: full CljVal-based code generation, macro expansion, inline fns
- Macros: defmacro with compile-time evaluator, ->, ->>, and, or, when, cond, for, doseq
- Nim Interop: nim/module/function syntax, auto-import, type mapping
- CLI: cljnim -e '<code>' for quick evaluation
- Tests: 60 unit tests (reader + emitter)
- Benchmarks: AOT suite showing 543x startup, 679x factorial vs JVM Clojure
- CI: GitLab CI pipeline
- Runtime library: lib/cljnim_runtime.nim (1070+ lines)
2026-05-08 16:34:39 +03:00