Framework Wars Have Reached Runtimes: NodeJS, Bun, Deno
Tags: javascript, node, news
Published: 2022-08-29 08:42:38

## The Framework Epidemic

Angular, React, Vue, Remix, Svelte, and something new every coming day, JavaScript framework releases have become an epidemic to collapsing gravity of `node_modules`, config files, and you as a developer. However, this epidemic doesn't stop there.

## Runtime Wars

Deno, another major runtime made yet again on Google's V8 engine using Rust programming language quickly gained traction the past year and was co-created by Ryan Dahl who wanted to correct the mistakes he couldn't reverse while making NodeJS which he announced at JSConf in 2018 in his talk "10 Things I Regret About Node.js".

Coming forward to 2022, we've seen a new player in the market who has been gaining a lot of attention, Bun. It's created by Jarred Summer using the Zig programming language but the one thing that differentiates this from all other runtimes is the use of JavaScriptCore, Apple's JavaScript engine which is used in Apple Software rather than the well-known and popular competitor V8 by Google, offering better performance than V8 from the get-go.

## Runtime Comparison

Let's compare these three runtimes to see what they offer.

| Feature 	| NodeJS 	| Bun 	| Deno 	|
|---	|---	|---	|---	|
| JS Engine 	| V8 	| JavaScriptCore 	| V8 	|
| Top-level awaits 	| Only ESM 	| Yes 	| Yes 	|
| Built-in .env, .toml support 	| No 	| Yes 	| Yes 	|
| Native TypeScript support 	| No 	| Yes 	| Yes 	|
| Single executable 	| No 	| Yes 	| Yes 	|
| Built-in test runner 	| No 	| Yes 	| Yes 	|
| tsconfig.json support 	| No 	| Yes 	| No 	|
| Built-in linter & formatter 	| No 	| No 	| Yes 	|
| Permission system 	| No 	| No 	| Yes 	|
| Module support 	| CJS, ESM 	| CJS, ESM 	| ESM 	|
| Languages 	| C, C++ 	| Zig, C++ 	| Rust 	|

It goes way beyond this comparison but this should give you an overview of what each of them has to offer.

## Benchmarks

One main reason why Bun has been gaining traction is due to its high performance which was unheard of in the JS community. Let's see some benchmarks to see how NodeJS, Bun, and Deno compare in terms of performance.

### React Server-side Rendering
HTTP requests per second (Linux AMD64)

![Server-side rendering React](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zuk6ad50yjkhlqctd7y7.png)

### Loading Large Tables using SQLite
Average queries per second

![Loading Large Tables using SQLite](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9hsz1swm3tui8g9kbzd3.png)

### Hashing
Operations per second

![Hashing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jt6dzfwk6a92lcmldeg9.png)

### Conclusion
Bun isn't just fast in terms of code performance but the whole developer environment feels snappy. You can install and uninstall any package within sub-second times. That might not sound much to you if you're coming from a different programming language but for users of NodeJS, that was unimaginable before.

## Final Thoughts
Competition promotes innovation and having these three compete to be the best and most popular is highly beneficial for developers. Most of these runtimes offer inter-compatibility with only slight changes so we users will never have to modify our code more than a few lines besides deno which might require a bit more work but that should be fairly simple.

Bun and Deno are both private companies that have received funding from venture capitalists so they're here to stay for at least a few years and have time to create a place for themselves in the market. Node on the other hand is handled by the OpenJS Foundation.

Deno's business model is hosting JS, TypeScript and, WebAssembly serverless functions on the edge and Jarred (creator of Bun) has shared similar plans along with continuous integration for backend and frontend applications on the edge for Oven's (Bun's parent company) future and sustainability.

Let's see how these things progress and where the community goes with all this competition and hype.

If you like what you read, you can support me by following me on [Twitter](https://twitter.com/AdityaTripathiD). Thank you!