Documentation
¶
Overview ¶
Package effectplan performs whole-project call-graph analysis shared by backend effect planning and mode-independent scoped-resource validation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ORMOperation ¶
ORMOperation identifies intrinsics that may execute database work. It is shared by TypeScript suspension and portable execution-scope propagation.
func ValidateResources ¶ added in v0.4.4
func ValidateResources(programs []*ir.Program) []diagnostic.Diagnostic
ValidateResources is a shared semantic check, not a backend effect policy. Its call graph includes imported/generated source, defaults and recursion. Only the checked language's lifetime guarantee is claimed, not purity, termination, or protection against handwritten target-language code.
Types ¶
type Options ¶
type Options struct {
Intrinsic func(string) bool
Runtime func(*ir.RuntimeBinding) bool
Conversion func(ir.ConversionKind) bool
Transform func(*ir.Transform) bool
WebNext bool
CaptureLambdas bool
PassToFunctions bool
// ResourceSafety closes unknown/native call edges instead of assuming that
// an unclassified operation has no effect. It is mode-independent.
ResourceSafety bool
}
Options chooses effect roots while retaining one call-graph model.
type Plan ¶
type Plan struct {
Methods map[*ir.Method]bool
ParameterDefaults map[*ir.Method]bool
// ClassConstructors includes direct field defaults and the class's own
// initialize method, but never an inherited initializer.
ClassConstructors map[*ir.Class]bool
RecordDefaults map[*ir.Record]bool
RecordFieldDefaults map[*ir.RecordField]bool
// RecordConstructDefaults marks sites that evaluate an omitted selected
// effect. RecordConstructSync marks sites that still need the declaration's
// helper ABI but supplied every field whose default has that effect.
RecordConstructDefaults map[*ir.RecordConstruct]bool
RecordConstructSync map[*ir.RecordConstruct]bool
Lambdas map[*ir.Lambda]bool
Calls map[*ir.Call]bool
CallParameterDefaults map[*ir.Call]bool
EnumCalls map[*ir.EnumCall]bool
EnumCallDefaults map[*ir.EnumCall]bool
Expressions map[ir.Expression]bool
Iterations map[*ir.Iterate]bool
StructuredBlocks map[*ir.StructuredBlock]bool
// LambdaModules retains the source module that owns each first-class
// function. Backend policy can use that identity without moving target-
// specific suspension rules into shared TypeRB semantics.
LambdaModules map[*ir.Lambda]string
ResourceFailures map[ir.Statement]string
// contains filtered or unexported fields
}
Plan records the declarations and expressions that transitively reach one of the backend effects selected by Options.
func ExecutionScope ¶
ExecutionScope computes the functions that must receive the compiler-owned cancellation/deadline scope. The list contains operations whose native implementations can observe cancellation, plus web runtime boundaries that forward a child scope.
func (*Plan) Method ¶
Method reports whether a named project method transitively reaches an effect root. Integrations use this stable identity when dispatch code is generated outside the module that owns the method.
func (*Plan) RecordDefault ¶ added in v0.3.44
RecordDefault reports whether evaluating a record's omitted field defaults transitively reaches an effect root.
func (*Plan) RecordDefaultFor ¶ added in v0.3.44
RecordDefaultFor reports the effect of one exact record declaration. Code generators use declaration identity so same-named records in namespaces do not accidentally share a hidden ABI.
func (*Plan) RecordFieldDefaultFor ¶ added in v0.3.44
func (p *Plan) RecordFieldDefaultFor(field *ir.RecordField) bool
RecordFieldDefaultFor reports whether one field's default reaches an effect root. Calls use this finer-grained fact so explicitly supplied fields do not make an otherwise synchronous construction effectful.