plum

#treesitter#compiler#wasm

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

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


7587d09 — Peter John 2026-11-11T00:32:30+05:30
docs: drop the gone view(state) and gfx.rect, at not get in the plans, test-all's deadline
Files changed (3) hide show
  1. docs/language.md +1 -1
  2. docs/performance.md +2 -2
  3. docs/tools.md +1 -1
docs/language.md CHANGED
@@ -802,7 +802,7 @@ fun main() -> Int =
802
802
 
803
803
  This means two modules can each have a `clamp` without clashing, while two modules that define the same type name are an error. A module's own functions and constants need no prefix inside it, and a local with the same name as a module hides the module.
804
804
 
805
- Module-level constants can be any pure expression, and they may refer to each other in any order. The same goes for std: `import std/math/math` gives `math.sqrt(2.0)`, and `import std/game/gfx` gives `gfx.rect(io, ..)`.
805
+ Module-level constants can be any pure expression, and they may refer to each other in any order. The same goes for std: `import std/math/math` gives `math.sqrt(2.0)`, and `import std/game/gfx` gives `gfx.drawRect(io, ..)`.
806
806
 
807
807
  A module-level `extern fun` binds to a function the host provides. It takes `io: Io` first, because it reaches outside the program:
808
808
 
docs/performance.md CHANGED
@@ -27,7 +27,7 @@ fun bump(s: Cell) -> Cell =
27
27
 
28
28
  **Inlines closures.** A closure passed straight to a function that only calls it becomes a direct copy of the code, with no allocation.
29
29
 
30
- **Skips the picture tree.** In a game, `view(state).draw(io)` draws without building the scene in memory.
30
+ **Skips trees built only to be walked.** A call that builds a tree and hands it straight to a function that walks it once, such as `draw(io, picture(x))`, draws as it goes, without building the tree in memory.
31
31
 
32
32
  **Runs tail calls as loops.** Recursion in tail position uses no extra stack.
33
33
 
@@ -46,6 +46,6 @@ plum run --no-fusion file.plum
46
46
 
47
47
  - Keep lists and substrings that stay inside one function out of the heap
48
48
  - Read a list's storage once per loop, rather than on every step
49
- - Inline `get`, `set` and `push`
49
+ - Inline `at`, `set` and `push`
50
50
  - Store small structs inside other structs instead of separately
51
51
  - Copy only the needed part of a string when printing it
docs/tools.md CHANGED
@@ -75,7 +75,7 @@ You need a recent stable Rust toolchain and a C compiler.
75
75
  cargo install --path compiler/cli
76
76
  ```
77
77
 
78
- This installs `plum` to `~/.cargo/bin`. Run it again after pulling changes. While working on the compiler, use `cargo run -p plum-cli --` instead, and run `compiler/scripts/test-all.sh` before a commit: it builds, runs every Rust test, `plum test std examples tests` in the default, `--no-fbip` and `--no-fusion` modes, and the grammar's corpus when the `tree-sitter` CLI is installed, and ends with `ALL PASSED` (naming a step it skipped) or `FAILED: <n>`.
78
+ This installs `plum` to `~/.cargo/bin`. Run it again after pulling changes. While working on the compiler, use `cargo run -p plum-cli --` instead, and run `compiler/scripts/test-all.sh` before a commit: it builds, runs every Rust test, `plum test std examples tests` in the default, `--no-fbip` and `--no-fusion` modes, and the grammar's corpus when the `tree-sitter` CLI is installed, and ends with `ALL PASSED` (naming a step it skipped) or `FAILED: <n>`. A Rust test executable still running after 15 minutes (`TEST_ALL_DEADLINE` seconds) is stopped and fails as `(timeout)`.
79
79
 
80
80
  `plum build` of a program that is not a game compiles the `compiler/runtime` crate with cargo, so it needs this source tree and cargo on `PATH`.
81
81