Skip to content

Platform capabilities

Gobb uses one explicit host-capability contract for interpreted and compiled programs. The same contract is executed under native Go, WASI, and browser Wasm during make capability-test.

A limited capability exists but remains constrained by its host or sandbox. An unavailable operation throws structured exception data instead of leaking a Go or platform-specific failure.

Capability Native WASI Browser Wasm
Clojure evaluation available available available
Standard streams available available limited
The JavaScript host supplies virtual streams
Environment variables available limited
Only variables explicitly inherited by the WASI host are visible
limited
Only variables supplied by the JavaScript host are visible
Wall clock available available available
Secure random bytes available available available
Host filesystem available limited
Access is restricted to directories preopened by the WASI host
unavailable
Browsers expose no ambient host filesystem
Working directory available limited
The directory exists only inside the host's preopened view
unavailable
Browser Wasm has no host working directory
Subprocesses available unavailable
WASI preview 1 has no process creation API
unavailable
Browsers cannot spawn host processes
Signals available unavailable
WASI preview 1 does not expose POSIX signal handling
unavailable
Browser events are not operating-system signals
Networking available unavailable
The current WASI target has no socket proposal enabled
limited
Fetch and WebSocket are possible; raw TCP, UDP, and listeners are not
Interactive terminal available limited
Interactive behavior depends entirely on the WASI host
limited
The website supplies a terminal-like REPL UI
Arbitrary JVM bytecode unavailable
Gobb deliberately runs without a JVM
unavailable
Gobb deliberately runs without a JVM
unavailable
Gobb deliberately runs without a JVM

Structured failures

Unavailable operations throw ExceptionInfo with stable data:

{:type :gobb/unsupported-capability
 :capability :process
 :target :browser
 :platform "js/wasm"
 :operation :spawn
 :status :unavailable}

The target is derived from Go's compile-time GOOS and GOARCH; callers do not configure it at runtime.

Host adapters

gobb.capabilities owns the low-level boundaries used by future BB library ports: environment lookup, clocks, secure randomness, filesystem I/O, working-directory access, and subprocess execution. Higher-level ports such as babashka.fs and babashka.process build on these adapters in later milestones.

Regenerate the runtime contract and this page with:

make capabilities