// Package "engine" provides an extensible interface for users to interfact with // λ-calculus. package engine import ( "git.maximhutz.com/max/lambda/internal/config" "git.maximhutz.com/max/lambda/pkg/emitter" ) // Engine is an interface for reduction engines. type Engine interface { Run() GetResult() string On(message string, fn func()) *emitter.Observer Emit(message string) } // New creates the appropriate engine based on the config. func New(cfg *config.Config, input interface{}) Engine { if cfg.Interpreter == "debruijn" { return NewDeBruijnEngine(cfg, input) } return NewLambdaEngine(cfg, input) }