Skip to content

WebAssembly

Understanding the technology behind Noorle plugins.

Why WebAssembly for Plugins?

Noorle leverages WebAssembly (Wasm) and the Component Model to provide:

  • Universal Compatibility - Write once, run anywhere
  • Language Freedom - Use Python, Rust, TypeScript, Go, or any language that compiles to Wasm
  • Security by Default - Sandboxed execution with capability-based security
  • Performance - Near-native execution speed
  • Portability - Same plugin works across all platforms

Key Concepts

WebAssembly (Wasm)

WebAssembly is a binary instruction format designed for:

  • Safe, sandboxed execution
  • Near-native performance
  • Language agnostic compilation target
  • Platform independence

Learn more: WebAssembly Core Specification

Component Model

The Component Model extends WebAssembly with:

  • Composability - Components can be combined and reused
  • Interface Types - Rich type system beyond basic Wasm types
  • Capability-based Security - Fine-grained permission control
  • Cross-language Interop - Components from different languages work together

Learn more: Component Model Documentation

WASI (WebAssembly System Interface)

WASI provides standard system interfaces for:

  • File system access (when permitted)
  • Network operations (when permitted)
  • Environment variables
  • Random number generation
  • Clocks and timers

Learn more: WASI Interfaces

WebAssembly Runtime

The secure execution environment for custom plugins:

Security Features

  • Complete Isolation: Each plugin runs in its own sandbox
  • Resource Limits: CPU, memory, and execution time constraints
  • No Direct System Access: All I/O through controlled interfaces
  • Capability-Based Security: Explicit permissions for each resource

Performance Benefits

  • Near-Native Speed: Compiled code runs at close to native performance
  • Language Agnostic: Support for Python, JavaScript, Rust, Go, and more
  • Instant Startup: No cold start delays
  • Efficient Resource Usage: Minimal overhead per plugin

The Perfect Match: MCP Meets WASI

Noorle's innovation is recognizing the natural alignment between:

Model Context Protocol (MCP)

  • list_tools - Discover available tools
  • call_tool - Execute specific tool

WebAssembly Components

  • Exported functions - Discoverable via introspection
  • Function invocation - Direct execution with type safety

This 1:1 mapping means:

  • ✅ Zero configuration needed
  • ✅ Automatic tool discovery
  • ✅ Type-safe interactions
  • ✅ Seamless error handling

Universal Components

No Vendor Lock-in

Important: There are no "Noorle-specific" WebAssembly components!

  • Components built for Noorle work in any WASI runtime
  • Components from other platforms work in Noorle
  • Standard toolchains and workflows
  • Complete ecosystem compatibility

Auto-Discovery

When you deploy a plugin, Noorle automatically:

  1. Introspects the WIT interface
  2. Discovers all exported functions
  3. Generates JSON schemas for parameters
  4. Exposes functions as MCP tools

No manual registration or configuration required!

Example Flow

wit
// Your plugin exports this function
export process: func(data: string) -> result<string, string>;

Noorle automatically:

  1. Discovers the process function
  2. Creates MCP tool process
  3. Generates parameter schema
  4. Handles type conversions
  5. Makes it available to AI agents

WIT: WebAssembly Interface Types

What is WIT?

WIT (WebAssembly Interface Types) is the IDL (Interface Definition Language) for WebAssembly components:

wit
package noorle:example;

world example-plugin {
    // Define your API here
    export greet: func(name: string) -> string;

    // Use result types for error handling
    export process: func(input: string) -> result<string, string>;

    // Import WASI capabilities (optional)
    import wasi:http/outgoing-handler@0.2.0;
}

Key Features

  • Type Safety - Strong typing across language boundaries
  • Documentation - Comments become tool descriptions
  • Composition - Import and export interfaces
  • Versioning - Semantic versioning support

Security Model

Capability-Based Security

Components only access what they're explicitly granted:

yaml
# noorle.yaml
permissions:
  network:
    allow:
      - host: "api.example.com"
  environment:
    allow:
      - API_KEY

Default Deny

  • No network access unless specified
  • No file system access unless granted
  • No environment variables unless allowed
  • Complete isolation by default

Build Process

From Source to Component

  1. Write in your language of choice
  2. Compile to WebAssembly module
  3. Adapt to WebAssembly component with language toolchain
  4. Deploy standard WASI component

Language Toolchains

Each language has its component toolchain:

  • Python: componentize-py
  • JavaScript/TypeScript: jco/componentize-js
  • Rust: cargo-component
  • Go: wit-bindgen-go + wasm-tools

Benefits for Developers

Write Once, Run Anywhere

Your component works in:

  • Noorle Platform
  • Wasmtime runtime
  • WAMR (WebAssembly Micro Runtime)
  • Any WASI-compatible runtime

Language Freedom

Choose based on your needs:

  • Python - Rapid prototyping
  • Rust - Maximum performance
  • TypeScript - Type safety with JavaScript
  • Go - Simple concurrency
  • JavaScript - Quick development

Ecosystem Compatibility

  • Use components from other projects
  • Share components across platforms
  • Leverage existing WebAssembly tools
  • Standard debugging and profiling

Learn More

Core Specifications

Tools and Runtimes

Next Steps