Documentation
¶
Overview ¶
Package wago exposes compile, instantiate, and run helpers for WebAssembly modules. It is a generated facade over the implementation in src/wago, so callers import the stable path "github.com/wago-org/wago" while the code lives under src/wago alongside the rest of the engine.
Index ¶
- Constants
- func AsF32(b uint64) float32
- func AsF64(b uint64) float64
- func AsI32(b uint64) int32
- func AsI64(b uint64) int64
- func F32(v float32) uint64
- func F64(v float64) uint64
- func GuardPageSupported() bool
- func GuestArgs() []string
- func I32(v int32) uint64
- func I64(v int64) uint64
- func IsCompiled(b []byte) bool
- func IsGuardPageUnavailable(err error) bool
- func IsSnapshot(b []byte) bool
- func ProvideService(reg *Registry, name string, value any) error
- func RegisterExtension(name string, factory ExtensionFactory)
- func RegisteredPluginNames() []string
- func SetGuestArgs(args []string)
- func SetOptKnob(name string, on bool) bool
- type BoundsCheckMode
- type CallerResolver
- type Capability
- type CapabilityBudget
- type CapabilityOption
- type Compatibility
- type CompileContext
- type CompileHookAccess
- type Compiled
- type ConfigSchemaProvider
- type CoreFeatures
- type DataInit
- type Dirs
- type ElemInit
- type ElemMode
- type ExitError
- type Extension
- type ExtensionError
- type ExtensionFactory
- type ExtensionInfo
- type ExternRef
- type ExternRefHostModule
- type FuncRef
- type FuncSig
- type FunctionMetadata
- type GCAllocatorKind
- type GCConfig
- type GCProfile
- type GCRuntimeKind
- type Global
- type GlobalDef
- type GlobalImport
- type GlobalImportDef
- type GlobalMetadata
- type GuardPageUnavailableError
- type Handle
- type HandleTable
- type HookRegistry
- type HostEnvironment
- type HostExit
- type HostFunc
- type HostFuncRef
- type HostImportAccess
- type HostModule
- type ImportFuncBuilder
- type ImportKind
- type ImportModuleBuilder
- type ImportOverridePolicy
- type ImportSpec
- type Imports
- type Instance
- type InstanceContext
- type InstanceExport
- type InstanceHookAccess
- type InstanceManager
- type Instantiable
- type InstantiateContext
- type InstantiateOption
- type InstantiateOptions
- type InstantiateOrigin
- type InvokeContext
- type InvokeHookAccess
- type ManagedInstance
- type Memory
- type Module
- type ModuleMetadata
- type OffsetInit
- type OptKnobInfo
- type PassiveDataInit
- type PluginCapability
- type PluginConfig
- type PluginError
- type PluginHost
- type PluginPhase
- type PluginPlan
- type PluginPlanEntry
- type PluginStarter
- type PluginStopper
- type Policy
- type PreparedFunction
- type RefInit
- type Registry
- type Resource
- type Runtime
- type RuntimeConfig
- type RuntimeContext
- type RuntimeHookAccess
- type RuntimeOption
- type ServiceRef
- type Snapshot
- type SnapshotKind
- type SnapshotOptions
- type Stability
- type Table
- type TableMetadata
- type TrapCode
- type TrapError
- type UnsupportedFeatureError
- type UseOption
- type V128
- type ValType
- type Value
Constants ¶
View Source
const ( AllowTestOverrides = impl.AllowTestOverrides BoundsChecksExplicit = impl.BoundsChecksExplicit BoundsChecksSignalsBased = impl.BoundsChecksSignalsBased CapCompilerCodegen = impl.CapCompilerCodegen CapFilesystemRead = impl.CapFilesystemRead CapFilesystemWrite = impl.CapFilesystemWrite CapHTTPClient = impl.CapHTTPClient CapKVRead = impl.CapKVRead CapKVWrite = impl.CapKVWrite CapMetricsWrite = impl.CapMetricsWrite CapNetworkOutbound = impl.CapNetworkOutbound CapTimerRead = impl.CapTimerRead CoreFeatureBulkMemoryOperations = impl.CoreFeatureBulkMemoryOperations CoreFeatureMultiValue = impl.CoreFeatureMultiValue CoreFeatureMutableGlobal = impl.CoreFeatureMutableGlobal CoreFeatureNonTrappingFloatToIntConversion = impl.CoreFeatureNonTrappingFloatToIntConversion CoreFeatureReferenceTypes = impl.CoreFeatureReferenceTypes CoreFeatureSIMD = impl.CoreFeatureSIMD CoreFeatureSignExtensionOps = impl.CoreFeatureSignExtensionOps CoreFeatureTailCall = impl.CoreFeatureTailCall CoreFeaturesV1 = impl.CoreFeaturesV1 CoreFeaturesV2 = impl.CoreFeaturesV2 Deprecated = impl.Deprecated ElemModeActive = impl.ElemModeActive ElemModeDeclarative = impl.ElemModeDeclarative ElemModePassive = impl.ElemModePassive ErrExtensionConflict = impl.ErrExtensionConflict ErrInvalidHandle = impl.ErrInvalidHandle ErrManagedImportLifetime = impl.ErrManagedImportLifetime ErrMissingImport = impl.ErrMissingImport ErrPermissionDenied = impl.ErrPermissionDenied Experimental = impl.Experimental GCAllocatorPagedSizeClass = impl.GCAllocatorPagedSizeClass GCAllocatorTinyFixedBlock = impl.GCAllocatorTinyFixedBlock GCProfileThroughput = impl.GCProfileThroughput GCProfileTiny = impl.GCProfileTiny GCRuntimeGenerational = impl.GCRuntimeGenerational GCRuntimeIncrementalMarkSweep = impl.GCRuntimeIncrementalMarkSweep ImportFunc = impl.ImportFunc ImportGlobal = impl.ImportGlobal ImportMemory = impl.ImportMemory ImportTable = impl.ImportTable InstantiateDirect = impl.InstantiateDirect InstantiateManaged = impl.InstantiateManaged NoExtensionOverrides = impl.NoExtensionOverrides PluginCompileHooks = impl.PluginCompileHooks PluginHostEnvironment = impl.PluginHostEnvironment PluginHostImports = impl.PluginHostImports PluginInstanceHooks = impl.PluginInstanceHooks PluginInvokeHooks = impl.PluginInvokeHooks PluginManagedInstances = impl.PluginManagedInstances PluginPhaseAuthorize = impl.PluginPhaseAuthorize PluginPhaseConfigure = impl.PluginPhaseConfigure PluginPhaseRegister = impl.PluginPhaseRegister PluginPhaseResolve = impl.PluginPhaseResolve PluginPhaseStart = impl.PluginPhaseStart PluginPhaseStop = impl.PluginPhaseStop PluginRuntimeHooks = impl.PluginRuntimeHooks SnapshotInit = impl.SnapshotInit SnapshotWarm = impl.SnapshotWarm Stable = impl.Stable TrapBuiltin = impl.TrapBuiltin TrapCalledFnNotLinked = impl.TrapCalledFnNotLinked TrapDivOverflow = impl.TrapDivOverflow TrapDivZero = impl.TrapDivZero TrapIndirectOutOfBounds = impl.TrapIndirectOutOfBounds TrapIndirectWrongSig = impl.TrapIndirectWrongSig TrapInterrupted = impl.TrapInterrupted TrapLinMemCouldNotExtend = impl.TrapLinMemCouldNotExtend TrapLinMemOutOfBounds = impl.TrapLinMemOutOfBounds TrapLinkedMemNotLinked = impl.TrapLinkedMemNotLinked TrapLinkedMemOutOfBounds = impl.TrapLinkedMemOutOfBounds TrapNone = impl.TrapNone TrapStackFenceBreached = impl.TrapStackFenceBreached TrapTruncOverflow = impl.TrapTruncOverflow TrapUnreachable = impl.TrapUnreachable ValExternRef = impl.ValExternRef ValF32 = impl.ValF32 ValF64 = impl.ValF64 ValFuncRef = impl.ValFuncRef ValI32 = impl.ValI32 ValI64 = impl.ValI64 ValV128 = impl.ValV128 Version = impl.Version )
Variables ¶
This section is empty.
Functions ¶
func GuardPageSupported ¶
func GuardPageSupported() bool
func IsCompiled ¶
func IsGuardPageUnavailable ¶
func IsSnapshot ¶
func RegisterExtension ¶
func RegisterExtension(name string, factory ExtensionFactory)
func RegisteredPluginNames ¶
func RegisteredPluginNames() []string
func SetGuestArgs ¶
func SetGuestArgs(args []string)
func SetOptKnob ¶
Types ¶
type BoundsCheckMode ¶
type BoundsCheckMode = impl.BoundsCheckMode
type CallerResolver ¶
type CallerResolver = impl.CallerResolver
type Capability ¶
type Capability = impl.Capability
type CapabilityBudget ¶
type CapabilityBudget = impl.CapabilityBudget
type CapabilityOption ¶
type CapabilityOption = impl.CapabilityOption
func CapabilityDocs ¶
func CapabilityDocs(docs string) CapabilityOption
type Compatibility ¶
type Compatibility = impl.Compatibility
type CompileContext ¶
type CompileContext = impl.CompileContext
type CompileHookAccess ¶
type CompileHookAccess = impl.CompileHookAccess
type Compiled ¶
func CompileWithConfig ¶
func CompileWithConfig(cfg *RuntimeConfig, wasmBytes []byte) (*Compiled, error)
func MustCompile ¶
type ConfigSchemaProvider ¶
type ConfigSchemaProvider = impl.ConfigSchemaProvider
type CoreFeatures ¶
type CoreFeatures = impl.CoreFeatures
func SupportedFeatures ¶
func SupportedFeatures() CoreFeatures
type Extension ¶
func NewExtension ¶
type ExtensionError ¶
type ExtensionError = impl.ExtensionError
type ExtensionFactory ¶
type ExtensionFactory = impl.ExtensionFactory
type ExtensionInfo ¶
type ExtensionInfo = impl.ExtensionInfo
type ExternRef ¶
func NullExternRef ¶
func NullExternRef() ExternRef
type ExternRefHostModule ¶
type ExternRefHostModule = impl.ExternRefHostModule
type FunctionMetadata ¶
type FunctionMetadata = impl.FunctionMetadata
type GCAllocatorKind ¶
type GCAllocatorKind = impl.GCAllocatorKind
type GCRuntimeKind ¶
type GCRuntimeKind = impl.GCRuntimeKind
type Global ¶
func NewGlobalF32 ¶
func NewGlobalF64 ¶
func NewGlobalI32 ¶
func NewGlobalI64 ¶
func NewGlobalV128 ¶
type GlobalImport ¶
type GlobalImport = impl.GlobalImport
type GlobalImportDef ¶
type GlobalImportDef = impl.GlobalImportDef
type GlobalMetadata ¶
type GlobalMetadata = impl.GlobalMetadata
type GuardPageUnavailableError ¶
type GuardPageUnavailableError = impl.GuardPageUnavailableError
type HandleTable ¶
type HandleTable = impl.HandleTable
func NewHandleTable ¶
func NewHandleTable() *HandleTable
type HookRegistry ¶
type HookRegistry = impl.HookRegistry
type HostEnvironment ¶
type HostEnvironment = impl.HostEnvironment
type HostFuncRef ¶
type HostFuncRef = impl.HostFuncRef
type HostImportAccess ¶
type HostImportAccess = impl.HostImportAccess
type HostModule ¶
type HostModule = impl.HostModule
type ImportFuncBuilder ¶
type ImportFuncBuilder = impl.ImportFuncBuilder
type ImportKind ¶
type ImportKind = impl.ImportKind
type ImportModuleBuilder ¶
type ImportModuleBuilder = impl.ImportModuleBuilder
type ImportOverridePolicy ¶
type ImportOverridePolicy = impl.ImportOverridePolicy
type ImportSpec ¶
type ImportSpec = impl.ImportSpec
type Instance ¶
func Instantiate ¶
func Instantiate(source Instantiable, opts ...any) (*Instance, error)
type InstanceContext ¶
type InstanceContext = impl.InstanceContext
type InstanceExport ¶
type InstanceExport = impl.InstanceExport
type InstanceHookAccess ¶
type InstanceHookAccess = impl.InstanceHookAccess
type InstanceManager ¶
type InstanceManager = impl.InstanceManager
type Instantiable ¶
type Instantiable = impl.Instantiable
type InstantiateContext ¶
type InstantiateContext = impl.InstantiateContext
type InstantiateOption ¶
type InstantiateOption = impl.InstantiateOption
func WithGC ¶
func WithGC(gc GCConfig) InstantiateOption
func WithImports ¶
func WithImports(im Imports) InstantiateOption
func WithPolicy ¶
func WithPolicy(p Policy) InstantiateOption
type InstantiateOptions ¶
type InstantiateOptions = impl.InstantiateOptions
type InstantiateOrigin ¶
type InstantiateOrigin = impl.InstantiateOrigin
type InvokeContext ¶
type InvokeContext = impl.InvokeContext
type InvokeHookAccess ¶
type InvokeHookAccess = impl.InvokeHookAccess
type ManagedInstance ¶
type ManagedInstance = impl.ManagedInstance
type ModuleMetadata ¶
type ModuleMetadata = impl.ModuleMetadata
type OffsetInit ¶
type OffsetInit = impl.OffsetInit
type OptKnobInfo ¶
type OptKnobInfo = impl.OptKnobInfo
func OptKnobs ¶
func OptKnobs() []OptKnobInfo
type PassiveDataInit ¶
type PassiveDataInit = impl.PassiveDataInit
type PluginCapability ¶
type PluginCapability = impl.PluginCapability
type PluginConfig ¶
type PluginConfig = impl.PluginConfig
type PluginError ¶
type PluginError = impl.PluginError
type PluginHost ¶
type PluginHost = impl.PluginHost
type PluginPhase ¶
type PluginPhase = impl.PluginPhase
type PluginPlan ¶
type PluginPlan = impl.PluginPlan
func InspectPluginPlan ¶
func InspectPluginPlan(configs []PluginConfig) (*PluginPlan, error)
type PluginPlanEntry ¶
type PluginPlanEntry = impl.PluginPlanEntry
type PluginStarter ¶
type PluginStarter = impl.PluginStarter
type PluginStopper ¶
type PluginStopper = impl.PluginStopper
type PreparedFunction ¶
type PreparedFunction = impl.PreparedFunction
type Runtime ¶
func NewRuntime ¶
func NewRuntime(opts ...RuntimeOption) *Runtime
type RuntimeConfig ¶
type RuntimeConfig = impl.RuntimeConfig
func NewRuntimeConfig ¶
func NewRuntimeConfig() *RuntimeConfig
type RuntimeContext ¶
type RuntimeContext = impl.RuntimeContext
type RuntimeHookAccess ¶
type RuntimeHookAccess = impl.RuntimeHookAccess
type RuntimeOption ¶
type RuntimeOption = impl.RuntimeOption
func WithImportOverridePolicy ¶
func WithImportOverridePolicy(p ImportOverridePolicy) RuntimeOption
func WithRuntimeConfig ¶
func WithRuntimeConfig(cfg *RuntimeConfig) RuntimeOption
type ServiceRef ¶
type ServiceRef = impl.ServiceRef
func RequireService ¶
func RequireService(reg *Registry, name string) (*ServiceRef, error)
type SnapshotKind ¶
type SnapshotKind = impl.SnapshotKind
type SnapshotOptions ¶
type SnapshotOptions = impl.SnapshotOptions
type TableMetadata ¶
type TableMetadata = impl.TableMetadata
type UnsupportedFeatureError ¶
type UnsupportedFeatureError = impl.UnsupportedFeatureError
type UseOption ¶
func WithPluginGrants ¶
func WithPluginGrants(caps ...PluginCapability) UseOption
Directories
¶
| Path | Synopsis |
|---|---|
|
cli
|
|
|
wago
command
Command wago runs WebAssembly modules.
|
Command wago runs WebAssembly modules. |
|
wagocli
Package wagocli is the wago command implementation.
|
Package wagocli is the wago command implementation. |
|
examples
|
|
|
01-hello
command
Example 01: hello — the lowest-level API.
|
Example 01: hello — the lowest-level API. |
|
02-runtime-typed
command
Example 02: runtime + typed Call.
|
Example 02: runtime + typed Call. |
|
03-host-import
command
Example 03: host imports.
|
Example 03: host imports. |
|
04-memory
command
Example 04: reading guest memory from a host function.
|
Example 04: reading guest memory from a host function. |
|
05-globals
command
Example 05: exported globals.
|
Example 05: exported globals. |
|
08-custom-plugin
command
Example 08: writing your own plugin.
|
Example 08: writing your own plugin. |
|
10-hooks
command
Example 10: lifecycle hooks (observability).
|
Example 10: lifecycle hooks (observability). |
|
14-handles
command
Example 14: resource handles.
|
Example 14: resource handles. |
|
15-config
command
Example 15: runtime configuration.
|
Example 15: runtime configuration. |
|
16-serialize
command
Example 16: precompiling to a .wago blob.
|
Example 16: precompiling to a .wago blob. |
|
internal/mods
Package mods builds the tiny WebAssembly modules the examples run against.
|
Package mods builds the tiny WebAssembly modules the examples run against. |
|
internal
|
|
|
functionworkers
Package functionworkers resolves Wago's bounded per-module function worker policy for validation and native code generation.
|
Package functionworkers resolves Wago's bounded per-module function worker policy for validation and native code generation. |
|
genfacade
command
Command genfacade regenerates the root re-export facade (wago.go) from the exported identifiers of ./src/wago.
|
Command genfacade regenerates the root re-export facade (wago.go) from the exported identifiers of ./src/wago. |
|
spectest
Package spectest contains shared discovery helpers for the external WebAssembly specification corpora used by compiler and runtime tests.
|
Package spectest contains shared discovery helpers for the external WebAssembly specification corpora used by compiler and runtime tests. |
|
Package plugin provides typed helpers for composing Wago plugins.
|
Package plugin provides typed helpers for composing Wago plugins. |
|
src
|
|
|
core/compiler/backend/railshot
Package railshot is the architecture-NEUTRAL core of the railshot single-pass wasm backend.
|
Package railshot is the architecture-NEUTRAL core of the railshot single-pass wasm backend. |
|
core/compiler/backend/railshot/amd64
Package railshot is wago's single-pass x86-64 code generator — the "railshot" compiler tier (it lives under backend/railshot; a future optimizing tier will sit alongside it).
|
Package railshot is wago's single-pass x86-64 code generator — the "railshot" compiler tier (it lives under backend/railshot; a future optimizing tier will sit alongside it). |
|
core/compiler/backend/railshot/arm64
Package arm64 holds the AArch64-specific half of the railshot single-pass backend — the twin of railshot/amd64.
|
Package arm64 holds the AArch64-specific half of the railshot single-pass backend — the twin of railshot/amd64. |
|
core/compiler/backend/railshot/shared
Package shared contains small, architecture-neutral building blocks used by Railshot backends.
|
Package shared contains small, architecture-neutral building blocks used by Railshot backends. |
|
core/compiler/codegen
Package codegen defines backend-neutral compiler contracts shared by wasm and IR lowering paths.
|
Package codegen defines backend-neutral compiler contracts shared by wasm and IR lowering paths. |
|
core/compiler/frontend
Package frontend contains compiler front-end passes shared by the CLI and API.
|
Package frontend contains compiler front-end passes shared by the CLI and API. |
|
core/compiler/wasm
Package wasm contains a structured WebAssembly binary decoder and validator for post-MVP proposals including reference types, exception handling tags, typed function references, GC, stringrefs, SIMD, atomics, bulk memory, and memory64 encodings.
|
Package wasm contains a structured WebAssembly binary decoder and validator for post-MVP proposals including reference types, exception handling tags, typed function references, GC, stringrefs, SIMD, atomics, bulk memory, and memory64 encodings. |
|
core/encoder/amd64
Package amd64 is the x86-64 instruction encoder (the Asm type) that the code generator in backend/railshot drives to emit machine code.
|
Package amd64 is the x86-64 instruction encoder (the Asm type) that the code generator in backend/railshot drives to emit machine code. |
|
core/encoder/arm64
Package arm64 is wago's AArch64 (arm64) instruction encoder — the arm64 twin of src/core/encoder/amd64.
|
Package arm64 is wago's AArch64 (arm64) instruction encoder — the arm64 twin of src/core/encoder/amd64. |
|
core/runtime/abi
Package abi exposes runtime layout constants shared by native-code emitters and the runtime implementation.
|
Package abi exposes runtime layout constants shared by native-code emitters and the runtime implementation. |
|
core/semver
Package semver implements Semantic Versioning 2.0.0 (https://semver.org): version parsing, precedence comparison (including pre-release and build metadata rules), and npm-style range constraints (comparators, ^, ~, x-ranges, hyphen ranges, AND, and || OR).
|
Package semver implements Semantic Versioning 2.0.0 (https://semver.org): version parsing, precedence comparison (including pre-release and build metadata rules), and npm-style range constraints (comparators, ^, ~, x-ranges, hyphen ranges, AND, and || OR). |
|
wago
Package wago compiles and runs WebAssembly modules with a pure-Go, no-cgo single-pass JIT.
|
Package wago compiles and runs WebAssembly modules with a pure-Go, no-cgo single-pass JIT. |
|
testutil
|
|
Click to show internal directories.
Click to hide internal directories.