← Back
Home › Systems › Compilers and language tooling

wasm-toolchain

WebAssembly toolchain

wasm-bindgen, Binaryen

SystemTechniques · 14Primitives · 28 wasm-toolchain Debug info (DWARF)compilers · medium: DWARF stores a tree of typed entries (DIEs), a line-number bytecode, unwind tables and location expressions that map machine state back to source; pick it for ELF/Mach-O debug builds.›FFI bindings generationcompilers · medium: Describe a library's C-ABI surface once (header, attributes or IDL) and generate the declarations, converters and wrappers for each caller language.›Function inliningcompilers · medium: Inline call sites by cost model and call-graph order; enables downstream optimizationsInstruction selectioncompilers · medium: Cover the IR with target instruction patterns at least cost; greedy maximal munch is simple, dynamic programming over a tree or DAG is optimal.›Linking and relocationcompilers · medium: The linker merges object files, matches each undefined name to one definition, assigns addresses and patches every recorded reference (relocation); dynamic linking defers part of that to load time.›Register allocationcompilers · medium: Map unlimited virtual registers onto a few machine registers, spilling the rest to the stack; linear scan is fast, graph coloring and splitting allocators give better code.›Structured control flowcompilers · medium: Turn a jump graph into nested block, loop and if constructs with numbered breaks; reducible graphs need no duplication.›Varint (LEB128)compression · low: Variable-length integers in 7-bit groups with a continuation bit; small numbers take 1 byte, the wire format of Protobuf, WebAssembly and DWARF.›Calling conventions abicompilers · low: System V, Windows x64 and AAPCS64 ABIs: argument registers, stack frames, struct passing, FFISSA formcompilers · low: Give every variable exactly one definition, merging at joins with phi functions; def-use becomes explicit and optimizations turn sparse and cheap.›Peephole optimizationcompilers · low: Local pattern rewrites on short instruction windows or IRWebAssembly binary formatcompilers · low: A section-based module container with LEB128 integers and structured, typed code, so untrusted bytes are validated in one pass and compiled as they stream in.›Executable formats elf pecompilers · low: ELF, PE and Mach-O: sections, segments, symbol tables, relocations, dynamic loadingReference countingcompilers · low: Keep a count of owners in each object, free it when the count hits zero; deterministic and local, but pays on every copy and leaks cycles.›Strongly connected componentsgraphs · low: Tarjan/Kosaraju SCCs for cycle detection in dependency graphsMachine code emissioncompilers · low: Encode instructions to bytes for x86-64 and AArch64, branch relaxation, constant poolsTree pattern matchingcompilers · low: Matching AST patterns with metavariablesString interningdata-structures · low: Store each distinct string once and refer to it by idSwiss tabledata-structures · low: Open-addressing hash table that filters 8-16 slots at once with 1-byte hash tags and SIMD, giving fast lookups at 87.5 % load.›mmap and the page cachehardware-os · low: How read() and mmap reach file data through the kernel page cache, what readahead and madvise do, and why databases use their own buffer pool instead.›Interval treedata-structures · low: Index of ranges that answers "which intervals overlap this point or range?" in O(log n + k); static sorted-array form is the compact, cache-friendly choice.›Control-flow graphcompilers · low: Split a linear instruction list into basic blocks and connect them by jumps; the graph every optimizer, SSA builder and dataflow pass walks.›Dominator treecompilers · low: Dominators via Lengauer-Tarjan or Cooper-Harvey-Kennedy; dominance frontiers for SSA+ 7 more techniques+ 12 more primitives

Similar systems

Share the most building blocks with this one.