plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
525a5ef
— Peter John
2026-11-09T12:50:21+05:30
Plan: name a screen Screen and the actor tree SceneTree
docs/plans/2026-11-09-actor-trait.md
CHANGED
|
@@ -235,7 +235,7 @@ tree). After this work:
|
|
|
235
235
|
- `ETree` moves to `std/collections/functional/FRoseTree.plum` as `FRoseTree[T]`, a plain
|
|
236
236
|
generic collection.
|
|
237
237
|
- `std/game/scene` is the retained scene on `FRoseTree[Actor]`. The names drop the `E`:
|
|
238
|
-
`
|
|
238
|
+
`SceneTree` (was `EStage`; a screen is a `Screen`, see "Game and screens"), `Actor`, `Place`, `Ctx`, `Cmd`, `Spawn`, `Kill`, `Drawn`,
|
|
239
239
|
`Group`, `Box`.
|
|
240
240
|
- Deleted: std/game_enum_tree, and the immediate-mode `SceneNode[M]` with `Clickable`
|
|
241
241
|
and `msgOf`.
|
|
@@ -256,15 +256,17 @@ over), `Stage` (the actor tree), `State.reduce` with `Actions` (a Redux dispatch
|
|
|
256
256
|
std's `Restart`, `Exit` and `GoTo(scene)`. The branch already has the fixed-tick `Clock`
|
|
257
257
|
(std/game/input) and record and replay (std/game/Replay), ported by plum-63. Master's code
|
|
258
258
|
is built on struct embedding and `&self` mutation, which the branch doesn't have, so the
|
|
259
|
-
ideas come over on traits, not the code:
|
|
259
|
+
ideas come over on traits, not the code. Names: a screen is a `Screen` and the actor tree
|
|
260
|
+
is a `SceneTree` (strictly a tree: one parent per node, no sharing), so "scene" alone names
|
|
261
|
+
neither:
|
|
260
262
|
|
|
261
263
|
| master | branch |
|
|
262
264
|
|---|---|
|
|
263
|
-
| `Stage` (actor tree) | `
|
|
265
|
+
| `Stage` (actor tree) | `SceneTree` on `FRoseTree[Actor]` (this doc's retained tree) |
|
|
264
|
-
| `Scene` (one screen, subclassed) | `trait
|
|
266
|
+
| `Scene` (one screen, subclassed) | `trait Screen[S, M]`: `update(self, io, input, dt, store) -> (Self, Store[S, M])`, optional `draw(self, io)` defaulting to drawing its tree |
|
|
265
267
|
| `State` + `reduce` + `Actions` | `Reducer[M]` + `Store[S, M]` (`dispatch` reduces at once, effects after the tick, as master) |
|
|
266
|
-
| `Restart`, `Exit`, `GoTo(scene)` | std messages the `Game` applies after the tick, before the game's `handle` |
|
|
268
|
+
| `Restart`, `Exit`, `GoTo(scene)` | std messages `Restart`, `Exit`, `GoTo(screen)` that the `Game` applies after the tick, before the game's `handle` |
|
|
267
|
-
| `Game(scene, state)` | `Game[S, M](
|
|
269
|
+
| `Game(scene, state)` | `Game[S, M](screen: Screen[S, M], store: Store[S, M])`, a trait object for the current screen |
|
|
268
270
|
|
|
269
271
|
A game's `main` returns a `Game`; the host drives it as now. Screens switch only between
|
|
270
272
|
ticks. A game with one screen may keep its own `update` and skip `Game`.
|
|
@@ -301,8 +303,8 @@ ticks. A game with one screen may keep its own `update` and skip `Game`.
|
|
|
301
303
|
7. The port of orb_run_tree.plum and the benchmark, with the headless comparison.
|
|
302
304
|
8. One scene system: the new scene becomes `std/game/scene`; ui.plum, orb_run,
|
|
303
305
|
balloon_pop, the web-test fixtures and docs/game.md move to it; `SceneNode`, its
|
|
304
|
-
fusion, and std/game_enum_tree are deleted. The tree type is named `
|
|
306
|
+
fusion, and std/game_enum_tree are deleted. The tree type is named `SceneTree`.
|
|
305
|
-
9. Game and screens: std/game/Game.plum with `trait
|
|
307
|
+
9. Game and screens: std/game/Game.plum with `trait Screen[S, M]`, `Game[S, M]`, `Restart`,
|
|
306
308
|
`Exit` and `GoTo`, as in "Game and screens (from master)"; orb_run's title, play and
|
|
307
309
|
game over become screens; docs/game.md and tests.
|
|
308
310
|
|