wasm

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

WebAssembly plugin backend

github.com/webong/ext/pkg/ext-go/wasm binds the wazero implementation in runtime/ to the Ext plugin engine. It owns the engine/plugin.Backend implementations, the binding to the existing JSON-line transport, plugin reactor ABI, profiles, and shared error mapping.

The runtime-neutral contract stays in pkg/ext-go/core/wasm. Generic WebAssembly inspection, WASI command execution, persistent byte streams, and raw reactor hosting live in runtime/, which imports no plugin package. Applications that only need WebAssembly can import runtime/ directly.

Cross-language interoperability tests live in tests/crosslang. Run them with scripts/plugin-crosslang.sh from the repository root.

See the interoperability guide and the runtime authoring guide.

Source boundaries

Descriptors, backend interfaces, profiles and errors come directly from engine/plugin. The WASI command backend still embeds the existing engine/plugin/transport/jsonline.Client; its lifecycle and framing code remain there. The reactor uses the wazero runtime in this module, with the public contract defined by src/ctx/web.

This is a plugin backend (guest execution), not a driver for accessing Ext's canonical C libraries. No C driver, module path, default or build tag changed.

Documentation

Overview

Package wasm binds the wazero runtime to the Ext plugin engine.

Index

Constants

View Source
const (
	TargetNone      = webwasm.TargetNone
	TargetWASI      = webwasm.TargetWASI
	TargetHost      = webwasm.TargetHost
	TargetComponent = webwasm.TargetComponent
)
View Source
const DefaultMemoryPages = webwasm.DefaultMemoryPages
View Source
const MaxModuleBytes = webwasm.MaxModuleBytes

Variables

This section is empty.

Functions

func Profile

func Profile() plugin.BackendProfile

func ReactorProfile

func ReactorProfile() plugin.BackendProfile

func RunCommand

func RunCommand(ctx context.Context, module []byte, opts CommandOptions) (int, error)

Types

type Backend

type Backend struct {
	*jsonline.Client
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, module []byte, opts Options) (*Backend, error)

Open starts a persistent WASI command and binds its raw byte stream to the ext.io.pc/v1 JSON-line transport. A guest SDK compiles its reactor exports into every wasm32 module, so a WASI command may import ext_plugin.reverse without ever calling it: Open provides the reactor ABI's stubs unless opts names its own.

func (*Backend) Wait

func (b *Backend) Wait(ctx context.Context) error

type CommandOptions

type CommandOptions = webwasm.CommandOptions

type CompilationCache added in v0.5.0

type CompilationCache = runtime.CompilationCache

CompilationCache keeps compiled modules, so opening the same module again skips compilation: set it in Options.CompilationCache. Share one among the sessions of a process and Close it after they have closed.

func NewCompilationCache added in v0.5.0

func NewCompilationCache() *CompilationCache

NewCompilationCache returns an empty cache that lives in memory.

type Inspection

type Inspection = webwasm.Inspection

func Inspect

func Inspect(ctx context.Context, module []byte) (Inspection, error)

type Options

type Options = webwasm.Options

type ReactorBackend

type ReactorBackend struct {
	// contains filtered or unexported fields
}

func OpenReactor

func OpenReactor(ctx context.Context, module []byte, opts ReactorOptions) (*ReactorBackend, error)

func (*ReactorBackend) Close

func (b *ReactorBackend) Close() error

func (*ReactorBackend) Handshake

func (b *ReactorBackend) Handshake(ctx context.Context) (plugin.Descriptor, error)

func (*ReactorBackend) Invoke

func (b *ReactorBackend) Invoke(ctx context.Context, request plugin.Request) (plugin.Response, error)

func (*ReactorBackend) WaitClosed

func (b *ReactorBackend) WaitClosed(ctx context.Context) error

type ReactorOptions

type ReactorOptions = webwasm.ReactorOptions

type Target

type Target = webwasm.Target

Directories

Path Synopsis
Package runtime implements the src/ctx/web WebAssembly host contract with wazero.
Package runtime implements the src/ctx/web WebAssembly host contract with wazero.
cmd/wasirun command
wasirun checks a portable C guest core compiled to WASI Preview 1.
wasirun checks a portable C guest core compiled to WASI Preview 1.

Jump to

Keyboard shortcuts

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