Live data from Hacker News

Bun 0.6

bun.sh

31–40 of 243 posts

Re: Bun 0.6

#31

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. 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,…

From experience, static websites on https://pages.dev are blazing fast (and free); ex: pagespeed result for a static webpage I host: https://archive.is/PkZbO

Netifly was equally fast (not free).

Re: Bun 0.6

#32
How big are the bundles (edit: I meant self-contained executables) and do they depend on glibc?

Edit: just saw a comment from the author indicating glibc is required.

Re: Bun 0.6

#33
post #19

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. was it ever offered for standardisation?

There is no standard, import.meta is host-defined:

    13.3.12.1.1 HostGetImportMetaProperties ( moduleRecord )

    The host-defined abstract operation HostGetImportMetaProperties takes argument moduleRecord (a Module Record) and returns a List of Records with fields [[Key]] (a property key) and [[Value]] (an ECMAScript language value). It allows hosts to provide property keys and values for the object returned from import.meta.
https://tc39.es/ecma262/#sec-hostgetimportmetaproperties

Re: Bun 0.6

#34
post #15
post #7

Earlier quoted context omitted.

Congrats on the release! How standalone are the standalone executables produced by `bun build`? Is a libc or equivalent expected to be present?

Bun does need glibc, but older glibc versions should work okay because of this: https://github.com/oven-sh/bun/blob/78229da76048e72aa4d92516... We haven't implemented polyfills for everything yet though, like Bun uses posix_spawn and doesn't have an exec + fork fallback Bun's dependencies otherwise are statically linked

Is there any plan to allow for statically linking with musl to get completely shared-lib-dependency-free executables?

Re: Bun 0.6

#35
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

Not a question, cause you already mention this here, but just wanted to give you extra props for supporting CommonJS out of the box; keep up the great work.

https://twitter.com/jarredsumner/status/1475238259127058433?...

have been doing this (using ES and CommonJS modules in the same file) in clientside code via Browserify or Rollup ever since ESM got popular but it's a bit more nuanced and annoying to do in NodeJS

Re: Bun 0.6

#36
post #24

Earlier quoted context omitted.

You've been able to do this with Deno for a long time (and Node too, as of recently). The downside is it bundles all of V8 so a "hello world" binary ends up being at least 70mb.

I've been desensitized by my world of 500mb docker containers.

Have you tried using alpine based images instead of debian/ubuntu/others? I know it's not always possible especially because of musl but for most things it works fine and is tiny.

Re: Bun 0.6

#37
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).

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).

Is there some benefit that Javascript bundlers have that I'm unaware of?

Truly curious.

Re: Bun 0.6

#38
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

Revenue/monetization model?

Given that Oven has taken $7m in VC funding, how do you plan to monetize Bun, etc?

Re: Bun 0.6

#39

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). Is it just because most Javascript developers have never learnt from any of the lessons that came from decades of compiled languages? (compilers, c…

Because there were browsers and no standards. How can you expect someone that starts coding on the web to know what pains kernel went through decades prior?

Re: Bun 0.6

#40
post #14

Earlier quoted context omitted.

It's why I dove into Go. This definitely took me from the 'eh, kinda cool project' to 'I cant wait to try this out immediately' camp. The binaries are pretty huge, hoping they can bring that down in time.

> The binaries are pretty huge, hoping they can bring that down in time. I'm surprised the numbers are as high as they are and hope they can reduce them... but they'll never get down to the kind of numbers Go and Rust get to because Bun depends on JavaScriptCore, which isn't small, and unless they're doing some truly insane optimizations they're not going to be able to reduce its size. FWIW QuickJS is a tiny JS runti…

JSC is ridiculously fast, this is what makes bun great
Post reply on HN