Commit Graph

8 Commits

Author SHA1 Message Date
dimgigov 075e5f6df0 fix: 233/233 (100%) - ##Inf/NaN reader, #?@ splicing, :clj platform, doseq :when/:let/:while, hex overflow, unquote-splicing 2026-05-11 01:49:42 +03:00
dimgigov 549e04f24d feat: +12 tests (210/233, 90%) — fn wrapping, doseq, when-first, NaN?, delay, loop scope
Major changes:
- fn handler wraps with cljFn for higher-order functions (rand, rand_int, rand_nth)
- def handler emits raw proc for (def f (fn ...)) context
- Local fn calls use .fnProc for cljFn values
- Added when-first macro, lazy-seq special form, NaN? predicate
- Added delay, rseq, listEmpty runtime functions
- doseq macro uses next instead of rest, recur inside when body
- loop handler pushScope/popScope for proper variable scoping
- let handler: var/while/proc statement checks, block last-line discard
- when handler: proper statement detection for body forms
- defn/defn- allow empty body
2026-05-09 23:17:02 +03:00
dimgigov fb13f15c39 fix: +3 tests (197/233, 85%) — bigint overflow, var_qmark indent, merge double discard 2026-05-09 20:34:26 +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 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 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 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