Ported my C game to WASM, here's every bug that I hit
- Programming
- Web
- Games
- Developer Tools
- Security
The post is a bug diary from porting a C puzzle game to WebAssembly with Emscripten. The failures were mundane and revealing: code assumed 64-bit pointers, asset files embedded raw pointers, OpenGL behavior that desktop drivers tolerated failed under browser graphics rules, and missing Emscripten export flags produced confusing runtime breakage. That made the piece useful less as a WASM victory lap and more as a checklist of old native shortcuts that collapse the moment you target the web.
If you are moving C or C++ code to WebAssembly, treat it like a real cross-platform port, not a recompile. Audit pointer-size assumptions, replace direct struct dumps with versioned serializers, and plan on a thin JavaScript boundary for UI and platform I/O.
- ernesernesto.github.io
- Discuss on HN