Skip to main content

waPC.io

WebAssembly plug-ins made

simple

The waPC suite gives you the tools to build dynamic applications with WebAssembly.


Quickstart



Step 1: Install Deno and the Apex CLI

First, make sure you have Deno installed. Then, use Deno to install the Apex CLI.

deno install -A --unstable -f -n apex https://deno.land/x/apex_cli/apex.ts

Step 2: Install waPC project templates

apex install https://deno.land/x/wapc_codegen/templates.ts
INFO Installing @wapc/assemblyscript...
INFO Installing @wapc/rust...
INFO Installing @wapc/tinygo...

Step 3: Generate a new project

apex new @wapc/assemblyscript hello_world_as
cd hello_world_as

Step 4: Build

apex all

Step 5: Run







Result:




The waPC tool suite



The core of waPC is a protocol for communicating into and out of WebAssembly.

Use waPC for everything from small libraries to distributed application platforms.
waPC hosts manage the lifecycle and communication of WebAssembly guests.

Hosts and guests give you a universal interface for dynamic behavior in both native and WebAssembly.
Use the Apex Language to define your WebAssembly's specification and generate all the code except your business logic.


How it works



waPC Host
Once initialized with a WebAssembly intepreter and a wasm binary, the wapc-host library can start executing functions in the wasm guest. The host and guest operate over the waPC communication protocol to satisfy bindings for compiled languages. This protocol takes an operation name and input data, serializes it, and calls the receiving waPC method in the wasm guest.

waPC Guest
The wasm binary — built with the wapc-guest bindings — accepts the waPC call, deserializes the input, executes the requested operation by name, serializes the return value, and passes it back over the waPC protocol back to the host.

Apex
Your Apex definition is the description of your wasm module's interface. It includes the exposed operations, the input types, return types, namespaces, and more. The waPC CLI uses Apex definitions to generate Rust, Go, or AssemblyScript code. (see more)