How did you achieve that? Are there some shortcuts you took, or some feature you deemed not in scope (yet)?
How did you achieve that? Are there some shortcuts you took, or some feature you deemed not in scope (yet)?
Bun is written in Zig, but it takes the same approach that esbuild took to make things fast: a linear, synchronous pipeline fitting as much as possible in the CPU cache with as little allocation and other overhead as possible. Zig has more knobs to turn than Go.
Bun goes one step further and does a great job of offloading work to the kernel when possible, too (i.e. the large file I/O improvement with the Linux kernel)
The transpiling itself is written in Zig, which is the part that has the performance improvement. If Bun relied on JavaScript and JSC for the heavy lifting, it would be no faster than the other JS bundlers.
edit: no longer LLVM: https://webkit.org/blog/5852/introducing-the-b3-jit-compiler...