plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
f82910b
— Peter John
2026-11-16T21:05:49+05:30
plan: U4h shared flag
docs/plans/2026-11-13-no-globals-tests-ports.md
CHANGED
|
@@ -57,4 +57,5 @@ Decisions (user's answers):
|
|
|
57
57
|
- **U4e a Plum inliner** for small functions that can't trap (no `crash`, checked `at`, division): `inlineLeaves` only takes <=20-byte bodies with no locals; wasmtime's inlining bound the gain at 20-25% of update and paint; keep crash traces' names.
|
|
58
58
|
- **U4f `Nil`/`None` as null** and `br_on_cast` for matches (6 ref.test/ref.cast per element in `mapCells`; no `Some` allocation for an `Option` of a reference).
|
|
59
59
|
- **U4g view lists fused into the paint walk or scalar-replaced** (~55 cells per Orbit frame, `__upcastOnto*` ~4%, an actor's one-item `[Sprite]` 14% of scale paint).
|
|
60
|
+
- **U4h run-time shared flag** (user, 2026-11-16: "Yes do it after", after U4g): every GC struct gets a one-way shared bit, set wherever a reference is copied (a value used again after a use, a store into a list/field/closure capture/global/snapshot, anything the host holds), never cleared. A spread the static analysis can't prove unique checks the bit at run time and updates in place when clear. Soundness first: a missed copy point corrupts a shared value, so the copy points are found by the same liveness the in-place pass uses and fuzzed against the copying build (`--no-fbip` gives the same results). Measure: in-place counts and update time; the prize is about 5% of Orbit update, so drop it if the bit's cost eats it.
|
|
60
61
|
- **U5 field layout** (user, 2026-11-16: the grouped form, "With commas after all fields" "except the last one"): `struct PlayingScreen[ScreenSlice<PlayAction>](` / ` dice: Dice, ticks: Int, clock: Float,` / ` score: Int, best: Int, lives: Int, over: Bool,` / ` ship: Ship, orbs: List<Orb>, mines: List<Mine>, rings: List<Ring>,` / ` assets: Assets` / `) =`. This already parses (no grammar change); the formatter keeps the user's line grouping, and games and std types with many fields move to grouped lines; docs show the form. Starts when U4a or U4b finishes.
|