> Standalone executables. You can now create standalone executables with bun build.<p>> bun build --compile ./foo.ts<p>> This lets you distribute your app as a single executable file, without requiring users to install Bun.<p>> ./foo<p>This is big! Part of Go's popularity is due to how easy it is to produce self-contained executables.<p>And it seems to support amd64 and arm according too: <a href="https://twitter.com/jarredsumner/status/1657964313888575489" rel="nofollow">https://twitter.com/jarredsumner/status/1657964313888575489</a>
I work on Bun. Happy to answer any questions<p>also: there is a bug in `bun build --compile` I am currently working on fixing. Expect a v0.6.1 in a bit
I am truly perplexed as someone outside of the Javascript ecosystem; why are there so many incompatible bundlers? If you look at most compiled languages they have a set ABI / executable image format, and you just use a link editor (either compile time, run time, or both).<p>Is it just because most Javascript developers have never learnt from any of the lessons that came from decades of compiled languages? (compilers, compiler tools, operating system and kernel development, etc).<p>Is there some benefit that Javascript bundlers have that I'm unaware of?<p>Truly curious.
Tangential, but, this has to be one of the fastest websites I've used recently. How is it possible they get such fast loading of static content? It's basically instantaneous, specially with JavaScript disabled.<p>edit: Oh well, after navigating to some pages on the blog I see that everything was already on browser cache, so that's why it was so fast. Reminds me I need to overwrite Netlify's cache-control on my website, even though it's already very fast to load (Netlify sets max-age=0, must-revalidate by default).
`bun` is currently my favorite "just works out of the box" utility for running Typescript programs.<p>I've tried a couple and struggled with configuration and, on top of it all, bun is simply faster.<p>So, if you want to write a bunch of `.ts` files and point something at them, I really recommend `bun` (and, frankly, why would you write `.js` in 2023? Probably because you've not tried bun.<p>Edit: I don't care about bundle sizes, because I'm just using bun to run my @benchristel/taste sub-second test suite.
How big are the bundles (edit: I meant self-contained executables) and do they depend on glibc?<p>Edit: just saw a comment from the author indicating glibc is required.
I've been pretty jaded by Node.js lately, especially with all of the ESM and TypeScript stuff. This led me to try using Deno but Deno was missing the mark in a lot of ways.<p>Is Bun in a state where I can start thinking about replacing my Node.js production toolchains with it?
Looks great! Still eagerly waiting for Windows support: I have a specific use case where I need both a bundler and a package manager to run on the user's desktop cross-platform, and right now that's yarn + esbuild. I'd love to roll this into a single, performant solution. It's already being worked on as far as I know [1], excited to upgrade to Bun when that's available.<p>[1] <a href="https://github.com/oven-sh/bun/issues/43">https://github.com/oven-sh/bun/issues/43</a>
Funny to see improvements in crypto.createHash… I was totally caught off guard yesterday noticing most of crypto has been removed in Node 20 and replaced with the exclusively-async „subtle“ WebCrypto. Quite a pain to work with when you need synchronous code.
It would be helpful to see how Bun's minifier compares to the others with popular libraries:<p><a href="https://github.com/privatenumber/minification-benchmarks">https://github.com/privatenumber/minification-benchmarks</a>
We need an equivalent Python Mojo for TypeScript.<p>This seems like the most obvious thing yet to be built.<p>I wonder how hard it would be to take an existing systems language and add TS syntax to it. Seeing as they are all built on LLVM. Or maybe you could transpile TS to Zig.
import.meta.main (whether the current file is the 'main' or just being required) looks interesting and like something I have wanted in the past, but not sure if it would actually be a good idea.<p>was it ever offered for standardisation?
Why are we still minifying JavaScript? Is it only for obfuscation?<p>State-of-the-art HTTP servers already do a pretty damn good job gzipping stuff on the fly, do we need this garbage?<p>If it is for obfuscation, fine, can we just call it that?
Is WHAT? The title should tell us what the post is about. Why do we have to keep bringing this up? A title like this is a great way to miss out on a lot of views and reduce the usefulness of your post.<p>Let the downvoting of this simple observation begin.