plum

#treesitter#compiler#wasm

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

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


8d8a0e0 — Peter John 2026-11-04T20:58:19+05:30
docs: backlog: tree Map and constant map literals (later)
Files changed (1) hide show
  1. docs/backlog.md +3 -0
docs/backlog.md CHANGED
@@ -38,6 +38,9 @@ Open work, in the order the user queued it, plus smaller items found during buil
38
38
 
39
39
  ## Smaller open items
40
40
 
41
+ - **Map as a balanced tree, and constant map literals** (user 2026-11-04, later) — reimplement `std/Map` as a persistent B-tree or AVL tree (a recursive enum, e.g. `Leaf | Node(left, key, value, right, height)`); keys need ordering instead of `Hashable`, iteration becomes sorted/deterministic. `[k => v, ..]` keeps desugaring to `Map.empty().set(k, v)...` (O(n log n)). Optional later optimisation: when every key in a literal is a compile-time constant, sort, dedupe and build the balanced tree directly at compile time.
42
+ - **List literal cost** — `[a, b, c]` desugars to `Cons(head: a, tail: Cons(..., Nil))`, O(n); revisit if `List` changes representation.
43
+
41
44
  - **`List.length()` on a locally built list fails codegen** — `fun count() -> Int =` / `xs := List(1, 2)` / `xs.length()` gives `codegen: unknown method 'List.lengthFrom' (in 'count')`; the same call on a `List` parameter, or inside a `test` block, works. Also hit with a static `Hue.palette().length()`. Found drafting the kids' games; the user wants it fixed (with a regression test) before those games are built. Check whether the cleanup refactor already fixed it.
42
45
  - **Spread from a field path** — `Stage(..w.stage, x: 1)` is rejected; only a plain variable can be a spread source. Worked around with small helpers in the pure game. (language-restrictions T14)
43
46
  - **Fields declared inside `init` can't be `mut`** (`self.camX: Float = 0.0`) — such fields were moved into the record header. (T8)