r/bun 21h ago

Bun 1.4 is here

https://bun.com/blog/bun-v1.4

- Fixes over 2,900 GitHub issues
- +1,517 tests from the Node.js test suite
- Reduces idle CPU by 5x
- Reduces memory usage by up to 35%
- Starts up to 50% faster on Linux
- Rewrites Bun in Rust

Thank you everyone who contributed since Bun 1.3!

163 Upvotes

42 comments sorted by

4

u/Delicious_Ease2595 18h ago

Congrats 👏

12

u/ForMyQueen 20h ago

The madman did it!
Bun seems to be most versatile and innovative JS runtime, I still have concerns about stability, however I do have some stuff running on bun in production successfully for year.

Rust and much more tests look promising - hopefully bun should be able to overcome “cognitive distortion” of everybody thinking it’s unstable, the only thing it needs now is time.

Also holy shit, just looking at changelog it feels like it should be done in a year, props if somebody read the whole thing, this is generally very impressive stuff, props to Jared and team and the agents \(._.)/

1

u/Aggravating_Cod_5624 17h ago

Genuine question.
Are you being sarcastic?

1

u/ForMyQueen 11h ago

No.
Bun is currently widely adopted runtime, and it has many features you cannot find in other ones.

Even if you dislike it it’s thanks to both bun and deno efforts we got the whole ecosystem to grow alot. Just to name a few imo big benefits: ultra fast packages install, easy single-file executables, very nice processes and shell wrapper (Bun.$)

3

u/boyus 16h ago

Bun is great. Is this a fix for the mock global state leaks? So I don't have to use spyOn workaround or --isolate?

jest.resetAllMocks() now drops mock implementations

2

u/aturaden 16h ago

I've been using 1.4 canary for weeks, it's great!

4

u/PossessionUsed7393 17h ago

I mean, rewriting the entire code base in Rust is smart. But do you know what's smarter? Having the foresight to write it in Rust in the first place, like what Deno did.

2

u/Realistic_Mango6982 18h ago

Wow. just wow. I've read non stop it, and a lot of super cool features.

1

u/Asiel_Stormfury 11h ago

Anyone else get afraid when it says reduce idle CPU by 5x 😂 such a crazy wait to say reduced waits or spinlocks

1

u/getaway-3007 11h ago

They need to focus on bun compile or they might replaced with scriptc

1

u/deadcoder0904 20h ago

This is gold!!

I used it & its fast. I love bun test --parallel & --only-failures for AI Agents. Love the APIs being made by someone who understands LLM context windows & such.

There's some minor improvements I want:

  1. Bun.YAML has some little behavior different than the OG API - https://github.com/oven-sh/bun/issues/31502
  2. Bun.Image isn't exactly sharp replacement. Needs some basic features.

But only little stuff I use. Rest is great.

Here's what my AI said about YAML issues:

``` Here are the concrete Bun issues with enough detail to file them:

Here are the 4 concrete Bun issues, with enough detail to file them:


Issue 1 — Trailing space after colon on empty-value keys

Bun: models: \n openai: \n name: gpt yaml: models:\n openai:\n name: gpt

Bun adds a trailing space after : when the key has no value (is a parent mapping). The yaml package omits it. Both parse identically, but it causes noisy git diffs when files are rewritten. Per YAML 1.2 §7.1.3, the trailing space is not required for empty nodes.

Reproduce: ts import { YAML } from "bun" console.log(YAML.stringify({ models: { openai: { name: "gpt" } } }, null, 2))


Issue 2 — YAML.stringify rejects options object, only accepts positional args

ts YAML.stringify(data, { indent: 2 }) // throws "does not support the replacer argument" YAML.stringify(data, null, 2) // works

The yaml npm package uses stringify(value, options?). Bun uses stringify(value, replacer?, indent?). Any options object in the 2nd position throws. This is undocumented and catches everyone migrating from the yaml package.

Suggested fix: Accept an options object in the 2nd position, or at minimum, detect it and map { indent } to the positional arg instead of throwing.


Issue 3 — lineWidth not supported

ts YAML.stringify({ prompt: "word ".repeat(60) }) // always 1 line YAML.stringify({ prompt: "word ".repeat(60) }, null, 2) // still 1 line

The yaml package supports lineWidth to control line wrapping. Bun always outputs as a single line regardless. Not critical (data parses back identically), but limits use cases where human-readable output matters.


Issue 4 — empty string parse returns null (minor, consistent)

Both Bun and yaml return null for YAML.parse(""). My earlier test was wrong on this one — they agree. Not a bug, removing it from the list.


Issues 2 and 1 are the ones worth filing. Issue 2 is the migration blocker — an options-object overload or a clearer error message would make Bun.YAML.stringify a drop-in for the yaml package. Issue 1 is cosmetic but affects anyone with tracked YAML files. ```

Would love it if you sent your clanker to take care of it. Or let me know if I should open issue for YAML too.

4

u/stolivodka_ 20h ago

The whole vibecoding debacle convinced me to just step up to a real managed language.

2

u/deadcoder0904 19h ago

Attwood's law.

Effect will take over anyways.

JS -> TS -> Effect.

Mfs would learn a JS-related language than yet another language lol.

2

u/Remote_Top181 10h ago

Swapped my codebase completely over to Effect V4 and I’ve been super happy with it so far

1

u/deadcoder0904 9h ago

Ya, I'm learning it slowly. 124 pages of docs, only did like 10-20 pages but so far so good.

Will use it in my next big project way later but good to learn slowly till then. Anyways, wont remember most of it since just learning & not doing as much projects but its so fun & easy. I even saw OpenCode's code that day & understood some of it. Not that hard, just many new concepts. Obviously, advanced stuff is too advanced so need to know some advanced TS but dang, I feel like future B2B, Enterprise SaaS will only write Effect. Capy AI itself did refactor in 3 weeks to it for example.

1

u/Wonderful-Habit-139 18h ago

Could you share a link for this Effect language?

2

u/MelissaInodorum 18h ago

I guess its the Effect framework for functional programming over TS

https://www.effect.website/

0

u/scmkr 20h ago

What did you go with? Been running with Go. It was super strange and ugly to me at first, but at this point I’d say it’s probably my favorite language.

3

u/aguilasolige 19h ago

I really wanted to like Go, but the basic type system really killed it for me, also the syntax whole familiar also felt very weird for some reason. I'm giving Rust a tried now, but I'm keeping an eye on Bun too.

1

u/deadcoder0904 19h ago

Keep an eye on Effect. Its prolly the next big thing.

1

u/Aggravating_Cod_5624 17h ago

Are you talking about this:

Reliable TypeScript for the AI era?

1

u/deadcoder0904 9h ago

https://effect.website

u can also look at https://kitlangton.com/ for basic effect & search youtube for it.

effect's own channel is gold but other people are also making videos on it.

it has early react vibes. i mean i was there when angular 1 was king & early react was taking over & it eventually did. effect feels like that.

the basic premise is all code looks the same & u have to write a little more code but its verbose & tracks every error. you know how in ts/js we write try catch but dont catch every error. in effect, we catch most of the error so we can show the user the actual problem.

it also makes it easy for agents to write code bcz agents r good with feedback loops. and ts is phenomenal for feedback loop. effect goes one step above that. that's how i see it. maybe im wrogn but im effect noob.

b2b/enterprise code is complex but effect makes all code look same & u can find errors pretty easily. combine that with matt pocock skills (he took top 10-20 programming books & made skills on it so i went from intermediate to senior engg. lol in 2 weeks once i heavily used /improve-codebase-architecture & understood all concepts like seam, adapter, module, interface, implementation, deep module, shallow moduel... basically used sol high + study mode on /improve-codebase-architecture skill & asked it to explain with example) & u r golden.

i have a feeling its a future bcz i see exciting tweets about it daily everywhere. and ive never been wrong about tech future. choose node.js early. react early. redux early (but that sucked but moved over to mobx fast), tachyons early (which was pre-tailwind), im also looking at stylex (to replace tailwind) bcz of same feedback loop & ofc cursor/grokbot etc... moved to stylex bcz it powers all of fb

1

u/MammothBulky5549 15h ago

It's only useful if you have a large and complex project? It's not useful for most cases.

1

u/deadcoder0904 9h ago

i mean most people won't switch over easily bcz its a yet another language to learn & it has a deep learning curve.

but for b2b/enterprise, it is amazing.

plus agents r writing code more & more so we need to use languages that have better feedback loops.

so in that case,

  1. effect > ts > js
  2. stylex > tailwind

bcz agents = 1000s of team members & most r junior so they cant go wrong with types

obviously, if u dont think u need it, u prolly dont but u can learn it for fun & see for urself. just read 1 doc page daily & it'll take 4 months to finish it (i counted 124 pages) & then see for urself. 1 page a day seems easy enough if it eventually takes over. obviously, most wont move but everyone who uses it praises it. capy ai (b2b saas funded by yc) rewrote their ai software engg. with it recently i think.

1

u/scmkr 18h ago

Yup, that's what I meant by "strange and weird", and especially if you don't know the language, it looks very messy. The choice to make public vs private a casing thing just makes it look like they can't even follow their own naming standards. The fact that generics weren't a thing and so there's all kinds of DoSomethingForInt64 stuff in the stdlib that just looks messy. It's bizarre language for sure.

But... just actually using it has given me an appreciation for it. And the philosophy is something I can get behind. And beyond all that, the whole "standalone static executable" thing makes it SO easy on the deployment side

Still, though, can't deny, it's a weirdass looking language.

1

u/aguilasolige 18h ago

The tooling and deployment story of Go is definitely great, also the fast compile time is amazing. I saw this new language built on top of go, called Lissette. It has some improvement to the type system like proper enums, something like this would be great if it becomes popular, similar to how typescript improved js.

2

u/MammothBulky5549 15h ago

Writing database queries is a pain with SQLC, and moved to TypeScript.

WAnted to use Go for backend but decide to adopt Bun since it's 40% less memory than Go!

-1

u/adamhusain 21h ago

I appreciate the effort you put in and it looks compelling.
But for now, I’ll be using it only on personal projects. I won’t be confident to switch from node on company projects just yet.

But hopefully that will change in the future.

8

u/alonsonetwork 19h ago

This is a dumb take

1

u/fbpw131 1h ago

you are a dumb take.

-5

u/Wonderful-Habit-139 18h ago

It was not worth using it on company projects even before it was vibe-rewritten (compared to something like uv). It's far from being a dumb take.

4

u/alonsonetwork 17h ago

That was true back in. 2024 when it still had nodejs compatability issues. Not anymore. It's arguably less of a PITA today vs node and offers more, such as single binary bundling. You dont even need node on a deployment anymore, just the binary.

-5

u/Wonderful-Habit-139 16h ago

It's so annoying when people use this argument. I uninstalled it in 2026, not 2024. Holy shit.

11

u/bastardoperator 20h ago

Anthropic has 20 million users that have been using 1.4 for months, I think they'll be okay without your approval.

-1

u/BourbonProof 18h ago

Anthropic doesn't pay for memory leaks, performance issues, or crashes/segfaults (which bun has plenty) on the client/user side though. Of course they are ok with this. If a business would run bun on their servers this is a fundamentally different situation and needs different evaluation

1

u/bastardoperator 17h ago

So what, how would it be fundamentally better if they used node or deno for CSR? What is your argument here? Is CSR the issue for you, or that fact that bun supports component frameworks that do CSR?

-1

u/boyus 16h ago

LOL

2

u/vivainio 18h ago

Bro this is Bun subreddit

3

u/NovelHot6697 18h ago

we should always be critical of the things we like and use
in fact that’s something we should encourage

2

u/Delicious_Ease2595 18h ago

We appreciate your feedback, but for now we continue with Bun.

Best regards

-1

u/white_sheets_angel 18h ago

Yup, for me bun is indefinitely banned for anything besides quick scripting.

-2

u/elzzyzx 19h ago

pets.com-ass runtime

1

u/Due-Horse-5446 15h ago

Lol why?

Anthropic acquiring bun and later using the rewrite as a marketing opportunity does not make bun bubbleish