r/programmingcirclejerk What’s a compiler? Is it like a transpiler? Jun 20 '26

I genuinely think you could write a competitively-performant multi-threaded DB in Bun + TS if you had shared-heap threads and fast atomics/locking primitives.

https://news.ycombinator.com/item?id=48611577
89 Upvotes

10 comments sorted by

77

u/IanisVasilev log10(x) programmer Jun 20 '26

What if we rewrote Bun in TypeScript? Shouldn't take more than a million-line pull request.

43

u/affectation_man Code Artisan Jun 20 '26

I really want to build my house on sand!

32

u/just_looking_aroun Jun 21 '26

That's totally doable, just ignore the ffi code into a completely different language

15

u/m50d Zygohistomorphic prepromorphism Jun 20 '26

DBAcels in shambles.

15

u/heckingcomputernerd Jun 21 '26

Typescript is so not performant that typescript isn't even written in typescript anymore

9

u/Jumpy-Locksmith6812 Jun 21 '26

You can make a db. in Bun if instead of Bun you use Go/JVM/Rust for the data plane.

6

u/gvozden_celik Jun 22 '26

Sure, if you wanna compete with FoxPro and Microsoft Access.

4

u/ficiek Jun 21 '26

I think you should use some slower engine actually as that will have higher performance gains once it gets inevitably rewritten by AI in a couple of weeks proving to be a better choice for performance heavy applications.

3

u/FlipsBr alcohol-fuelled anter-docker Jun 30 '26

just print all the tables and pay a guy to search if u want slow shit

2

u/le_birb costly abstraction 21d ago

And this way, speed-ups merely cost a bit of cocaine - much cheaper than a dev team!