plum

#treesitter#compiler#wasm

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

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


3a89871 — Peter John 2026-11-02T11:51:44+05:30
docs(README): planned performance work
Files changed (1) hide show
  1. README.md +11 -0
README.md CHANGED
@@ -1020,6 +1020,17 @@ hello, world!
1020
1020
 
1021
1021
  See [`plum-examples/`](plum-examples) for a runnable file per feature above, and [`plum-std/`](plum-std) for the standard library source.
1022
1022
 
1023
+ ## Planned performance work
1024
+
1025
+ These are compiler optimizations, not language changes; none of them changes what a program means or how it is written.
1026
+
1027
+ - **No allocation for local lists and views.** A `List`, a `List.slice` view or a `Str` substring that never leaves its function (isn't stored, passed on or returned) could keep its fields in locals instead of allocating its small record (escape analysis).
1028
+ - **Loops read a list once.** `for x := range xs` could read `xs`'s storage, start and size once before the loop instead of on every step, and `xs.get(i)` loops could do the same when the body can't change `xs`.
1029
+ - **Inlined `get`, `set` and `push`.** These small `List` and `Array` methods are function calls today. Inlining them removes the call and lets the wasm engine keep values in registers.
1030
+ - **No placeholder `self` for statics.** A static such as `Vec2.zero()` still receives an unused `self` slot (one per field for a struct), which could be dropped from its signature.
1031
+ - **Fewer boxed structs.** A struct stored in a record field, passed as a variadic argument or carried in an error union is boxed (one allocation); it could be stored inline instead.
1032
+ - **Host string reads.** When the host prints or writes a `Str`, it copies the whole backing array and then takes the `[start, start + len)` part; it could copy only that range.
1033
+
1023
1034
  ## Editor support
1024
1035
 
1025
1036
  ```sh