Summary
Every public constructor in polyscript.go and the per-engine new.go files takes slog.Handler as a required positional argument. Most call sites pass slog.Default().Handler().
The compilers already default to a stderr handler in applyDefaults():
engines/risor/compiler/options.go:91
engines/extism/compiler/options.go:107
Top-level constructors should follow the same pattern.
Proposal
Treat a nil slog.Handler as "use the default". A library probably shouldn't write to stderr by default — a discard handler is more polite — but at minimum the constructors shouldn't require the argument.
Files
polyscript.go
engines/risor/new.go
engines/starlark/new.go
engines/extism/new.go
engines/new.go
- (Reconsider stderr default in compilers'
applyDefaults.)
This is a breaking-change candidate for v1; it removes a positional argument from the public constructor surface.
Summary
Every public constructor in
polyscript.goand the per-enginenew.gofiles takesslog.Handleras a required positional argument. Most call sites passslog.Default().Handler().The compilers already default to a stderr handler in
applyDefaults():engines/risor/compiler/options.go:91engines/extism/compiler/options.go:107Top-level constructors should follow the same pattern.
Proposal
Treat a nil
slog.Handleras "use the default". A library probably shouldn't write to stderr by default — a discard handler is more polite — but at minimum the constructors shouldn't require the argument.Files
polyscript.goengines/risor/new.goengines/starlark/new.goengines/extism/new.goengines/new.goapplyDefaults.)This is a breaking-change candidate for v1; it removes a positional argument from the public constructor surface.