Skip to content

Compile C/C++ to WebAssembly with Emscripten, covering exports, memory, Asyncify, and WASI targets.

CCM score
62 of 100
skills.sh installs
628
GitHub stars
303
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the full C-to-WASM path: SDK setup, emcc builds, function exports, heap and memory configuration, and debugging
  • Includes EXPORTED_FUNCTIONS, EXPORTED_RUNTIME_METHODS, and MODULARIZE settings, plus Asyncify and wasm-opt size and speed passes
  • Compares the Emscripten browser target against WASI in terms of host APIs, runtimes, threads, and networking
  • Designed for developers shipping C or C++ code to web apps or to server-side and edge WASI runtimes

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill wasm-emscripten -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

WebAssembly with Emscripten

Purpose

Guide agents through compiling C/C++ to WebAssembly using Emscripten: emcc flag selection, function exports, memory model configuration, Asyncify for asynchronous C code, debugging WASM binaries, and targeting WASI vs browser.

Triggers

  • "How do I compile C to WebAssembly with Emscripten?"
  • "How do I export a C function to JavaScript?"
  • "How does WebAssembly memory work with Emscripten?"
  • "How do I debug a .wasm file?"
  • "How do I use Asyncify to make synchronous C code async?"
  • "What's the difference between WASI and Emscripten browser target?"

Workflow

1. Setup and first build

# Install Emscripten SDK
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh    # add emcc to PATH

# Verify
emcc --version

# Compile C to WASM (browser target)
emcc hello.c -o hello.html          # generates hello.html + hello.js + hello.wasm
emcc hello.c -o hello.js            # just JS + WASM (no HTML shell)

# Serve locally (WASM requires HTTP, not file://)
python3 -m http.server 8080
# Open: http://localhost:8080/hello.html

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
First seen
Jun 3, 2026

Questions

What does the wasm-emscripten skill help with?

It guides agents through compiling C and C++ to WebAssembly with emcc, covering function exports via EXPORTED_FUNCTIONS, the WASM memory model, Asyncify for async C code, debugging .wasm files, and choosing between WASI and the browser target. It also covers wasm-opt for optimizing binaries.

Who is the wasm-emscripten skill for?

It is for developers who want to compile C or C++ code to WebAssembly with Emscripten and run it in a browser or another host. It applies to anyone who needs to export C functions to JavaScript or work with WASM linear memory.

How do I install the wasm-emscripten skill?

Run npx -y skills add mohitmishra786/low-level-dev-skills --skill wasm-emscripten -y in your project. Once installed, the agent can answer emcc, Asyncify and WebAssembly memory questions using this skill.

What do I need to use this skill with Emscripten?

You need the Emscripten SDK installed and activated so emcc is on your PATH, and a local HTTP server because WASM does not load from file://. The skill's setup steps cover cloning emsdk and sourcing emsdk_env.sh.

More from mohitmishra786/low-level-dev-skills

All 54

Similar to Wasm Emscripten