This covers the full pipeline from compiling C/C++ to WebAssembly with emcc through to debugging the binaries in browser devtools. It walks through exporting functions with EXPORTED_FUNCTIONS, managing the linear memory heap from both C and JavaScript, and using Asyncify to make synchronous C code work with async JS operations like fetch. The WASI versus browser targeting comparison is helpful if you're deciding between web and server-side deployments. The optimization flags and wasm-opt section will save you from shipping bloated binaries. Solid reference if you're doing anything beyond toy examples with Emscripten.

skills.sh installs
559
GitHub stars
279
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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

Sponsors

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
Categories
Debugging, Automation & Workflows, Rust
First seen
Jun 3, 2026

More from mohitmishra786/low-level-dev-skills

All 54

Recommended

More Debugging
1guia-matthieu avatarreport-generatorguia-matthieu/clawfu-skillsGenerate PDF/HTML reports from templates and data. Use when: creating client reports; generating weekly summaries; producing marketing performance reports; auto558skills.sh installs
2longbridge avatarlongbridge-etf-analysislongbridge/skillsETF analysis framework via Longbridge — product screening (AUM/expense ratio/index), tracking error, liquidity (bid-ask spread/volume), premium/discount (NAV vs557skills.sh installs
3davila7 avatarseo-auditdavila7/claude-code-templatesWhen the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking,555skills.sh installs
4galaxy-dawn avatarresults-analysisgalaxy-dawn/claude-scholarThis skill should be used when the user asks to "analyze experimental results", "run strict statistical analysis", "compare model performance", "generate scient553skills.sh installs
5manutej avatarmobile-designmanutej/luxor-claude-marketplaceMobile UX patterns, touch interactions, gesture design, mobile-first principles, app navigation, and mobile performance553skills.sh installs
6martinholovsky avatartaurimartinholovsky/claude-skills-generatorCross-platform desktop application framework combining Rust backend with web frontend, emphasizing security and performance553skills.sh installs