[Enhancement]: Consider changing the runtime we use for JavaScript based servers (Bun?) #10
Labels
awaiting-approval
Topic has not been approved or denied
enhancement
An update to an existing part of the codebase
Checked Existing
What enhancement would you like to see?
Mostly a place to discuss the idea, not necessarily a real proposal right now
Historically we have always only targeted the "essential default" of the server-side JavaScript ecosystem, that being NodeJS and npm. Even though there have been other runtimes/package managers in the past, our rationale for sticking with NodeJS and npm has been that other runtimes are not mature/lack features/are substantially different from Node, and npm is the default package manager that ships with Node. It's already likely that the developer has NodeJS installed and if so then they absolutely have npm already. Not targeting other runtimes/package managers removes a non-essential step for getting our servers running by not requiring the installation of additional non-essential tools
However as time has gone on, these reasons may not always remain valid. Specifically with the release of Bun 1.2, Bun looks like it's becoming a very viable alternative
I've been hesitant in the past to try and support Bun (even as an alternative, while keeping NodeJS compatibility) due to several controversial design decisions the Bun team has made. Such as:
Among others. However Bun does seem to be getting very promising, especially with the now built-in SQL and S3 support written in native code. Bun 1.2 also rewrote all of zlib in native code for a claimed 2x speed increase (Nintendo, and thus us, uses zlib a lot), and they claim a 3x speed increase for Express applications (which we use everywhere). Bun 1.2 also now targets the entire NodeJS test suite and has over 90% compatibility. Some of the non-100% cases are in areas we use, but it's unclear if they would affect us right now
Bun also comes with some additional benefits, such as top-level
await
and being able to run TypeScript applications without needing to transpile them first (which was a headache @binaryoverload had complained about very recently). It may be worth considering switching our target from NodeJS to Bun with this new release, though we would need to do extensive testing on ALL servers to ensure compatibility (Bun does not implement every NodeJS module, or every feature of every implemented module, which may cause issues not just for our code but also the code in dependencies which we don't control). Going all-in on Bun would mean losing NodeJS support, however. Which is something to keep in mindOne thing to keep in mind is that since Bun does not use V8 under the hood and does not fully support the
node:v8
module, things like existing performance measuring tools/profilers likely will no longer function correctly. This may pose an issue, since we HAVE had issues with things like memory leaks in some of our servers which were only found through profilingAny other details to share? (OPTIONAL)
No response
The text was updated successfully, but these errors were encountered: