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

@@ -6,7 +6,7 @@ import (
"time"
"git.maximhutz.com/max/lambda/internal/statistics"
"git.maximhutz.com/max/lambda/pkg/interpreter"
"git.maximhutz.com/max/lambda/pkg/runtime"
)
// An observer, to track reduction performance.
@@ -16,11 +16,11 @@ type Statistics struct {
}
// Create a new reduction performance Statistics.
func NewStatistics(r interpreter.Interpreter) *Statistics {
func NewStatistics(r runtime.Runtime) *Statistics {
plugin := &Statistics{}
r.On(interpreter.StartEvent, plugin.Start)
r.On(interpreter.StepEvent, plugin.Step)
r.On(interpreter.StopEvent, plugin.Stop)
r.On(runtime.StartEvent, plugin.Start)
r.On(runtime.StepEvent, plugin.Step)
r.On(runtime.StopEvent, plugin.Stop)
return plugin
}