feat: persistent vector (working) + HAMT hash map (wip)

PersistentVector: 17-form .clj source, fully working.
- 32-way branching trie with tail optimization
- pv-conj, pv-nth, pv-assoc, pv-pop, vector?, vector constructor
- instance? check works on deftype tables
- .-field accessor syntax for deftype fields

api.janet: :mutable? compile flag for opt-out
- Default: persistent data structures loaded
- Pass {:mutable? true} to use Janet native types

Supporting changes (evaluator/core):
- 17 new primitives: bit ops, array ops, unchecked math, hash, cond
- loop macro, zero?, dec/inc, defn multi-arity
- instance? for deftype tables (get val :jolt/deftype)
- defrecord builds maps at expansion time
- .-field field access in default function application path

PersistentHashMap: 24-form HAMT source loads OK.
- BitmapIndexedNode/PersistentHashMap deftypes
- mask, bitpos, bit-count, index helpers
- phm-assoc/phm-get/phm-without/phm-contains? stubs
- bmn-assoc insert path structured, bitmap propagation wip
This commit is contained in:
Yogthos 2026-06-02 11:51:39 -04:00
parent 51860a553e
commit 33a5b7e7a4
11 changed files with 688 additions and 109 deletions

View file

@ -1,4 +1,16 @@
{
"jolt-dev": {
"created_by": "agent",
"use_count": 16,
"view_count": 26,
"patch_count": 27,
"last_used_at": "2026-06-02T14:31:56.690589+00:00",
"last_viewed_at": "2026-06-02T14:31:56.683109+00:00",
"last_patched_at": "2026-06-02T14:33:57.842785+00:00",
"created_at": "2026-06-01T21:26:06.614465+00:00",
"state": "active",
"pinned": false
},
"jpm-build": {
"created_by": "agent",
"use_count": 0,
@ -9,18 +21,6 @@
"state": "active",
"pinned": false
},
"jolt-dev": {
"created_by": "agent",
"use_count": 14,
"view_count": 24,
"patch_count": 25,
"last_used_at": "2026-06-02T13:06:56.464347+00:00",
"last_viewed_at": "2026-06-02T13:06:56.451104+00:00",
"last_patched_at": "2026-06-02T05:43:43.591823+00:00",
"created_at": "2026-06-01T21:26:06.614465+00:00",
"state": "active",
"pinned": false
},
"jolt-bootstrap": {
"created_by": "agent",
"use_count": 8,