plum

#treesitter#compiler#wasm

git clone https://git.pyrossh.dev/plum

A statically typed, imperative programming language inspired by rust, python


6d0ac75 — Peter John 2026-11-11T02:42:32+05:30
Backlog: Map reuse landed; what limits it
Files changed (2) hide show
  1. AGENTS.md +1 -1
  2. docs/backlog.md +1 -1
AGENTS.md CHANGED
@@ -14,7 +14,7 @@ Run `compiler/scripts/test-all.sh`. It builds, runs every test executable (not j
14
14
 
15
15
  ## Models
16
16
 
17
- Use Opus for every agent on this repo: implementing, reviewing and fixing. Pass `model: opus` on every agent you start, including superlite agents (`superlite:implementer`, `superlite:package-reviewer`, the fixers), overriding its tiers and its "never pass model" rule. Don't start agents on Fable, and don't use the Sonnet or Haiku tiers here.
17
+ Pick the model each agent needs; there is no Opus-only rule. Superlite agents use superlite's own tiers (don't pass `model` to override them), and other agents get the smallest model that does the task well: Opus for compiler work, reviews and anything subtle, Sonnet or Haiku for mechanical or fully specified work. Don't start agents on Fable: several in parallel used up the 5-hour limit twice on 2026-11-10.
18
18
 
19
19
  ## Subagents
20
20
 
docs/backlog.md CHANGED
@@ -13,7 +13,7 @@ Open work on `simpler-language`, rewritten 2026-11-11. Only what is still open i
13
13
  ## Performance
14
14
 
15
15
  - **Compile time is worse than on 2026-11-10 morning**: 1.32x CPU for Orb Run (538 to 708 ms), 1.40x Balloon Pop, 2.0x for a small program, even after a 30% speed-up of the passes. Causes measured or likely: programs reach more std (+17% items for Orb Run), the in-place pass is now its own pass with its own re-check, the loader's threads add CPU. The program is still checked about 7 times per compile. Re-checking only changed functions was tried and dropped: type info is keyed by node id and instantiation numbering depends on whole-program order, so the output would change. Needs stable ids first. Pruning std before the first check fails because loop and `?` lowering add calls the raw program does not name.
16
- - **`Map` insert allocates its whole path** (3.9x slower than the old hash table on raw sets and gets; 4.2x faster with 100 kept snapshots). Cell reuse for generic methods and a cheap `Int.compare` are being built on branch `perf/map-reuse`; update this line when it lands.
16
+ - **`Map` reuse stops as soon as any map in the program is shared.** A uniquely owned map is now updated in its own cells (the `map` workload went from 479 to 281 ms; the old hash table took about 200), and `Int`, `Byte` and `Float.compare` are native and inlined. But field uniqueness is decided per type over the whole program, so one kept old version of a `Map` anywhere turns deep reuse off for every `Map`: Orb Run gets none. Reuse alongside sharing needs a per-value deep-uniqueness analysis. Also open: `Map.get` allocates an `Option` on a hit (fusion treats `Map.get` as an impure producer).
17
17
  - **Closure calls are untyped.** A closure is held as `anyref`: each call does two casts and an indirect call, and building one allocates two objects. A typed closure struct per signature with `call_ref` would fix it. Indirect evidence: `cons_rec` (1.94 s) and `cons` without fusion (1.0 s) did not move.
18
18
  - **A value struct inside an enum payload is boxed twice** (`Some(Pos)` allocates two objects). No measurement yet.
19
19
  - **Scene tree with kept snapshots**: "60 kept" at N = 10000 costs 11 times a plain step. Ideas, all functional: a 32-way chunked vector for children instead of the sibling chain; skipping subtrees that cannot change; world transforms cached per node; reusing last frame's draw list when the root is the same object.