Cruller: Bun's Zig Runtime, Continued on Zig 0.16 - Showcase - Ziggit
Cruller: Bun's Zig Runtime, Continued on Zig 0.16
Showcase
llm-deps,<br>llm
solenopsys
July 16, 2026, 8:01am
Cruller: a production-focused Bun runtime ported to Zig 0.16
Cruller is a fork of the last Zig-based Bun release, reduced to the parts needed to run already-built production JavaScript servers and ported to vanilla Zig 0.16.
Repository: GitHub - solenopsys/cruller: fork of Bun · GitHub
The project keeps JavaScriptCore, Bun.serve, HTTP/1-3, WebSockets, fetch, streams, Blob, Request/Response, static serving, and the module resolver for pre-built JavaScript. It removes the package manager, bundler/transpiler, shell, test runner, most CLI dispatch, N-API, SQL clients, archive support, and other development-oriented subsystems.
The interesting part of the port was separating the runtime from Bun’s old patched Zig build integration. Cruller now has a vanilla Zig 0.16 build graph, compatibility shims for APIs changed since Zig 0.15, and a generated-code embedding module so release builds remain portable instead of loading generated JS from the build directory at runtime.
The main design decision is to treat this as a runtime, not a general-purpose Bun replacement. A minimal launcher loads a pre-built entrypoint; features that require package installation, bundling, TypeScript transformation, or bun test are intentionally outside the scope.
Current measurements on Linux x64, compared with the official Bun 1.3.14 binary:
Cruller ReleaseFast stripped runtime: 73.0 MiB
Official Bun runtime: 88.5 MiB
Size reduction: about 18%
V8 Crypto pure-JS benchmark: performance parity; Cruller’s median was about 2% higher, within normal run-to-run variance
The runtime is still work in progress, but Zig semantic checks, release builds, CJS/ESM entrypoints, Node path tests, and an HTTP Bun.serve plus built-in fetch() smoke test currently pass.
Supported Zig versions
Zig 0.16.0
Linux x64 is the currently supported build target
Suggested topic tags: showcase, zig-0-16, llm
AI / LLM usage disclosure
AI was used as an engineering assistant for parts of the Zig 0.16 migration, build/debug investigation, and focused test work. The project scope, architecture decisions, review of changes, and build/test verification remain maintainer-directed. This is not a purely AI-generated project.
20 Likes
xsawyerx
July 16, 2026, 8:08am
Do you aim to address the critique of the code? I.e., cull the bad design decisions, etc.?
4 Likes
solenopsys
July 16, 2026, 8:19am
My idea is to strip the system down as much as possible and leave only what is required for production.
Development would be done using the full Bun runtime, while production would use its lightweight fork, Cruller. I do not have the resources of the Oven team to develop and maintain a massive general-purpose runtime, so I want to focus on specific production requirements.
The main goals are:
strengthen HTTP/2 and HTTP/3 support;
add native ZMQ plugins;
implement a dynamic memory controller through a separate QuickJS-based control plane, allowing complex memory-management policies and configurations.
package the engine as a simple dynamic library with a clean .zig interface, so it can be embedded into other applications with minimal effort.
Cruller is not intended to replace Bun for development. It is a minimal, specialized runtime for executing production code.
In any case, I do not want to throw away such a large codebase that has taken several years to build. It makes more sense to turn it into a convenient embeddable library that can be used throughout the Zig ecosystem.
15 Likes
WeeBull
July 16, 2026, 7:12pm
I wondered if someone would do this.
Honestly, I wish you the best of luck. If you do continue this project seriously I’m sure the community will be interested in what you learn. I did start exploring the bun repo myself from the same point (the last Zig release) and I think you’re absolutely correct to slim it down. Looks like you’ve taken about 290k lines of Zig out of the project (712k down to 425k).
Just getting it to the point where the build is zig build looks like it will be a significant milestone to me. I’m currently failing with…
zig 0.16.0 build --build-file build016.zig check<br>anyzig: build file 'build016.zig'<br>anyzig: appdata '/home/pauls/.local/share/anyzig'<br>anyzig: zig '0.16.0' already exists at '/home/pauls/.cache/zig/p/N-V-__8AAFFSVRWqblwBIcA-Yqv-u7sbjsJoww8K0mWaHbmJ'<br>check<br>└─ compile obj bzrt-check Debug native 1 errors<br>error: failed to check cache: 'build/codegen/ZigGeneratedClasses.zig' file_hash FileNotFound<br>error: 1 compilation errors
2 Likes
shimekukuri
July 16, 2026, 7:51pm
solenopsys:
It makes more sense to turn it into a convenient embeddable library that can be used throughout the Zig ecosystem.
I’m highly interested in where this possibly goes, migrating from a DX perspective to a performance I think more aligns with the...