A sizable portion of the Hackaday audience groans and runs their eyes when some new-fangled Javascript thing comes out. So what makes Bun different? Bun is a runtime (like Node or Deno)t that offers a performant all-in-one approach. Much to the Spice Girl’s delight, it is written in Zig. It offers bundling, transpiling, module resolution, and a fantastic foreign-function interface.
Node.js and Deno run on the V8 Javascript engine and provide the Node-API to access different features, such as filesystems, that don’t apply to web browsers. However, vast amounts of tooling have built up around Node.js and NPM (node package manager). Many Javascript projects have a bundling and transpiling step that takes the source and packages it together in a more standard format. Typescript needs to be packaged into javascript, and modules need to be resolved.
Bun bakes all this in. Typescript and JSX “just work.” This dramatically simplifies many projects as much of the build infrastructure is part of Bun itself, lowering cognitive load when trying to understand a project. A SQL client and a Jest-like unit test runner are both built-in. Rather than V8, it uses JavaScriptCore, which starts a little faster. But the incredible speedups that Bun offers come mainly from it being written in Zig and the sheer amount of effort dedicated to benchmarking, profiling, and optimizing. We’re What’s even wilder is that Bun is written by one person, [Jared Sumner].
Since Bun implemented most Node APIs (with more to come), many modules are drop-in compatible. Some web-specific APIs, such as fetch and Websockets, is also built-in. It’s an early project, and we’re suspicious of any claims made by the project developers, but we’re cautiously optimistic. Even if you aren’t big on Javascript things, you’re likely bound to learn WebAssembly eventually. A short video by [Fireship] gives a good overview. All the code for Bun is on Github under an MIT license if you’d like to look at it yourself.
Thanks to [Michael Carlson] for the terrible Spice Girl joke.
Can the gluten sensitive use Bun?
Yes, as long as they use it externally.
Javascript?
Just nuke it from orbit.
It has one purpose:
When applying for a SE job ask ‘What server side Javascript do you run?’
If the answer isn’t something along the lines of ‘None, are you insane?’, _run_ away.
Terminate the interview right there and leave.
You don’t want to work for those twits.
Javascript could compile to the tightest machine code on earth and it’s ecosystem would still suck big wet donkey balls. It’s where all the worst coders have spent the last 20 years on the most monumental steaming pile, ever.
Javascript outside the browser is a tell, like someone who drives a French car. No fixing that level of stupid.
Wish them ‘Better luck next reincarnation’ and never look back.
Agree, but sometimes someone sees they’ve got a hammer, and they’ve got to hit every “nail” with that same hammer, even if the “nail” is in fact a screw.
I can get that it’s nice to have one language both sides of the HTTP server. Personally I’d like to see browsers consider supporting a language that’s less “loose”. Maybe WebAssembly and/or transpliers are a way forward? After all, pretty much everything we’ve ever run on a computer boils down to machine code which has no type-safety whatsoever.
Not that bad, as long as they are typed and linted.
I can tell you are fun at a party and like to smell your own farts. Tell me about how python is useless and everything should be written in assembly or better yet Java.
Geeks aren’t known for being unemotional about their tools.
Speak for yourself, throwing fallacies around and and attacking the person rather than the arguments isn’t what “nice” people renowned for either.
Agree 100%, running any javascript framework on server side: No fixing that level of stupid.
Perfectly correct in almost all respects.
Except perhaps for the Renault Alpine.
@Matthew Carlson said: “Much to the Spice Girl’s delight, it is written in Zig.”
1. OLD SPICE What are the lyrics to the Spice Girls’ hit Wannabe and what does ‘zig-a-zig-ah’ really mean?
https://www.thesun.co.uk/fabulous/3980397/spice-girls-wannabe-zig-a-zig-ah-meaning/
2. Zig (programming language)
https://en.wikipedia.org/wiki/Zig_(programming_language)
All your base are belong to us
That’s my guess too.
For great justice!
“Even if you aren’t big on Javascript things, you’re likely bound to learn WebAssembly eventually”
Huh? Is it also a wasm runtime? Or else this comment makes no sense.
@Jack said: “‘“Even if you aren’t big on Javascript things, you’re likely bound to learn WebAssembly eventually” Huh? Is it also a wasm runtime? Or else this comment makes no sense.’
WebAssembly is Wasm:
WebAssembly (sometimes abbreviated Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating interactions between such programs and their host environment. The main goal of WebAssembly is to enable high-performance applications on web pages, “but it does not make any Web-specific assumptions or provide Web-specific features, so it can be employed in other environments as well.[1] Link below for more….
1. https://en.wikipedia.org/wiki/WebAssembly