Help us shape the future of Go! Take the 2026 Go Developer Survey

flatstack

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package flatstack provides the runner embedding API with an opt-in flat bytecode backend. Unsupported programs are rejected before execution and run by the full interpreter, preserving runner behavior while the bytecode subset grows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Supports

func Supports(p *model.Program) error

Supports reports whether p will execute through flat bytecode rather than the compatibility interpreter. Call this in benchmarks to prevent measuring an accidental fallback.

Types

type Context

type Context = runner.Context

Context is runner.Context.

func FromRequest

func FromRequest(r *http.Request) Context

FromRequest returns the request context of r, decoded as a script reads it.

func NewContext

func NewContext() Context

NewContext returns a request context a host fills itself.

type ExitError

type ExitError = runner.ExitError

ExitError is runner.ExitError.

func IsExit

func IsExit(err error) (*ExitError, bool)

IsExit reports whether err is the error exit() and die() raise, and answers it.

type ExprCache

type ExprCache = runner.ExprCache

ExprCache is runner.ExprCache.

func NewExprCache

func NewExprCache() *ExprCache

NewExprCache returns a compiled-expression cache to share between runtimes.

type HostPanicError

type HostPanicError = runner.HostPanicError

HostPanicError is runner.HostPanicError.

type IncludeCache

type IncludeCache = runner.IncludeCache

IncludeCache is runner.IncludeCache.

func NewIncludeCache

func NewIncludeCache() *IncludeCache

NewIncludeCache returns a parsed-program cache to share between runtimes.

type IncludeFunc

type IncludeFunc = runner.IncludeFunc

IncludeFunc is runner.IncludeFunc.

type Options

type Options = runner.Options

Options is runner.Options.

type Runtime

type Runtime = runner.Runtime

Runtime is runner.Runtime.

func New

func New(w io.Writer, opts Options) *Runtime

New returns a runtime that executes a supported program through flat bytecode and delegates the whole of an unsupported one to the interpreter. It is the one call that separates this package from runner.

type Scope

type Scope = runner.Scope

Scope is runner.Scope.

func NewScope

func NewScope() *Scope

NewScope returns an empty scope.

func ScopeFromContext

func ScopeFromContext(ctx context.Context) (*Scope, bool)

ScopeFromContext answers the PHP scope a binding was called from, when one is on ctx.

Directories

Path Synopsis
Package engine compiles model AST programs into flat bytecode and executes them against a host-provided PHP semantics bridge.
Package engine compiles model AST programs into flat bytecode and executes them against a host-provided PHP semantics bridge.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL