Skip to content
Ani edited this page Sep 22, 2025 · 5 revisions

Wasmrun

Wasmrun is a powerful WebAssembly runtime that simplifies development, compilation, and deployment of WebAssembly applications across multiple programming languages.

What is Wasmrun?

Wasmrun provides a unified interface for building and running WebAssembly (WASM) projects from various source languages including Rust, Go, C/C++, AssemblyScript, and Python. It eliminates the complexity of managing different toolchains and provides a seamless development experience with built-in live reload, optimization, and deployment capabilities.

Key Features

  • 🚀 Multi-Language Support - Build WebAssembly from Rust, Go, C/C++, AssemblyScript, and Python
  • 🔌 Plugin Architecture - Extensible system with built-in and external plugins
  • 🔥 Live Reload - Instant development feedback with file watching
  • 🌐 Zero-Config Web Server - Built-in HTTP server with WASM and web app hosting
  • 📦 Smart Project Detection - Automatically detects and configures project types
  • ⚡ Zero Configuration - Works out of the box with sensible defaults

Architecture Overview

Wasmrun uses a modular plugin architecture that enables seamless integration of different programming languages:

Built-in Plugins

  • C/C++ - Full WASM + Web Apps via Emscripten
  • AssemblyScript - TypeScript-like syntax with optimization
  • Python - Runtime integration with bundle creation (Beta)

External Plugins

  • wasmrust - Rust support via rustc and wasm-pack
  • wasmgo - Go support via TinyGo compiler

External plugins are installed to ~/.wasmrun/ and loaded dynamically at runtime.

Core Commands

Development & Compilation

  • wasmrun run <project> - Start development server with live reload
  • wasmrun compile <project> - Compile project to WebAssembly
  • wasmrun <file.wasm> - Run WebAssembly file directly

Project Management

  • wasmrun clean <project> - Clean build artifacts
  • wasmrun verify <file.wasm> - Verify WASM file format
  • wasmrun inspect <file.wasm> - Detailed WASM analysis

Plugin Management

  • wasmrun plugin list - List available plugins
  • wasmrun plugin install <plugin> - Install external plugins
  • wasmrun plugin info <plugin> - Plugin information

Server Control

  • wasmrun stop - Stop running server instances

Project Detection

Wasmrun automatically detects project types based on:

  • File extensions (.rs, .go, .c, .cpp, .py, .ts)
  • Configuration files (Cargo.toml, go.mod, Makefile, package.json)
  • Entry point files (main.rs, main.go, main.c, main.py)

Development Workflow

  1. Create or navigate to your project

    cd my-wasm-project
  2. Start development server

    wasmrun run . --watch
  3. Compile for production

    wasmrun compile . --optimization release
  4. Deploy the generated WASM files

Getting Started

Installation

cargo install wasmrun

Quick Start

# Run current directory
wasmrun

# Run with live reload
wasmrun run . --watch

# Install language support
wasmrun plugin install wasmrust
wasmrun plugin install wasmgo

References