← Back
Home › Systems › Compilers and language tooling

js-bundler

JavaScript bundler

esbuild, Vite

SystemTechniques · 7Primitives · 20 js-bundler Hot reloadingcompilers · medium: Replace code in a running process by swapping an indirection point, then migrate the live state to the new layout at a safe moment.›Minification name manglingcompilers · medium: Shrink JS by renaming locals, constant folding and dead branch removal, respecting scopeTree shakingcompilers · medium: Remove unused exports via module graph reachability and side-effect analysisWork-stealing dequeconcurrency · medium: Per-worker deque: the owner pushes and pops at the bottom without contention, idle workers steal from the top; the core of Rayon, Tokio and Go.›Code splitting lazy loadinggraphics · medium: Split bundles at dynamic imports, load chunks on demand, preload critical pathsQuery based incremental computationsystems · medium: Memoized queries with dependency tracking and red-green revalidation (rustc, Salsa)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.›Module resolutioncompilers · low: Resolve import specifiers to files: Node and ESM resolution, package exports, CJS interopFile system watchinghardware-os · low: Treat OS change notices as hints, debounce them, and rescan and diff a snapshot whenever notices overflow or may be lost.›Name resolutioncompilers · low: Bind every use of a name to its declaration with a scope stack, handling shadowing, hoisting and closure capture in one AST walk.›Recursive-descent parsingcompilers · low: Hand-written top-down parser with one function per grammar rule; simple, fast, with full control over error messages and recovery.›Source mapscompilers · low: Source map v3: VLQ-encoded mappings from generated to original positionsPratt parsingcompilers · low: Table-driven expression parsing with one loop and a numeric binding power per operator; the compact core of precedence handling in hand-written parsers.›Fast hash functionsdata-structures · low: Non-cryptographic hashes built from 64×64→128-bit multiplies and xor-shifts; pick by key size, trust level and whether the hash is persisted.›Topological sortgraphs · low: Order the vertices of a DAG so every edge points forward; the core of build systems, schedulers and dependency resolution, with cycle detection for free.›Arena allocatorsystems · low: Allocate by bumping a pointer through big chunks and free everything at once: a few instructions per allocation for objects sharing a lifetime.›BFS and DFSgraphs · low: The two basic graph traversals; BFS gives hop distances and levels, DFS gives discovery/finish order for cycles, components and topological order.›Epoch-based reclamationconcurrency · low: Threads announce a global epoch while touching shared lock-free data; garbage retired in epoch e is freed once the epoch reaches e + 2.›Memory orderingconcurrency · low: What Relaxed, Acquire, Release and SeqCst atomics actually guarantee, what they cost on x86 and ARM, and which one each pattern needs.›HTTP caching semanticsnetworking · low: The rules (RFC 9111) that decide whether a stored response is still fresh, and how a cheap conditional request revalidates it when it is not.›Hash consingdata-structures · low: Intern structurally equal immutable terms so equality is pointer comparison and sharing is maximalString 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.›+ 4 more primitives

Similar systems

Share the most building blocks with this one.