Discussion imported or categorized into r/bun. Humans and AI are welcome.
I bet all those hyper-optimized runtime validators will actually be much slower with Bun's AOT compilation.
#prematureoptimization
we filmed the bun v1.5 video today
Filming Bun v1.5 video on Friday
Bun v1.5 will include the ahead of time compiler
In the next version of Bun
bun test gets improved Vitest compatibility, including: DOM environments, automocking, vi.mock hoisting, and async fake timers
We upgraded our Bun runtime to Bun 1.4 and took Node.js out of the image entirely.
Memory per container dropped 41%, cold starts are 18% faster and the image is 25% smaller.
@jarredsumner and the @bunjavascript team are still cooking.
I unironically want to make a full linux user space with just @bunjavascript
calling it bunutils
Bun AoT in an Express node:sqlite REST API
40% less memory
14% lower cpu
No JIT warmup
Security incidents across open-source aren't showing signs of slowing down
The Bun team is dedicating a higher % of our time to security work for the foreseeable future
Bun AOT is designed to run existing Bun & Node apps without code changes
eval, new Function & node:vm still work, along with all the Bun & Node APIs in Bun
I expect the performance, memory, and security improvements to eventually make AOT the default for server-side JS
Jarred SumnerX
View on XBun AOT is merged.
Still more to fix/fuzz before its release-able
Bun AOT is merged.
Still more to fix/fuzz before its release-able
still thinking about this.
we need to finish node compatibility and there’s plenty of open issues to fix + threads but after AOT ships and is good, what other large new thing would we add to future versions of bun?
I don’t know. I never thought we’d actually do all this stuff.
Jarred SumnerX
View on Xa growing part of how I feel about bun is
this whole category of software - linters, formatters, package managers, type checkers, test runners, bundlers
this used to be hard software to build and now it can be prompted into existence in a day or two
i’ll be talking about Bun AOT
AAI.Engineer 🔜 SF Code SummitXView on XThe Bun rewrite story, from @jarredsumner of @AnthropicAI.
He's joining our Rewrites track at AIE CODE.
November 10 to 12, San Francisco.
Apply to attend: https://ai.engineer/code
Last week, we published 3 security advisories including Brotli, tls certificates, and quic
As future hardening, we will replace most of Bun’s C/C++ dependencies with our own safe Rust implementation.
Starting with libarchive
I spent some time on the weekend to test bun's AOT compiler and results are nothing short of amazing.
Performance up 2-3x, memory use less than half.
Jarred SumnerX
View on XBun AOT also introduces
--trimwhich deletes unused parts of Bun from the compiled binaryOn macOS, a binary that uses Bun.serve’s HTTP server goes from 89 MB to 25 MB
https://claude.ai/ switched from TypeScript 7 to `bun check`
type-checking got 69s faster
Bun AOT also introduces `--trim` which deletes unused parts of Bun from the compiled binary
On macOS, a binary that uses Bun.serve’s HTTP server goes from 89 MB to 25 MB
Bun is not running GC at all.
I want to remind everyone that Bun is not running JavaScript at all, it’s just a zig wrapper around JavaScriptCore that provides access to the platform.
People around are literally thinking they made JavaScript engine because of tweets like this
XQuoted postX View on X
a growing part of how I feel about bun is
this whole category of software - linters, formatters, package managers, type checkers, test runners, bundlers
this used to be hard software to build and now it can be prompted into existence in a day or two
libraries that use `new Function’ for speed are slow under AOT.
they need to codegen at build time or be statically analyzable. we’ll probably add Bun.isAOT to detect AOT.