Learning Journal — 2025-10-06 (y/m/d): WebAssembly History & Concepts
Learning Journal — 2025-10-06: WebAssembly History & Concepts
Overview
I spent roughly 2 hours understanding how webassembly appeared. Descovered emscripten
and asm.js
. Interesting stuff. Helped me understand why webassembly is the way it is. I feel like I spent some time jumping between pages, sometimes losing focus, but overall I got a bit clearer picture.
Key Takeaways
-
Emscripten
- At first compiles
C/C++
toJS
was original idea - Dude that worked in
Mozilla
understood thatthis compilation
produced some parts that were identical to after parsingJS
code it wasC/C++
toJS
, after that he asked to makeC/C++
toasm.js
which is a subset ofJS
that is easier to optimize -
When they got approval to make their
asm.js
on all browsers, they decided to really optimize it and make it abinary format
which isWebAssembly
- Funny note: Emscripten name is a reference to Simpsons episode, where they used
embiggen
word which is a made up word
- At first compiles
-
asm.js
- Basically a subset of
JS
optimized for performance. Mozilla created it to run compiled C/C++ code on browsers. - Limitation: still parsed as
JS
→ startup slower, more memory overhead.
- Basically a subset of
-
WebAssembly
- Binary format, sandboxed, runs in browsers.
- I still don’t fully get memory management between Wasm and JS — will test later.
- Its interesting to me that maybe its easier to debug asm.js than webassembly, because its still
JS
after all, and then just recompile toWasm
and run it
Background & References
- why web assembly is fast
- nice blog, BUT its old and it feels like that people who wrote it didn’t know much about asm.js or emscripten
- REALLY FUCKING NICE ARTICLE
Relevance & Connections
- Shows why performance-oriented languages can exist in browsers.
- I don’t see strong parallels with earlier topics yet, but I can imagine future Rust → WebAssembly exercises.
- Might relate to future projects: WASI, server-side Wasm, maybe WebGPU integration.
Confusions & Questions
- How exactly does the browser execute Wasm? Is it JIT or AOT compiled?
- How even browser execute JS?
- Memory: is it shared with JS or copied?
- Debugging: can i debug wasm through debugging it in asm.js and then recompiling to wasm?
- Security: no fucking clue yet.
Action Plan
- Review asm.js examples to understand translation pipeline.
- Track all questions above and see what resources answer them.
Reflections
- Writing this journal helps me consolidate thoughts and actually think after I learnt something.
Raw Notes
didn’t do this time, need to do next time
Summary
No summary
Enjoy Reading This Article?
Here are some more articles you might like to read next: