100% Sandboxed WebAssembly & CLI Toolchain
Ube is engineered specifically as a WebAssembly-native language. There is zero unsafe escape hatch, no raw hardware pointer manipulation, and platform integration is cleanly governed by typed host imports.
1. The Sandboxed WebAssembly Model
In Ube v0.6.0+, the language is 100% sandboxed WebAssembly:
- The
unsafekeyword is permanently removed and rejected at parse time. - Raw pointer types (
*T), address-of operations (&var), and raw dereferences do not exist. - There are no OS-specific C headers, native syscall inline assembly, or unbounded memory access.
- Code compiles directly to standard
wasm32-wasibytecode, executing securely across browsers, cloud edge runtimes, and local game engines.
ube check main.ube statically validates that your code adheres to 100% sandboxed WebAssembly execution rules.
2. Host Imports via extern fn
To interface with host runtime features (e.g., WebGPU, Canvas, fetch, DOM, or custom game engine bindings), declare typed host imports using extern fn. Because host imports are strongly typed, they never require an unsafe block:
// WebAssembly host environment functions
extern fn host_print(msg: string)
extern fn time_now_ms() -> i64
extern fn canvas_draw_rect(x: f32, y: f32, w: f32, h: f32)
fn main() {
let start = time_now_ms()
host_print("Executing game tick inside sandboxed Wasm container")
canvas_draw_rect(10.0, 20.0, 100.0, 50.0)
let elapsed = time_now_ms() - start
println(f"Frame rendered in {elapsed} ms")
}
3. Browser Canvas & HTML Packaging
Ube can package code directly into an interactive HTML5 / Web Canvas application with a single command:
// Build a standalone HTML page with embedded Wasm:
// $ ube build game.ube --html -o game.html
The resulting HTML file runs directly in any modern browser with hardware-accelerated WebAssembly execution.
4. Complete CLI Command Reference
The ube CLI bundles an entire compiler, test runner, formatter, doc generator, and Language Server:
| Command | Usage | Description |
|---|---|---|
ube new |
ube new myapp |
Scaffolds a new Ube project with standard structure and ube.mod. |
ube run |
ube run main.ube |
Compiles to Wasm and runs it using wasmtime, wasmer, node, deno, or wasm3. |
ube build |
ube build main.ube |
Compiles to a sandboxed WebAssembly / WASI module (main.wasm). |
ube build --html |
ube build main.ube --html |
Packages a browser-ready Web Canvas / HTML app with Emscripten. |
ube build --emit-c |
ube build main.ube --emit-c |
Preserves the generated intermediate C source for custom toolchain inspection. |
ube check |
ube check main.ube |
Audits types, arenas, ownership, and sandbox purity without emitting binaries. |
ube test |
ube test tests/ |
Discovers and executes all test suites and test_* functions. |
ube fmt |
ube fmt -w . |
Formats all .ube source files in the project. |
ube doc |
ube doc main.ube |
Prints documentation signatures and exported functions to stdout. |
ube lsp |
ube lsp |
Launches the Language Server Protocol for VS Code and Zed editor extensions. |
ube guide |
ube guide |
Generates the AI Reference Specification document (ube_guide.md). |
ube context |
ube context . -o ctx.txt |
Exports codebase architecture context optimized for Large Language Models. |
5. AI-Native Workflows & Textify Integration
Ube is specifically designed for seamless cooperation with AI coding agents (Claude, Gemini, ChatGPT). Because Ube has clean grammar, explicit types, and zero hidden control flow, LLMs reason about Ube programs with exceptional precision.
You can combine Ube with Textify to extract lightweight symbol signatures and function call graphs while saving up to 90% of prompt tokens:
# 1. Export lightweight signatures for AI prompt:
$ textify signatures -s
# 2. Extract deep AST trace of a specific function or type:
$ textify trace Typechecker.checkStmt
# 3. Generate complete codebase context for AI:
$ ube context . -o context.txt