refactor: rename interpreter to runtime and use receiver methods

- Rename pkg/interpreter to pkg/runtime
- Move ReduceOnce to new pkg/normalorder package
- Convert standalone functions (Substitute, Rename, GetFree, IsFree)
  to receiver methods on concrete expression types
- Change Set from pointer receivers to value receivers
- Update all references from interpreter to runtime terminology

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 15:11:04 -05:00
parent e85cf7ceff
commit d715d38e9e
26 changed files with 200 additions and 196 deletions

View File

@@ -5,19 +5,19 @@ package plugins
import (
"fmt"
"git.maximhutz.com/max/lambda/pkg/interpreter"
"git.maximhutz.com/max/lambda/pkg/runtime"
)
// Track the reductions made by a reduction process.
type Explanation struct {
reducer interpreter.Interpreter
reducer runtime.Runtime
}
// Attaches a new explanation tracker to a reducer.
func NewExplanation(r interpreter.Interpreter) *Explanation {
func NewExplanation(r runtime.Runtime) *Explanation {
plugin := &Explanation{reducer: r}
r.On(interpreter.StartEvent, plugin.Start)
r.On(interpreter.StepEvent, plugin.Step)
r.On(runtime.StartEvent, plugin.Start)
r.On(runtime.StepEvent, plugin.Step)
return plugin
}