plum

#treesitter#compiler#wasm

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

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


.recall/context.md
# Project Context β€” plum (updated 2026-07-20T21:06:26)

_Generated locally by Recall β€” TextRank (vendored, numpy-accelerated)._

## 🎯 Goal
Do you want to completely implement the standard library like List, Map, Enum completely and type check and compile them to see if they work? Honestly, this would be a much bigger undertaking than what we've done so far β€” List/Map need real generics monomorphization (there's currently none; user-defined generics type-check but don't compile, per the README's Known gaps) plus a growable-memory runtime (the current bump allocator never resizes or frees), and general Enum support needs a runtime ta…

## 🧭 Summary
- <task-id>a3a9df0eb061889e5</task-id>
- <task-id>aa93a0b92186e335d</task-id>
- <task-id>a7c05a66e453e9fc7</task-id>
- <task-id>a50ac39524b3a83d6</task-id>
- <task-id>a527ef038e07d98b5</task-id>
- <task-id>a61ac371a07e0a4ac</task-id>
- <task-id>a3121982d2d930f6c</task-id>
- <task-id>a9ab25fe3cb73fe68</task-id>

## ⏭️ Next steps / open threads
- Implementer: "Before I begin - should the hook be installed at user or system level?"
- What would you like to do?
- If you haven't completed Phase 1, you cannot propose fixes.
- My actual edits (grammar.js, match.txt, corpus renames) are safely preserved in `stash@{0}` β€” I just need to reset the incidentally-regenerated files to HEAD and re-apply the stash.
- Now let's check the two remaining direct `.index` usages seen earlier that weren't behind `ok_or_else`.
- Uncommitted changes to wrap up: .recall/, tooling/tree-sitter-plum/.recall/

## πŸ“‚ Files touched
- /Users/pyrossh/Code/plum/docs/superpowers/specs/2026-07-19-general-enum-support-design.md
- /Users/pyrossh/Code/plum/plum-checker/src/lib.rs
- /Users/pyrossh/Code/plum/plum-core/src/ast.rs
- /Users/pyrossh/Code/plum/plum-core/src/parser.rs
- /Users/pyrossh/Code/plum/tooling/tree-sitter-plum/grammar.js
- /Users/pyrossh/Code/plum/plum-wasm-codegen/src/lib.rs
- /Users/pyrossh/Code/plum/plum-checker/tests/checker_tests.rs
- /Users/pyrossh/Code/plum/plum-wasm-codegen/tests/codegen_tests.rs
- /Users/pyrossh/Code/plum/plum-checker/tests/examples_test.rs
- /Users/pyrossh/Code/plum/plum-wasm-codegen/tests/examples_test.rs
- /Users/pyrossh/Code/plum/examples/match.plum
- /Users/pyrossh/Code/plum/docs/superpowers/plans/2026-07-19-general-enum-support.md
- /Users/pyrossh/Code/plum/.superpowers/sdd/progress.md
- /Users/pyrossh/Code/plum/plum-cli/src/main.rs
- /Users/pyrossh/Code/plum/.superpowers/sdd/task-5-report.md
- /Users/pyrossh/Code/plum/docs/superpowers/specs/2026-07-20-tail-position-and-grammar-gaps-design.md
- /Users/pyrossh/Code/plum/README.md
- /Users/pyrossh/Code/plum/docs/superpowers/plans/2026-07-20-tail-position-and-grammar-gaps.md
- /Users/pyrossh/Code/plum/docs/superpowers/specs/2026-07-20-generics-monomorphization-design.md
- /Users/pyrossh/Code/plum/plum-checker/src/types.rs
- /Users/pyrossh/Code/plum/docs/superpowers/plans/2026-07-20-generics-monomorphization.md
- /Users/pyrossh/Code/plum/.superpowers/sdd/task-2-report.md
- /Users/pyrossh/Code/plum/docs/superpowers/specs/2026-07-20-generic-enum-multi-instantiation-design.md
- /Users/pyrossh/Code/plum/plum-checker/src/monomorphize.rs
- /Users/pyrossh/Code/plum/docs/superpowers/plans/2026-07-20-generic-enum-multi-instantiation.md
- /Users/pyrossh/Code/plum/.superpowers/sdd/task-1-report.md
- /Users/pyrossh/Code/plum/docs/superpowers/specs/2026-07-20-closures-design.md

## πŸ”§ Commands run
- sed -n '1,400p' README.md | grep -n -i "known gap\|enum\|generic" -A3 -B1
- find . -iname "*.plum" -path "*enum*" -o -iname "*.plum" | xargs grep -l "enum" -i 2>/dev/null
- ls libs/std/; echo ---; cat libs/std/option.plum; echo ---; cat libs/std/result.plum
- grep -n "enum\|variant\|Bool\|True\|False" plum-checker/src/types.rs | head -60
- grep -n "enum\|variant\|Bool\|True\|False" plum-wasm-codegen/src/lib.rs | head -80
- grep -n "bump_global\|fn compile_new\|struct_offset\|field_offset\|ast::Expr::New\|memory\|MemoryType\|alloc" plum-wasm-codegen/src/lib.rs | head -60
- grep -n "enum_variant\|variant" tooling/tree-sitter-plum/grammar.js
- grep -n "Enum\|Variant" plum-core/src/ast.rs
- sed -n '55,90p' plum-core/src/ast.rs; echo ---GRAMMAR---; grep -n "variant\|enum" tooling/tree-sitter-plum/grammar.js -i
- sed -n '125,160p' tooling/tree-sitter-plum/grammar.js
- grep -n "EnumVariant\|enum_variants\|construct\|Call(" plum-checker/src/lib.rs | head -50
- ls docs/superpowers/specs/ 2>/dev/null
- git add docs/superpowers/specs/2026-07-19-general-enum-support-design.md && git commit -m "$(cat <<'EOF' docs: add design spec for general enum support in check
- grep -n "ClassCall\|FieldArg\|CasePattern::Class\|fn parse_call\|positional" plum-core/src/parser.rs | head -60
- grep -n "class_call\|class_argument_list\|fn_call\|fn_argument_list" tooling/tree-sitter-plum/grammar.js
- …and 102 more

## ⏱ Where we left off
Spec written and committed to [2026-07-20-closures-design.md](docs/superpowers/specs/2026-07-20-closures-design.md). Please review it before I write the implementation plan.

## 🌿 Git ground-truth
```
Recent commits:
4f1f2b6 docs: add design spec for closures
b6a9042 test(plum-wasm-codegen): cover same bare-generic-enum-param function at multiple instantiations
2216237 feat(plum-checker): support multiple concrete instantiations of the same generic enum
e698d53 docs: revise generic-enum plan with bare-generic-typed-param fix as Task 1
84e946f docs: amend generic-enum spec with bare-generic-typed-param fix
aedebc1 docs: add implementation plan for generic-enum multi-instantiation
32da118 docs: add design spec for generic-enum multi-instantiation support
6613e6d test(plum-checker): mark slow recursion-guard test as ignored by default
```