Bun v1(bun.sh) |
Bun v1(bun.sh) |
Of course I imagine if the code is written with performance in mind, Java code can beat out node.js, but my experience is that out in the wild, most Java code is not particularly performant.
* Written Zig, an unstable programming language
* Segfaults and crashes are common
* Doesn’t work on windows (edit: fixed in v1)
* The web-server is based on uWS, a third-party dependency maintained by one person
* Vendor-specific APIs like Bun.serve, Bun.file, etc. You can call Node APIs in Bun, but you cannot call Bun APIs in Node
* Tries to be everything at once: a bundler, a compiler, a package manager, a runtime, a testing framework, etc.
* A VC-baked effort. If the funds run dry there is no Bun anymoreThis is confusingly worded, and I didn't understand what you were trying to say before I watched the video announcement.
"Bun" is a runtime, "JS" is a language that's implemented by multiple runtimes (including Bun, npm, and browsers). It makes no sense to say "you can't call the Bun APIs in JS" because calling them in JS is the only way to do it in the first place.
What you seem to mean is "you can't call Bun APIs from other runtimes" which is... kind of obvious? And also kind of an empty complaint, since Bun is primarily an npm replacement, and npm does the same thing[1]
What does this mean? Every JS runtime (node, deno, bun etc.) has its own set of APIs and they are generally not cross-compatible. The code for all the Bun APIs is open source so I'm not sure what makes them proprietary.
> You can call JS in Bun, but you cannot call Bun APIs in JS
Bad use of terminology. JS is the language, JavaScript/ECMAScript, and every JS runtime (node, bun, deno etc.) is using it. So you definitely can call Bun APIs in JS.
Bun 1.0 announcement [video] - https://news.ycombinator.com/item?id=37422106 - Sept 2023 (56 comments)
Very professional! Also answers my question - Bun works with Remix Run.
Although they stopped throwing the bun around halfway through only for it to appear again at the end :)
And while the premise is still great, the enthusiasm has waned a bit in recent months. A lot of the decision making process seems a bit arbitrary and off the cuff, at least as presented on Twitter. Could be a mischaracterization as I haven't followed the Github threads closely.
I also question the use of Zig for a project that's intended to replace node and be production ready. It may be fun to work with and something fresh/new, but taking something very unproven and in heavy development is not a way to inspire confidence among your potential adopters.
I hate the Rust meme as much as anybody else, but I really question why you wouldn't use it here. The author of Bun posts about tracking down memory leaks on the regular... which shouldn't even be a problem space a modern runtime deals with.
All that being said... I will definitely use Bun for CI/builds/local projects... much more hesitant to use it for a production/live service at this point
`bun upgrade` Congrats! You're already on the latest version of bun (which is v0.8.1)
Hopefully it's quick to follow, and some just jumped on the publish post a bit early!
if (typeof Bun === "undefined") {
// Node.js code
} else {
// Bun code
}
If you are writing a lot of Bun-specific code, yeah that will only work on Bun ofc. But I like that now I can add some small snippets of bun-optimized code in my libraries.Otherwise, normally you'd use ESM APIs > Node.js APIs > Bun APIs, like if you are hashing something, right?