2024-10-26
Picking the right Javascript runtime is not just a matter of built-in features and DX...
Written by: Lemux One
I’m currently working on a simple web app to assist my daughter with her homework. Nothing crazy, but it needs to be functional and easy to deploy. Lately, I’ve been all about JavaScript — my professional work is pushing me deeper into it every day. So naturally, I’ve started eyeing some of the newer runtimes like Bun and Deno, wondering how I could take advantage of them in my own projects.
Personally, I root for Bun because I want to see a Zig-based project succeed. I’d love for Zig to get some traction in the not-too-distant future. I first stumbled upon Bun when reading a thread about Zig, and it caught my eye. At the time, I didn’t think I’d actually use it, but here I am testing it out for a real project. Funny how these things happen… But after all the buzz around Deno 2.0, I started feeling torn. It seemed only fair to test Deno before picking any sides.
I started playing around with both, trying to get a feel for their developer experience (DX) and which one felt more natural. First impressions? Pretty great across the board. Both runtimes have a ton of features built-in, making it easy to get started without relying on external modules for basic stuff.
What really impressed me was the built-in TypeScript support in both. No extra setup, just out-of-the-box TS compatibility — a huge win for me since I love the static typing and the seamless LSP experience it brings to code editing. While their test-running capabilities were also interesting, it wasn’t super relevant for this particular project.
And then there’s speed. Bun really shines in terms of startup times and runtime execution — it feels faster, which could be a big deal if performance becomes a priority.
So far, I was leaning toward Deno as my winner. It’s more mature and stable compared to Bun, which still feels like it’s in early stages. But then deployment threw a wrench into my plans. My hosting provider uses FreeBSD, which I’m totally fine with, but neither Bun nor Deno has official support for it. My proof of concept failed to run in production because of this. Node, on the other hand, has first-class support on my host. No surprises there — Node’s been around forever, and its popularity means most providers support it out of the box.
So for now, Node wins — not because it’s the one I want to use, but because it’s the most practical for my setup. Bun and Deno are both super promising, especially with their TypeScript support and performance perks, and I’m excited to see how they evolve. But until hosting providers catch up and support these newer runtimes, Node will remain my go-to for deployment.
Disclaimer 1: I’ve seen hints online about compiling Bun or Deno for FreeBSD, but that’s not something I’m willing to dive into right now. It seems like a pretty involved process with no guarantee of success. I’d rather wait for official support.
Disclaimer 2: Although changing hosting provider is a valid suggestion, I’m not willing to do so since there are a bunch of other perks I really appreciate about the platform.