Live data from Hacker News

Bun 0.6

bun.sh

121–130 of 243 posts

Re: Bun 0.6

#121
post #81

Earlier quoted context omitted.

Apparently a hello world is like 90MB. https://twitter.com/jarredsumner/status/1657765876085690368

IIRC the latest Linux Node.js binary is over 70MB. Though Bun doesn't use Node.js I believe, there's a reference (At least it's not JVM Hotspot...)

A Java Runtime for Hello world is just 32 MB: https://adoptium.net/blog/2021/10/jlink-to-produce-own-runti...

Re: Bun 0.6

#122
post #81

Earlier quoted context omitted.

Apparently a hello world is like 90MB. https://twitter.com/jarredsumner/status/1657765876085690368

Is 90MB really that big when compared against the other types of binaries that would get deployed: containers and VM images? How big is the platform (k8s, docker, etc) you need installed to run your app? Probably more than 90MB.

yeah 90MB for a hello world is big.

Approximately 2,700 times bigger than it could be.

Re: Bun 0.6

#123

Earlier quoted context omitted.

ICU :( https://github.com/oven-sh/bun/issues/2541 https://twitter.com/jarredsumner/status/1616597667408404481

QuickJS has a custom unicode library for this reason.

It’s slow as molasses in some parts though. (Deliberately, it’s a trade-off.)

The Unicode part of ICU shouldn’t be that large, however (on the order of hundreds of kilobytes), it’s the locale data that’s big[1]. Does Bun implement ECMA-402 internationalization? Even without locales, one of the largest parts of ICU data is normalization and casing tables, which I think bare ECMAScript does not require. (It does mean bare ECMAScript cannot adequately process Unicode text, but meh, you get what you pay for.)

[1] https://unicode-org.github.io/icu/userguide/icu_data/buildto...

Re: Bun 0.6

#124
post #2

I work on Bun. Happy to answer any questions also: there is a bug in `bun build --compile` I am currently working on fixing. Expect a v0.6.1 in a bit

1. It seems the Bun.file API (https://bun.sh/docs/api/file-io) doesn't provide a way to distinguish between a zero-size file and a file that doesn't exist. Is this right? If it is, it would be nice to have one. It doesn't have to interfere with the lazy loading.

2. Do you cross-compile Bun? If you do, how has your experience been cross-compiling with Zig when you have a C++ dependency?

Re: Bun 0.6

#125
post #2

I work on Bun. Happy to answer any questions also: there is a bug in `bun build --compile` I am currently working on fixing. Expect a v0.6.1 in a bit

California Ave Lockitron crew represent!! Glad to see you leading this, incredible work and nice to see the positive reception.

In Palo Alto by the Nuthouse? small Internet

Re: Bun 0.6

#126

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. Let the downvoting of this simple observation begin.

[deleted]

Re: Bun 0.6

#127

Earlier quoted context omitted.

QuickJS has a custom unicode library for this reason.

It’s slow as molasses in some parts though. (Deliberately, it’s a trade-off.) The Unicode part of ICU shouldn’t be that large, however (on the order of hundreds of kilobytes), it’s the locale data that’s big[1]. Does Bun implement ECMA-402 internationalization? Even without locales, one of the largest parts of ICU data is normalization and casing tables, which I think bare ECMAScript does not require. (It does mean b…

Bare ECMAScript does require normalization [1] and case conversions (for the root locale only) [2].

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: Bun 0.6

#128
post #55

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. Is Bun in a state where I can start thinking about replacing my Node.js production toolchains with it?

Nope. I wouldn't. Not for production.

• Bun is not stable yet (0.6.0)

• Zig, the language Bun is built upon is not stable either (0.11.0)

Nothing against these awesome projects, I'm all in for a streamlined toolchain (TypeScript, bundling, binary generation...) and other excellent goals driving the Deno and Bun teams.

But...

• Node.js is a powerful piece of software, it's stable and full of battle-tested buttons and knobs

• NPM and Bun/Deno are not real friends at the moment, just acquaintances

• Take benchmarks with a pinch of salt. Real-world app performance depends on a well-greased system, not a particular 60,000 req/s react render benchmark. Remember the adage: your app will as fast as your slowest component.

On a side note, lately I've been extending Node.js with Rust + N-API (ie. napi-rs or neon) and it opens up excellent possibilities.

https://napi.rs/ https://neon-bindings.com/

Re: Bun 0.6

#129
post #127

Earlier quoted context omitted.

It’s slow as molasses in some parts though. (Deliberately, it’s a trade-off.) The Unicode part of ICU shouldn’t be that large, however (on the order of hundreds of kilobytes), it’s the locale data that’s big[1]. Does Bun implement ECMA-402 internationalization? Even without locales, one of the largest parts of ICU data is normalization and casing tables, which I think bare ECMAScript does not require. (It does mean b…

Bare ECMAScript does require normalization [1] and case conversions (for the root locale only) [2]. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Ah, I see, String.prototype.normalize() is in ES6. I remembered that Duktape (which has its own, even slower Unicode library) can’t do it[1], but then it doesn’t try for ES6 either.

[1] https://github.com/svaarala/duktape/issues/1718

Re: Bun 0.6

#130

Earlier quoted context omitted.

Fwiw, Deno can do this too: https://deno.com/manual@v1.33.3/tools/compiler

Yeah, I used Deno to build a simple URL switch case utility in late 2021 to handle sending different URLs to different browsers, and that was ~56MB compiled at the time. I don't know if it's changed in the base size since then, but if bun is resulting in 90MB binaries (as reported here), then Deno may yield a significant reduction in size (if it hasn't gotten much worse in that time).

I'm sure it'll get better (I'm sure both will); there's probably a lot of potential optimization to be done, dropping unused parts of the standard library and platform APIs and such (the way Deno loads most of the standard library as remote modules might actually be helping it here at the beginning), and Jarred is a stickler for hyper-optimization
Post reply on HN