In the beginning there was Rhino
Even though Bun certainly feels new and exciting, did you know that server-side JS is actually a quarter century old now? It has actually been a thing since 1997! And as many good things that have happened to the web: it started at Mozilla with Rhino. A JavaScript engine I’m all too familiar with. Back in 2009 I was looking for a way to run some server-side JS for a particular project and after trying to get Rhino to work and suffering quite a bit—at the time it was allergic to Java—I then discovered Node.js. And it was awesome. It was version 0.1.x and even though everything broke with every release—I still remember with unease whenpromises
were removed—it was still an incredible, liberating experience to work with it. Being able to do cheap concurrency
without Netty or Erlang, which was exceedingly complex to run at the time, was a lifesaver.
In 2010, I had the pleasure of hosting Ryan Dahl, creator of Node.js, for a talk in Paris
and I was enamored with his vision. This was a serious network developer that was used to writing high-performance
network daemons in C and his approach was nothing if not revolutionary. It was all about simple concurrency, not
tight-loop multi-core performance, sometimes simple abstractions win. And now Bun, in a way, is returning to these roots
and asking why can’t we have both with Bun 1.0?
The results from testing Bun 1.0
I tested out and compared Yarn and Bun 1.0 with a small project, and generated the following figures:
- Yarn install: first run: 2458 packages installed [209.15s]
- Yarn install: second run: 2458 packages installed [161.90s]
- Yarn install: third run: 2458 packages installed [62.90s]
- Bun install: first run: 2458 packages installed [71.53s]
- Bun install: second run : 2458 packages installed [37.65s]
- Bun install: third run : 2458 packages installed [14.64s]
Where to host Bun?
You can host your Bun application on Platform.sh at Bun 1.0 as our Node.js images now carry it—no install needed. In your.platform.app.yaml simply:
And that’s it, happy testing everyone!