You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
│ ├── test-*.js # Test groups (env, env-map, unify, match, registry, unifiers, traverse, index, edge-cases)
77
77
│ └── server.js # Browser test server
@@ -103,8 +103,8 @@ deep6/
103
103
- Support open/soft object matching
104
104
105
105
-**Environment** — two interchangeable implementations of the `EnvLike` method contract:
106
-
-`Env` (`src/env.js`) — proto-chain implementation; the default created by `unify()` when no env is passed.
107
-
-`EnvMap` (`src/env-map.js`) — `Map`-stack sibling; ~4–8× faster on accumulating-symbol/alias workloads (solver-style use). Opt in by passing `new EnvMap()` to `unify()`.
106
+
-`EnvMap` (`src/env-map.js`) — `Map`-stack implementation; the default created by `unify()` when no env is passed. ~4–8× faster on accumulating-symbol/alias workloads (solver-style use).
107
+
-`Env` (`src/env.js`) — proto-chain sibling; opt in by passing `new Env()` to `unify()`.
108
108
- Behavioural flags (`openObjects`, `circular`, `symbols`, …) live on `env.options` — never on the env instance directly.
109
109
-`EnvLike` (`src/env-shared.d.ts`, TS-only) — the method contract both classes implement.
110
110
-**Shared primitives** (`src/env-shared.js`) — implementation-agnostic, work with any `EnvLike`:
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,8 +54,8 @@ The main unification loop (the `unify` function in `src/unify.js`) processes pai
54
54
55
55
A unification environment carries variable bindings and a stack of generation frames so the solver can backtrack. Two interchangeable implementations conform to the `EnvLike` method contract:
56
56
57
-
-**`Env`** (`src/env.js`) — the default. Two parallel `null`-prototype objects walked through `Object.create()` chains; one frame per `push()`. Cheap for shallow workloads, pays a dict-mode-deopt tax once enough symbol-named bindings accumulate.
58
-
-**`EnvMap`** (`src/env-map.js`) — a sibling implementation. Two parallel `Map`-stacks (one entry per depth, lazily allocated). Identity-hashed lookup avoids the deopt; measures 4–8× faster on accumulating-symbol / alias-binding workloads (typical of solver-style consumers).
57
+
-**`EnvMap`** (`src/env-map.js`) — the default. Two parallel `Map`-stacks (one entry per depth, lazily allocated). Identity-hashed lookup avoids dict-mode deopts; measures 4–8× faster on accumulating-symbol / alias-binding workloads (typical of solver-style consumers).
58
+
-**`Env`** (`src/env.js`) — a sibling implementation. Two parallel `null`-prototype objects walked through `Object.create()` chains; one frame per `push()`. Cheap for shallow workloads, pays a dict-mode-deopt tax once enough symbol-named bindings accumulate.
59
59
60
60
Both classes expose the same methods (`push`/`pop`/`revert`/`bindVar`/`bindVal`/`isBound`/`isAlias`/`get`/`getAllValues`) and the same public `depth` and `options` fields. Behavioural flags (`openObjects`, `circular`, `symbols`, etc.) live on `env.options` — `unify()` merges any per-call options into that bag, so chaining accumulates.
Both `src/env.js` and `src/env-map.js` re-export the full shared surface so callers can keep using `import {...} from 'deep6/env.js'` for the proto-chain default, or import directly from `deep6/env-map.js` (which doubles as a single import point covering EnvMap + the shared primitives) for the Map-stack alternative.
160
+
Both `src/env.js` and `src/env-map.js` re-export the full shared surface so callers can keep using `import {...} from 'deep6/env.js'` for the proto-chain sibling, or import directly from `deep6/env-map.js` (which doubles as a single import point covering EnvMap + the shared primitives) for the Map-stack default.
Copy file name to clipboardExpand all lines: llms.txt
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -90,15 +90,15 @@ The third argument can be either an environment instance or an options bag — `
90
90
91
91
Two interchangeable implementations of the `EnvLike` contract:
92
92
93
-
- `Env` (`deep6/env.js`) — proto-chain, the default created when no env is passed.
94
-
- `EnvMap` (`deep6/env-map.js`) — `Map`-stack sibling; ~4–8× faster on accumulating-symbol/alias workloads (solver-style use). Opt in by passing `new EnvMap()` to `unify()`.
93
+
- `EnvMap` (`deep6/env-map.js`) — `Map`-stack, the default created when no env is passed; ~4–8× faster on accumulating-symbol/alias workloads (solver-style use).
94
+
- `Env` (`deep6/env.js`) — proto-chain sibling; opt in by passing `new Env()` to `unify()`.
0 commit comments