Skip to content

Add semantic const evaluation#41

Merged
itsfuad merged 13 commits into
mainfrom
feature/array-slice-value-semantics
Jul 3, 2026
Merged

Add semantic const evaluation#41
itsfuad merged 13 commits into
mainfrom
feature/array-slice-value-semantics

Conversation

@itsfuad

@itsfuad itsfuad commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • add semantic const-eval query support after resolution and before typechecking
  • keep arithmetic folding in shared constvalue, including cached const identifiers retyped under expected/common numeric context
  • move AST type syntax text onto TypeExpr.TypeText() methods and remove parser/IR formatting ownership leaks
  • move MIR static data generation to semantic const values and emit LLVM-valid float static literals
  • move fixed-array const-index diagnostics into typechecker and materialize const indexes during HIR lowering
  • keep HIR folding optimization-only for array bounds; backend array bounds remain fallback/invariant checks
  • add ship one-word agent workflow trigger for commit/PR/merge/project automation

Validation

  • env GOCACHE=/tmp/peeper-go-cache go test ./internal/frontend/ast ./internal/frontend/parser ./internal/semantics/consteval ./internal/ir/mir ./internal/pipeline -count=1 -timeout 120s -p 1
  • env GOCACHE=/tmp/peeper-go-cache go test ./... -count=1 -timeout 120s -p 1
  • env GOCACHE=/tmp/peeper-go-cache go run ./scripts/bundle.go
  • ./build/bin/peeper check x_test/review_consteval_gaps/src/main.peep
  • ./build/bin/peeper check x_test/runtime_numbers/src/main.peep
  • git diff --check

Follow-up

  • Updates Implement array and slice value semantics #27.
  • Dynamic fixed-array indexes are explicitly rejected until runtime bounds policy is designed.
  • Imported/qualified const contexts, array-length const contexts, and const fn evaluation remain future consteval work.

@itsfuad itsfuad added this to the 0.2 Language Foundations milestone Jul 1, 2026
@itsfuad itsfuad added runtime-lowering HIR/MIR/backend runtime lowering work language-model Peeper language model, ownership, pointer, optional, array/slice work labels Jul 1, 2026
@itsfuad itsfuad merged commit bcb5567 into main Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

language-model Peeper language model, ownership, pointer, optional, array/slice work runtime-lowering HIR/MIR/backend runtime lowering work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant