frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

We put the Bun Rust rewrite in production

7•sorenbs•1h ago
At Prisma we've been working on a Compute offering to complement our hosted Postgres. We settled on Bun early in the process as we liked the experience we'd be able to provide thanks to Buns batteries-included approach.

But then we started using Bun in anger, and we found many memory leaks in the Bun internals, that we knew our customers would face as well. Prisma Compute is operating long-running services, utilising memory snapshots to pause the instance when not in use. We need these Bun instances to be able to reliably serve customer workloads for days and months.

We were able to fix some of these memory leaks directly in the code base, but getting the patches upstreamed proved difficult. And running on a fork with an ever increasing number of patches wasn't an appealing option.

And then as our Beta launch approached, Jarred announced the big rewrite (prior discussion: https://news.ycombinator.com/item?id=48132488)

We have found that the rewrite directly addresses several of the memory leaks we had identified. And we have found the new Rust codebase to be easier to contribute to. So we made the decision to launch on Bun Canary and do whatever we can to help improve Bun.

We wrote about it here, and you can have your agent of choice deploy an app in just a couple minutes if you want to give it a try. It's Beta, so we are still busy polishing the experience: https://www.prisma.io/blog/launching-prisma-compute-public-beta

Comments

aqrln•45m ago
Other than memory leaks, we also saw a bug in Bun.SQL's connection pool that would consistently lead to deadlocks after restoring the VM from scale-to-zero. It was also fixed by the Rust rewrite/translation.

Overall, the empirical evidence we got clearly showed that the Rust version was much more stable and reliable.

There was a lot of discourse on the internet about the trustworthiness of the automatic rewrite, but my understanding is that it was essentially a glorified machine translation and not a re-implementation from specs and tests, akin to using Google Translate or DeepL but for code. Of course it's a simplification, and I'm looking forward to reading Jarred's upcoming blog post about all of the non-trivial aspects of it, but it's still essentially the same code, largely written by humans and translated by an LLM. The main differences are the bugfixes that the codebase got for free thanks to Rust having destructors (a lot of Bun's bugs and memory leaks seem to have been caused by manual resource management in Zig), as well as whatever issues the Rust compiler found even in the non-idiomatic code.

One valid area of concern is the amount of unsafe code and it potentially adding new kinds of UB for things that wouldn't have been UB in Zig, for example, by converting raw pointers to Rust references and inadvertently violating aliasing rules. As long as those things have been audited for, I wouldn't be any more concerned to use the rewritten version than the original even if basically nothing else was reviewed. And as long as the code is being refactored to get rid of those unsafe blocks and refactor it to idiomatic Rust in reviewable chunks, the surface area for bugs will continue to shrink and more pre-existing bugs will be uncovered and fixed.

Samsung, Greek shipowner, Supermicro to bring floating AI data centers to market

https://www.tomshardware.com/tech-industry/samsung-heavy-industries-recruits-greek-shipowner-and-...
1•rbanffy•2m ago•0 comments

Testing MiniMax M3 on refactoring, screenshot debugging, music recommendations

https://andlukyane.com/blog/minimax-m3
1•Artgor•2m ago•0 comments

Anthropogenically Induced Geophagy in Gibraltar Barbary Macaques

https://www.nature.com/articles/s41598-026-44607-0
1•PaulHoule•3m ago•0 comments

Killed by GPT

https://killedbygpt.com/
1•thoughtpeddler•3m ago•0 comments

Development and Tool Resources

https://buildsoftwaresystems.com/post/rust-coding-conventions-learning-resources/
1•mahirsaid•3m ago•0 comments

Show HN: Local Context and Memory Stack

https://github.com/supermemoryai/supermemory
1•dhravya•3m ago•0 comments

AI Voice Agent Architecture: How Real-Time Conversational Systems Work

https://www.faridfadaie.com/2026/06/10/ai-voice-agent-architecture/
1•ffadaie•3m ago•0 comments

GoTailo

1•Juancabrera123•4m ago•0 comments

SpaceX's $1.78T IPO asks investors to buy Musk's moonshots

https://www.ft.com/content/70fa49e3-1014-4412-890f-c7fe91497db9
1•aanet•4m ago•0 comments

The state of building user interfaces in Rust

https://areweguiyet.com/#ecosystem
1•mahirsaid•6m ago•0 comments

Visit every country on Earth by making a video call with automatic translation

https://philiprosedale.substack.com/p/voyager
1•SLHamlet•7m ago•0 comments

The Cost of Implementing NIS2

https://nisd2.eu/en/wiki/implementation/cost
1•cjhisey•8m ago•0 comments

Cybersecurity researchers aren't happy about the guardrails on Anthropic's Fable

https://techcrunch.com/2026/06/10/cybersecurity-researchers-arent-happy-about-the-guardrails-on-a...
1•speckx•8m ago•0 comments

I Was Wrong About Scrum, Again

https://rethinkingsoftware.substack.com/p/i-was-wrong-about-scrum-again
1•aard•8m ago•0 comments

Mixed-use districts don't reverse the dismal economics of sports venues

https://theconversation.com/sorry-tampa-bay-mixed-use-districts-dont-reverse-the-dismal-economics...
1•PaulHoule•9m ago•0 comments

How Does Our Taste in Movies Change with Age?

https://www.statsignificant.com/p/how-does-our-taste-in-movies-change
1•thm•9m ago•0 comments

We found a $60 Hetzner VM competing with AWS and Google VMs over $500/mo

https://webbynode.com/articles/a-60-hetzner-vm-is-challenging-aws-and-google-cloud-instances-cost...
2•gsgreen•10m ago•1 comments

Breaking news, and how the end might begin

https://garymarcus.substack.com/p/breaking-news-and-how-the-end-might
1•petethomas•10m ago•0 comments

The Proof in the Code

https://www.quantabooks.org/books/the-proof-in-the-code/
1•Tomte•11m ago•0 comments

The Tao of Datastar

https://data-star.dev/guide/the_tao_of_datastar
2•andersmurphy•12m ago•1 comments

Chavda's Paradox

https://zencapital.substack.com/p/chavdas-paradox
4•zenincognito•12m ago•1 comments

A Store for GitHub Releases

https://github-store.org/
1•linsomniac•14m ago•0 comments

Gaslighting Openness

https://lucumr.pocoo.org/2026/6/10/gaslighting/
1•Tomte•14m ago•0 comments

Applejak

https://internet-janitor.itch.io/applejak
1•tosh•15m ago•0 comments

What a Regex Can't Do: A Bayesian Governor for OpenClaw's Tool Calls

https://gfrm.in/posts/credence-pi-pass-2/
2•slygent•15m ago•0 comments

Language models manipulating their own internal states

https://www.lesswrong.com/posts/cNDJuXNZ8MrkPZNzj/machinic-psychopharmacology-do-llms-self-medica...
2•afpx•16m ago•0 comments

Show HN: Private Wealth Tracker

https://apps.apple.com/us/app/getzoro/id6767001446
2•mazinz•16m ago•0 comments

Tweaking GPU Clock Frequency Cuts LLM Training Energy

https://spectrum.ieee.org/llm-training-energy-saving-trick
2•rbanffy•16m ago•0 comments

Improving the carbon footprint assessment of milk production

https://link.springer.com/article/10.1007/s11367-026-02579-3
2•PaulHoule•17m ago•0 comments

The Archivist in Me Turned This Blog into a Book

https://brainbaking.com/post/2026/06/the-archivist-in-me-turned-this-blog-into-a-book/
2•speckx•17m ago•0 comments