Commit graph

19 commits

Author SHA1 Message Date
Yogthos
39edb88074 feat: ~40 more core fns + fix map iteration to yield entries
While digging into test-load-sci, add genuinely-missing clojure.core fns:
doall/dorun/run!/tree-seq, key/val/map-entry?, rand-nth/replicate/
bounded-count/counted?/reversible?/seqable?, nat-int?/pos-int?/neg-int?/
double?/float?/ratio?/decimal?/rational?/numerator/denominator, list*,
special-symbol?/record?, promise/deliver, comparator/completing/halt-when/
ensure-reduced/unreduced, keyword-identical?/object?/tagged-literal/re-groups.

Fix a real pre-existing bug: iterating a map (first/seq/map/filter/reduce/vec/
realize-for-iteration) returned keys or values instead of [k v] entries.
Map literals are Janet structs (not phm), which several paths mishandled.
Now first/seq/realize-for-iteration yield entries for both structs and phms,
matching Clojure — e.g. (vec {:a 1}) => [[:a 1]], (map key m), (reduce f init m).

Tests: conformance 218/218 (+12), features 78/78, jank 120. Advances the SCI
bootstrap further (its clojure.core aggregation map resolves more symbols).
2026-06-04 19:38:25 -04:00
Yogthos
e43f39bc36 feat: add missing core fns (bit-clear, get-method, second, predicates, ...)
Resolve symbols that were unbound or leaking to broken Janet builtins:
- bit-clear/bit-set/bit-flip/bit-test/bit-and-not
- get-method/methods (multimethod introspection)
- second/ffirst/nfirst/fnext/nnext, last (was leaking to Janet, broke on pvec),
  drop-last/take-last
- ident?/simple-symbol?/qualified-keyword?/simple-keyword?/simple-ident?/
  qualified-ident?/inst?/inst-ms/uri?/uuid?/bytes?/tagged-literal?
- clojure.string/re-quote-replacement

Advances the SCI bootstrap; conformance 206/206, features 71/71.
2026-06-04 19:10:45 -04:00
Yogthos
1ca93d61c6 feat: build-time mutable/immutable collection toggle + fix list mutation
Add src/jolt/config.janet exposing a build-time `mutable?` constant read from
JOLT_MUTABLE at compile time (jpm build). Default is immutable.

Fix correctness bug: conj on a list (Janet array) mutated the original in
place. In immutable mode conj now copies first; in mutable mode it mutates.

Round 1 of persistent-collections work.
2026-06-04 18:15:48 -04:00
Yogthos
1b37e56df4 feat: map literals evaluate their values (fixes critical latent bug); expand SCI bootstrap to 14 files (ctx_store/deftype/records/core_protocols/hierarchies + sci.impl.io stub), 390/392 forms; fix multi-arity defmethod (builds fn*) and variadic macrofy; SCI test loaders tolerant of the 2 redundant clojure.core registration maps 2026-06-04 17:28:44 -04:00
Yogthos
37c8971d41 feat: full regex engine (Path A) — parser->AST->PEG grammar with continuation-passing backtracking + position-based group captures; capturing groups [whole g1...], greedy/lazy backtracking through groups, lookahead, (?i) flag, anchors/\b, $N replace; re-find/matches/seq + string split/replace 2026-06-04 16:24:02 -04:00
Yogthos
7dbccb60c0 feat: compiler-path IFn dispatch via jolt-call (vector/map/set/keyword/record callable in :compile? mode); fix compiled set literals (->make-phs) and char consts 2026-06-04 15:56:36 -04:00
Yogthos
b0cb3afbf2 feat: transducers — map/filter/remove/take/drop/take-while/drop-while/map-indexed return transducers on no-coll arity; transduce/into-xform/sequence/eduction/reduced/unreduced; reduce honors reduced 2026-06-04 15:48:04 -04:00
Yogthos
e1556fd102 docs: PLAN.md + memory updates for conformance gap-closing batch 2026-06-04 15:28:30 -04:00
Yogthos
31d63df133 docs: PLAN.md Phase 19 conformance-hardening summary 2026-06-04 14:58:16 -04:00
Yogthos
044a16d1b2 fix: lazy filter/take-while/remove over lazy input (supports infinite seqs); fix take-while iterating lazy-seq table 2026-06-04 14:56:26 -04:00
Yogthos
77c52553cb fix: REPL lazy-seq printer walks full chain (capped); def/defn return var (prints #'ns/name); fix var-name printer bug 2026-06-04 14:55:11 -04:00
Yogthos
8f97e1d822 feat: require loads stdlib namespaces from disk + aliased-ns resolution (s/join); fix str-join to stringify elements (Clojure semantics) 2026-06-04 14:45:52 -04:00
Yogthos
08de360315 fix: Clojure str/pr-str semantics (nil->'', keywords ':b', symbols, collections render with reader syntax); fix incorrect str-nil test 2026-06-04 14:33:45 -04:00
Yogthos
cbc610c665 fix: unified recursive destructuring (nested seq/map, :strs/:syms, :or, :as, fn-params); proper defn docstring/attr-map handling 2026-06-04 14:31:24 -04:00
Yogthos
92682187a8 fix: truly lazy concat enabling self-referential lazy-cat/lazy-seq (fib-seq); CRITICAL conformance round 28/28 2026-06-04 14:09:15 -04:00
Yogthos
3c77f6a9c0 fix: lazy iterate/range(infinite)/single-coll-map over lazy input; realize lazy-seqs in reduce/filter 2026-06-04 14:06:02 -04:00
Yogthos
2ea5b2bb5f fix: unify vector repr on tuples; realize lazy-seqs in =/vec/into; fix into for maps/lists; restore ns after PV load; deftype field-access fallback in IFn dispatch 2026-06-04 13:59:36 -04:00
Yogthos
accb7a2c2f feat: collection-as-IFn dispatch (vector/map/set/keyword); add Clojure conformance harness 2026-06-04 13:50:54 -04:00
Yogthos
1d47fc9ad2 bd init: initialize beads issue tracking 2026-06-04 13:46:11 -04:00