News for hackers. Stuff that matters.
Re:Bun v1.0.0 by Jarred on Friday September 08, 2023 @11:16AM (#37434643)
I work on Bun. Happy to answer any questions

Could the mods change the link to the blog post? It explains better than the github release page

Blog post: https://bun.sh/blog/bun-v1.0

Re:Bun v1.0.0 by jzelinskie on Friday September 08, 2023 @11:39AM (#37435019)
Congrats on the launch! The NextJS guide[0] claims that bun doesn't support all the node APIs to run the dev server, is that still the case with 1.0?

[0]: https://bun.sh/guides/ecosystem/nextjs

Re:Bun v1.0.0 by Jarred on Friday September 08, 2023 @11:41AM (#37435078)
We landed Next.js pages directory support two days ago and forgot to update that guide
Re:Bun v1.0.0 by notsrg on Friday September 08, 2023 @12:15PM (#37435591)
Any docs for migrating an existing Nextjs project? No rush but would be great to have :)
Re:Bun v1.0.0 by jzelinskie on Friday September 08, 2023 @11:44AM (#37435131)
Awesome! Reading through the install script now -- would you considering using installing to $XDG_DATA_HOME and falling back to `~/.bun`?
Re:Bun v1.0.0 by oefrha on Friday September 08, 2023 @11:37AM (#37434975)
> It reads your package.json and writes to node_modules, just like other package managers, so you can replace:

> ...

> pnpm

pnpm's flagship feature is global deduplication of packages, so sadly bun's package manager doesn't seem to be a replacement. Is there any plan or intention to support pnpm-like disk saving?

That said, I'm very impressed with the speed of `bun add` with already cached packages. Literally instant.

Re:Bun v1.0.0 by Cu3PO42 on Friday September 08, 2023 @11:55AM (#37435311)
Bun already supports that [0]. It is the default behavior on Linux, but can also be enabled on macOS.

[0] https://bun.sh/docs/install/cache#saving-disk-space

Re:Bun v1.0.0 by oefrha on Friday September 08, 2023 @12:04PM (#37435419)
Nice! I was looking at du(1) output on macOS which appears to indicate all files are duplicated. It probably just can’t tell the files are clonefile’d.
Re:Bun v1.0.0 by Jarred on Friday September 08, 2023 @12:10PM (#37435509)
There is a very obscure undocumented api in macOS for detecting if two files are equal block-by-block but yeah I don’t think most tools can tell when files are clonefile’d
Re:Bun v1.0.0 by Cu3PO42 on Friday September 08, 2023 @12:24PM (#37435726)
Just a note on your documentation: it says "this benefit does not extend to macOS" about saving disk space. I find that to be slightly misleading. Since arguably the most common FS for macOS is now APFS, it does save significant disk space unless one were to modify the node_modules files.
Re:Bun v1.0.0 by thunderbong on Friday September 08, 2023 @01:01PM (#37436240)
Any chance of this coming to Windows? Most of our developers are on Windows systems.
Re:Bun v1.0.0 by hiccuphippo on Friday September 08, 2023 @02:00PM (#37437082)
Keep track of this issue: https://github.com/oven-sh/bun/issues/43

According to that, the speed benefits will probably not be as noticeable in windows.

Re:Bun v1.0.0 by lolinder on Friday September 08, 2023 @12:09PM (#37435487)
You're jumping to conclusions: I just tried the package.json below, and bun's node_modules folder is smaller than pnpm's (3.9M with pnpm vs 3.4M with bun), and as a sibling noted, bun is also deduplicating globally.

That, coupled with the fact that bun installs twice as fast when no packages are cached (634ms compared to 1.3s) and 100x as fast when all packages are cached (6ms to 639ms), I think it's fair to say that bun can replace pnpm.

Here's the package.json I tried:

    { "dependencies": { "express": "^4.18.2" } }%
Re:Bun v1.0.0 by cobbzilla on Friday September 08, 2023 @03:34PM (#37438334)
I had difficulty using Bun with Verdaccio, a private/local npm repository.

I know it’s possible to get it to work, but I didn’t have time to fiddle all the bits.

If Bun made this easier, I’d switch from pnpm immediately.

Re:Bun v1.0.0 by zengid on Friday September 08, 2023 @11:30AM (#37434883)
from that blog post:

"Unlike Node.js and other runtimes that are built using Google's V8 engine, Bun is built using Apple's WebKit engine. WebKit is the engine that powers Safari and is used by billions of devices every day. It's fast, efficient, and has been battle-tested for decades."

That's really interesting, does WebKit do less JITing or something to be faster for startup?

Re:Bun v1.0.0 by billywhizz on Friday September 08, 2023 @01:11PM (#37436359)
bun startup is fast compared to other JS runtimes but imo this is little or nothing to do with JSC versus v8 as the javascript engine. i did some experiments a while back and wrote them up here if you want to take a look. https://just.billywhizz.io/blog/on-javascript-performance-03...
Re:Bun v1.0.0 by leeoniya on Friday September 08, 2023 @11:00PM (#37441819)
awesome writeup, as always.
Re:Bun v1.0.0 by billywhizz on Saturday September 09, 2023 @06:34AM (#37443888)
thanks! love your uPlot library btw!
Re:Bun v1.0.0 by leeoniya on Saturday September 09, 2023 @01:25PM (#37447783)
<3
Re:Bun v1.0.0 by ryanrussell on Friday September 08, 2023 @11:34AM (#37434940)
Amazing work Jarred.

I am still absolutely amazed at how much more performant websockets throughput in bun vs node.

Congrats on 1.0!

Re:Bun v1.0.0 by wdb on Friday September 08, 2023 @11:30AM (#37434876)
Congratulations on the release! Looks really promising. I wish I was smart enough to solve some my own issues
Re:Bun v1.0.0 by jkrems on Friday September 08, 2023 @11:29AM (#37434859)
Congrats on 1.0!
Re:Bun v1.0.0 by zengid on Friday September 08, 2023 @11:24AM (#37434794)
Congrats!
Re:Bun v1.0.0 by majestic5762 on Friday September 08, 2023 @11:45AM (#37435143)
Are there any edge cases when using bun with react-native?
Re:Bun v1.0.0 by skybrian on Friday September 08, 2023 @11:52AM (#37435261)
Any plans for Electron support (or similar)?
Re:Bun v1.0.0 by brundolf on Friday September 08, 2023 @11:57AM (#37435323)
Bun ships features and improvements fast and often, which is great

But from anecdotes, I have the impression people still run into bugs and missing functionality semi-commonly. I'm sure it works great for small/personal projects, but I've been hesitant to recommend it for production use at my workplace because of this impression

So my question is: how feature-complete/stable/secure is it right now, what does the v1.0 label say about that, and what are the long-term plans/prioritization/guarantees around this area?

Re:Bun v1.0.0 by toastal on Friday September 08, 2023 @12:03PM (#37435407)
When will Bun open up to libre and/or federated chat options instead of requiring users sign up for and agree to Discord’s ToS?
Re:Bun v1.0.0 by dudus on Friday September 08, 2023 @12:04PM (#37435409)
There was some criticism yesterday about bun being stable using a language (zig) that isn't considered stable. Do you care to comment about it?

Ref: https://news.ycombinator.com/item?id=37422894

Re:Bun v1.0.0 by solatic on Friday September 08, 2023 @01:10PM (#37436353)
Zig isn't an interpreted language; once the code is compiled, the produced artifact doesn't change. Stability doesn't really play a factor there.

Sure, the instability of Zig may increase the maintenance costs for Jarred, to use updated versions of Zig. But this has no effect on the features that Bun provides. The risk that a change to Zig would be so consequential that they would actually prevent Jarred from continuing to work on Bun, or would otherwise force Jarred to fork Zig, that risk is so low as to be inconsequential.

(disclaimer: not associated with either bun or zig, the above are pure opinions)

Re:Bun v1.0.0 by zengid on Friday September 08, 2023 @02:10PM (#37437220)
Not OP but I think they meant Zig isn't 1.0 and therefore could be considered "not ready for prod". I'm not claiming anything about Zig; I can only hope that the Bun folks have done their due diligence and ran it through fuzzing/ASAN/etc before making the 1.0 stamp of approval.
Re:Bun v1.0.0 by albedoa on Friday September 08, 2023 @02:18PM (#37437308)
That's the point being addressed by the comment you are responding to.
Re:Bun v1.0.0 by swyx on Friday September 08, 2023 @02:12PM (#37437232)
also stability is more of a statement about api design than internals
Re:Bun v1.0.0 by kaba0 on Friday September 08, 2023 @02:57PM (#37437849)
That in itself is no good argument -- it surely has some bug, and if, say, zig changes in the meanwhile and it can no longer compile the previous code then it can be problematic from a maintenance POV.

With that said, it is probably fine to use for most ordinary apps, but I wouldn't yet build a bank infrastructure on top for example.

Re:Bun v1.0.0 by mrinterweb on Friday September 08, 2023 @03:57PM (#37438622)
There was a FUD theme with some of the "zig isn't stable (>=1.0) so how can I trust bun" threads. So long as bun is stable, does it matter that zig is not 1.0 for the developer using bun? So long as zig is reliable enough for the developers of bun, I don't see the concern.
Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @12:18PM (#37435636)
Congrats!

This has probably been asked before, but has there been any thoughts about moving community chat to a platform other than Discord? Discord has been brought up many times on HN for its accessibility/privacy/proprietary lock-in concerns that don't seem to be in line with the spirit of open-source. Also see [1].

[1] https://drewdevault.com/2021/12/28/Dont-use-Discord-for-FOSS...

Re:Bun v1.0.0 by Liquix on Friday September 08, 2023 @01:47PM (#37436906)
Not likely even in light of how important it is to not use Discord. In the comments of the bun 0.6 announcement, a question similar to yours was downvoted almost enough to get flagged:

https://news.ycombinator.com/item?id=35970869

And in the comments of the bun 0.8 announcement, the same question generates very little interest and some well every other project uses it, so...:

https://news.ycombinator.com/item?id=37244294

Re:Bun v1.0.0 by toastal on Friday September 08, 2023 @01:54PM (#37437001)
Yet we should still continue to press against proprietary chat. Developers are the kind of folks wise enough about technology to know better than to support this. There are very good reasons to at a minimum support a bridge. If we have to teach new developers raised on Discord, then that’s a great opportunity for them.

> Choosing proprietary tools and services for your free software project ultimately sends a message to downstream developers and users of your project that freedom of all users—developers included—is not a priority.

— Matt Lee

Re:Bun v1.0.0 by KRAKRISMOTT on Friday September 08, 2023 @04:53PM (#37439268)
Hacker news is proprietary too
Re:Bun v1.0.0 by fkyoureadthedoc on Friday September 08, 2023 @05:18PM (#37439566)
I don't think anyone uses it for community chat / support. You can also content without logging in, its content is search indexed, and it doesn't try to convince you to spend money on it.
Re:Bun v1.0.0 by MatthiasPortzel on Friday September 08, 2023 @06:33PM (#37440152)
[delayed]
Re:Bun v1.0.0 by tyre on Friday September 08, 2023 @07:18PM (#37440496)
Github issues are indexed by google and searchable.
Re:Bun v1.0.0 by SparkyMcUnicorn on Friday September 08, 2023 @07:58PM (#37440798)
https://www.answeroverflow.com

And I think Deno uses it.

Re:Bun v1.0.0 by keb_ on Tuesday September 12, 2023 @11:20AM (#37482629)
Definitely useful, but this should be a built-in feature of Discord at this point.
Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @11:37PM (#37442034)
Git is distributed.

> Discord-hate is a double standard that is not applied to any service

What does this mean? Dropbox/Amazon/Google/Windows get criticism across the web and on HN regularly, some of those far more than Discord.

> to the extent that comments criticizing Discord appear with extreme regularity on threads that should be completely unrelated

I don't get it. Are you implying a conspiracy?

Re:Bun v1.0.0 by dancemethis on Saturday September 09, 2023 @09:19AM (#37445032)
Discord _is_ particularly hostile to user privacy, that said.
Re:Bun v1.0.0 by KRAKRISMOTT on Friday September 08, 2023 @06:46PM (#37440254)
No, but if your account at one of the big techs gets stuck in bureaucratic hell, the only way to get support is to make a fuss here.
Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @05:15PM (#37439536)
FOSS projects don't organize on HN, it's a public link aggregator.
Re:Bun v1.0.0 by epolanski on Friday September 08, 2023 @08:55PM (#37441126)
I see this issue so overblown.

Discord is just an added communication channel, mostly for the community.

Relevant discussions happen on GH.

I am part of numerous programming discords and I just see no issue with them being on discord, again, starting from the fact being there is far from being a requirement for anything really.

Re:Bun v1.0.0 by RunSet on Saturday September 09, 2023 @03:31AM (#37443083)
> I am part of numerous programming discords and I just see no issue with them being on discord

Has Discord ever asked you to provide and confirm your phone number to continue using it?

Re:Bun v1.0.0 by toastal on Saturday September 09, 2023 @06:14AM (#37443808)
I’ve been there. I told the project manager to buy me a burner phone+SIM or I wasn’t using it. The admin disabled the SMS requirement as a result & for a brief project I used it in locked down container not tied to any of my personal info. I also was bombard with CAPTCHAs any time I tried to use it despite keeping the cookies in that container. It was a bad experience, & I pray I won’t have to interact with it again.
Re:Bun v1.0.0 by nonethewiser on Friday September 08, 2023 @09:49PM (#37441399)
Well if that’s your concern lets start with proprietary remote repositories such as github and all the CI providers. That’s a lot more critical to the development process than a chat app.
Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @11:33PM (#37442013)
I prefer to compare apples to apples. Git is distributed. If you host your repo on Github, you can very well just push that same Git repo to Sourcehut or your private Git server.

But otherwise, yeah, I would warn against potential vendor lock-in, especially if that service is not open-source.

Re:Bun v1.0.0 by toastal on Saturday September 09, 2023 @01:59AM (#37442666)
Yeah, the lock-in will come with CI & and the pull-request model that requires an account in this case. The former Microsoft GitHub largely ate all the competition with its own ‘free’ (gratis) offering in Actions, but you could seek out a different CI or self-host. The latter could be easily circumvent by offering a mailing list or maintainer email—or mirror elsewhere—but it’s rare to see this with projects on Microsoft GitHub.

Well, and joining most discussions require an account, and if your alternative communication platform is Discord, we see all the same issues of lock-in.

Re:Bun v1.0.0 by toastal on Friday September 08, 2023 @11:45PM (#37442078)
Matt Lee’s quote comes from an article about why you would want to leave the walls of Microsoft GitHub. I would agree that would be ideal too, but developers are even more reluctant with that one—if you think suggesting libre coms gets you a downvote here, try suggesting not Microsoft GitHub.
Re:Bun v1.0.0 by kylemh on Friday September 08, 2023 @02:48PM (#37437730)
Discord's accessibility has improved quite a bit. Even a screenreader user in the article's source section agrees:

> What I can tell you is that, to my surprise, Discord’s accessibility has apparently improved in recent years, and more blind people are using it now. One of my blind friends told me that most Discord functionality is very accessible and several blind communities are using it. He also told me about a group of young blind programmers who are using Discord to discuss the development of a new open-source screen reader to replace the current Orca screen reader for GNOME

Discord is honestly a great place for FOSS to house their communications. I find all of the articles claims very haphazard:

> When you choose Discord, you are legitimizing their platform and divesting from FOSS platforms

It is legit? It's free? It has loads of compelling features, is very accessible, and - most importantly... Also, choosing Discord does not take value away from FOSS communication platforms.

> Use IRC

It isn't IRC which is very inaccessible to lots of people new to computers and software in general.

Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @03:17PM (#37438123)
> Discord's accessibility has improved quite a bit. Even a screenreader user in the article's source section agrees:

Yes, but this ignores the others issues the post brings up: Users who cannot afford new enough hardware to make the resource-intensive client pleasant to use are also left by the wayside.

Or: Discord also declines service to users in countries under US sanctions, such as Iran.

> Discord is honestly a great place for FOSS to house their communications ... Discord does not take value away from FOSS communication platforms.

The blog's author, and others such as myself disagree. Discord chats are not indexible by search engines, so solutions are harder to find. You need a Discord account, and you need to join the channel to even see chat and use the search feature. Discord is proprietary and non-extensible because of it. Lastly, Discord is also profit-motivated, so they can shut things down or add limitations because they need to maintain a profit, and there would be nothing we can do about it. "Enshittification" as HN users love to say, is practically inevitable.

> It isn't IRC which is very inaccessible to lots of people new to computers and software in general.

Which client are you speaking of? :) The beauty of IRC, Matrix, XMPP, etc is that you have the choice and freedom (without being legally threatened by Discord Inc.) to build your own client.

Re:Bun v1.0.0 by epolanski on Friday September 08, 2023 @08:58PM (#37441147)
But discord is a better experience than IRC or any other chat I know of, and I say it as someone who pioneered #quakenet, #freenode and #libera on IRC.

Instead of bashing library authors that have already so much to think, why don't you propose a discord replacement and pay for it, while providing the same ease of use for the users and the same features from channels, threads, third party apps/plugins, video conferencing, etc?

Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @11:21PM (#37441951)
> But discord is a better experience than IRC or any other chat I know of, and I say it as someone who pioneered #quakenet, #freenode and #libera on IRC.

I'm glad you enjoy Discord! And thanks for your hard work. But I disagree, and all of the issues with Discord I pointed out above still persist despite your love for the UX.

> Instead of bashing library authors that have already so much to think

I never bashed library authors.

> why don't you propose a discord replacement and pay for it

I engage in communities that use Zulip and Matrix. Zulip is free for open-source projects [1], and I donate to a small community that hosts its own Matrix server.

> while providing the same ease of use for the users and the same features from channels, threads, third party apps/plugins, video conferencing, etc?

We're kinda getting away from the point here. No one is suggesting that there is a FOSS alternative to Discord that has 100% feature parity.

[1] https://zulip.com/for/open-source/

Re:Bun v1.0.0 by nonethewiser on Friday September 08, 2023 @09:52PM (#37441420)
> Users who cannot afford new enough hardware to make the resource-intensive client pleasant to use are also left by the wayside.

Wait… people can’t run web browsers?

Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @11:23PM (#37441962)
By "client", they mean the web application that is Discord, which is CPU and RAM intensive especially for folks with older hardware.
Re:Bun v1.0.0 by toastal on Saturday September 09, 2023 @08:19AM (#37444469)
Not everyone lives in the West & has access to the fastest hardware or fastest networks. Some folks are living mostly off-grid using solar power & each heavy application is chewing thru their limited batteries.
Re:Bun v1.0.0 by Liquix on Friday September 08, 2023 @03:20PM (#37438162)
> choosing Discord does not take value away from FOSS communication platforms.

it does though. it's the same vicious cycle that allowed microsoft to gain control of the OS market: developers write programs for windows (because that's where the users are) and users run windows (because that's where the programs run). the more people agree to use discord, the more it becomes "the place where the <x> community is", the harder it becomes for any community to not use it.

9/10 discord users don't understand or care about this at all. which is why it's of utmost importance that developers - especially open source developers, presumably developing open source software for a reason - encourage discussion on other platforms.

Re:Bun v1.0.0 by toastal on Friday September 08, 2023 @03:01PM (#37437892)
Accessibility also refers to the hardware & network speeds of the users machine. Discord is a heavy web app (that also pings back a lot of analytics) with users actively using ‘heavy’ features like sending videos. It’s also subject to US sanctions or internal bans where entire countries can be blocked or do the blocking. Speaking of blocking, Discord could block a community member for a non-community-related reason (or by mistake) & there will be no way to resolve it since the community is not in control of the server.

Free as in gratis, sure. But as in libre? No, it’s definitely proprietary & it’s free because users are the product (data collected and upselling Nitro); not every user wants to give up their privacy freedoms to participate. Discord’s not federated so users will be required to create an account & agree to the ToS & CoC of Discord, not the community running it. Discord has also been hostile towards folks trying to make alternative clients to meet usability needs & certain kind of bots.

Without IRCV3 & bouncer it would be a difficult/unexpected experience for a new user. Luckily IRC isn’t the only libre option. If you want to keep the system requirements low XMPP MUCs are good & allow federation. If you want newer bells & whistles at the cost of system requirements federated Matrix can be considered (tho centralization concerns around Matrix.org having the most users, most used server, most used client, & controls the spec). There are bridges between all of these that you can choose as many or as few as meets the community needs such as a community-hosted XMPP main server in a neutral country with bridges to IRC & Discord.

Re:Bun v1.0.0 by pxc on Friday September 08, 2023 @04:26PM (#37438970)
Requiring stakeholders (users, contributors, whatever) in a free software project to use non-free software to fully participate in the community is a disservice to the movement, the users, and software freedom generally.

There's some room for debate about offering Discord as a bridged option. But having the official community chat only on Discord? How is there even a question?

Re:Bun v1.0.0 by MatthiasPortzel on Friday September 08, 2023 @06:48PM (#37440265)
This argument also applies to GitHub, yet I’ve never seen an open source project criticized for hosting issues on GitHub.

Both are proprietary websites owned by for-profit companies. Both require you to create an account in order to participate in discussion.

Re:Bun v1.0.0 by pxc on Friday September 08, 2023 @07:44PM (#37440680)
Most sizeable F/OSS organizations track bugs somewhere other than GitHub for exactly that reason!

Don't get me wrong. I get small developers defaulting to infrastructure they don't have to set up and maintain themselves, and I understand wanting to meet people where they're at. But it's definitely a problem that GitHub plays such a central role in F/OSS development, too.

Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @11:29PM (#37441990)
A couple points:

1. Git is distributed by design. Hosting on Github tends to not be controversial because that code can also live on Gitea/Sourcehut/your private git server at the same time. If Github goes down, it does not really matter. Very different from Discord, where there is no way to actually backup server/channel data, and attempting to do so may be a violation of the ToS and get you IP banned.

2. Your argument hinges on the fact that you have never seen an open-source project criticized, but it does happen. The blogpost in the parent comment even suggests not hosting on Github.

Re:Bun v1.0.0 by nonethewiser on Friday September 08, 2023 @09:54PM (#37441437)
Non free software? Either this seems misleading or Im confused. You don’t need to pay to participate in the discord. The server owners may have costs but thats not a burden on the community and is always going to be the case.
Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @11:24PM (#37441967)
You may be unfamiliar with the term "free software". See the Wikipedia article: https://en.wikipedia.org/wiki/Free_software
Re:Bun v1.0.0 by dancemethis on Saturday September 09, 2023 @09:26AM (#37445129)
They (Discord team) seem to not know what Free Software means too.

Some time ago I asked them whether they planned to ever become Free Software so it could be actually safe and have a community around it, and after a couple of messages they went (not verbatim, but in spirit) "oh, open source? lolno", missing the point entirely in multiple ways.

Taking into account their massive teen-focused PR campaign - which is a particularly social phase of human growth and FOMO reigns supreme, their predecessor OpenFeint's demise including a privacy lawsuit, the amounts of data and metadata implicitly and explicitly collected, it's at least _likely enough to distrust it_. The doors in the back are bound to be giving that sweet personal data to whomever has a big enough money stick, and/or other non-trustable agencies.

Re:Bun v1.0.0 by stackbeard on Saturday September 09, 2023 @12:24PM (#37447118)
> He also told me about a group of young blind programmers who are using Discord to discuss the development of a new open-source screen reader to replace the current Orca screen reader for GNOME

Could you link to the program they are working on? Nothing appears when searching for "orca screen reader for gnome replacement."

Re:Bun v1.0.0 by spencerchubb on Friday September 08, 2023 @06:34PM (#37440165)
Are there any FOSS alternatives to Discord that are free (as in money)
Re:Bun v1.0.0 by keb_ on Friday September 08, 2023 @11:00PM (#37441824)
Zulip is free for open source projects.

Creating a channel on Matrix.org is free.

Re:Bun v1.0.0 by toastal on Saturday September 09, 2023 @08:08AM (#37444389)
Conversations & blabber.im offer free XMPP accounts. I self-host so I haven’t tested whether or not its users can create MUCs on those servers.

Libera.Chat & OFTC offer free IRC for open source—& can depending on the community be a welcome bridged platform for any alternative as IRC requires the least resources to run (tho if you need rooms with encryption, that won’t be an option).

Re:Bun v1.0.0 by Alifatisk on Monday September 11, 2023 @03:53AM (#37464217)
Could answeroverflow.com be a temporary solution to this?
Re:Bun v1.0.0 by norman784 on Friday September 08, 2023 @12:19PM (#37435653)
Reading the features I wonder if there are plans to also add linter and formatter to bun, it sounds compelling to use one tool for everything.
Re:Bun v1.0.0 by coder543 on Friday September 08, 2023 @12:29PM (#37435792)
How compatible is Bun with Remix[0]?

I’ve been loosely following the progress of Bun for awhile, but I haven’t actually tried it. The blog post you linked does make it sound very intriguing.

[0]: http://remix.run/

Re:Bun v1.0.0 by Jarred on Friday September 08, 2023 @12:32PM (#37435832)
Remix in Bun works on Linux. The built version also works on macOS, but the dev version is blocked on us upgrading WebKit. Intl.ListFormat which Remix uses depends on a newer version of ICU which the current version of WebKit uses but we didn’t want to upgrade WebKit immediately before 1.0 so we held off for this release.
Re:Bun v1.0.0 by TheAceOfHearts on Friday September 08, 2023 @12:32PM (#37435841)
I love that you engage with the community on both HN and Twitter. It's always interesting to see your polls on how certain features should be implemented.

Any plans for other interesting experimental features (like macros)?

I don't know how much this is still a problem, but a few years ago one area where I used to experience a bit of pain was that package.json scripts would get pretty unwieldy and supporting windows required using third-party tools. Have you consider experimenting a bit with the scripts or are you happy with the state of that feature?

Re:Bun v1.0.0 by pmayrgundter on Friday September 08, 2023 @12:33PM (#37435844)
Thanks sir! Been looking forward to this and spinning it up right now :)
Re:Bun v1.0.0 by JeremyJaydan on Friday September 08, 2023 @12:47PM (#37436044)
Love bun, but I disagree that blog post explains better what v1 is, but rather explaining what bun is in general.

It hardly mentions anything until the very bottom on what's changed to reach v1, the github release page on the other hand clearly outlines it.

Personally found the blog post to read like documentation rather than a release announcement.

Re:Bun v1.0.0 by JeremyJaydan on Friday September 08, 2023 @12:59PM (#37436211)
I'm curious about the Bun Framework API, is there a release date set for that?
Re:Bun v1.0.0 by hudsonwillis on Friday September 08, 2023 @01:00PM (#37436234)
Congrats on the release. May I ask if the company is still hiring C++ engineer? I work full time in system programming, and the job post says 'post something you built with bun along with resume' which really confused me as I don't typically build things ON Bun.
Re:Bun v1.0.0 by sprkv5 on Friday September 08, 2023 @01:04PM (#37436275)
Congratulations on reaching 1.0 !

Performance comparisons to Go/Java on the backend would be insightful. Would be interesting to see how close the gap is.

Re:Bun v1.0.0 by ChrisArchitect on Friday September 08, 2023 @01:12PM (#37436377)
Re:Bun v1.0.0 by dang on Friday September 08, 2023 @03:36PM (#37438377)
Yesterday was a mess, with first an announcement video and then a blog post released before they were supposed to. Normally we'd merge the threads but I don't think it makes much sense in this case - there's obviously community appetite to discuss this, so I think we probably just need to eat the duplication, even though we try hard not to.

There's a slightly similar case high on the frontpage right now: https://news.ycombinator.com/item?id=37434918. The thing isn't released yet but the appetite to discuss it is strong.

Re:Bun v1.0.0 by rglover on Friday September 08, 2023 @01:16PM (#37436453)
Congrats, Jarred. Have really enjoyed following along with your progress on Twitter. Excited to give Bun a deep dive :)
Re:Bun v1.0.0 by jedahan on Friday September 08, 2023 @01:23PM (#37436547)
Is there a better phrasing you could use than "drop-in replacement" for a 1.0 release that has decided to not implement all of "node:"?

The let-down from the first two projects not being a drop-in replacement is jarring, now I have to be skeptical of all communications coming from bun.

For context, both projects use osc which requires dgram. I was able to find a feature request tracking ticket from 9 months ago with no communicated plans to implement, but searching for 'dgram' in this announcement page doesn't show anything.

For a quick suggestion - can you explicitly state what modules are not supported by bun 1.0 and put that in the section related to node.js compat?

Re:Bun v1.0.0 by kevlened on Friday September 08, 2023 @01:53PM (#37436984)
In the section related to node.js compat, they state:

> Note — For a detailed breakdown of Node.js compatibility, check out: bun.sh/nodejs.

The detailed breakdown explicitly states which modules are not supported.

Re:Bun v1.0.0 by TheFreim on Friday September 08, 2023 @02:16PM (#37437282)
Drop-in replacement [1]

---

[1] Not a drop-in replacement

Re:Bun v1.0.0 by IshKebab on Friday September 08, 2023 @03:03PM (#37437926)
"Drop-in replacement" doesn't imply perfect 1:1 compatibility with no missing features or differences. Otherwise there would be no such thing as a drop-in replacement (in the software world at least).
Re:Bun v1.0.0 by bastawhiz on Friday September 08, 2023 @03:41PM (#37438441)
If a drop-in replacement isn't almost assuredly 1:1 compatible then _what the heck is it_? The nodejs compat page for Bun notes that base64 encoding is still incomplete. Where do you draw the line?
Re:Bun v1.0.0 by IshKebab on Saturday September 09, 2023 @07:51AM (#37444307)
> Where do you draw the line?

That's up to you, and society. Do you accept that tall people exist?

Right. Now exactly what height do you need to be a "tall person"?

This is the same. I haven't used it so I can't say how optimistic their "drop-in replacement" claim is, but they certainly don't need it to work 100% of the time with 100% of project with 0 changes to make that claim.

Re:Bun v1.0.0 by bastawhiz on Saturday September 09, 2023 @01:14PM (#37447673)
"Drop in replacement" makes an implicit guarantee about utility. It sets expectations about what I'm able to accomplish by investing time and effort into a solution. I don't expect tall people to have any specific utility.

If you call something a drop in replacement and it is not a drop in replacement, it's simply a lie.

Re:Bun v1.0.0 by WA on Friday September 08, 2023 @03:59PM (#37438648)
> Otherwise there would be no such thing as a drop-in replacement (in the software world at least).

That's obviously wrong, because there are things that could be different while the API/compatibility is still matching 1:1, such as:

- speed, memory usage, memory safety

- additional features, more capabilities

- simple licensing stuff

Imho, a drop-in replacement actually suggests that you can simply swap out the runtime and expect your code to work out of the box.

Re:Bun v1.0.0 by pxc on Friday September 08, 2023 @04:15PM (#37438816)
To me it mostly implies that wherever the replacement is supported, it doesn't require substantial reconfiguration or learning a different interface. It's about that approach, even when the execution of that approach is limited or incomplete in scope.

It does generally suggest a high degree of compatibility to me though.

Re:Bun v1.0.0 by TheFreim on Friday September 08, 2023 @04:53PM (#37439263)
I think the definition on Wikipedia is correct, otherwise a "drop-in" replacement is no different than any other replacement, making it a meaningless term.

> [Drop-in replacement] refers to the ability to replace one hardware or software component with another one without any other code or configuration changes being required and resulting in no negative impacts.

https://en.wikipedia.org/wiki/Drop-in_replacement

Re:Bun v1.0.0 by jstummbillig on Friday September 08, 2023 @05:18PM (#37439565)
I don't see a conflict by that definition. The drop in could easily or partially be interpreted from the perspective of the receiver and does not have to be a static property of the replacement.
Re:Bun v1.0.0 by IshKebab on Friday September 08, 2023 @05:35PM (#37439726)
Sure, and for many projects it can be replaced without any other code or configuration changes.
Re:Bun v1.0.0 by nonethewiser on Friday September 08, 2023 @09:45PM (#37441372)
My feeling is that not all replacements have feature parity, but a drop in replacement does.
Re:Bun v1.0.0 by 3np on Saturday September 09, 2023 @12:53AM (#37442410)
podman is a drop-in replacement for docker but yarn is not a drop-in replacement for npm. Makes sense?
Re:Bun v1.0.0 by IshKebab on Saturday September 09, 2023 @07:18AM (#37444105)
Yes exactly. Podman is not 1:1 compatible with Docker. Occasionally you will run into issues e.g. due to the rootless nature. I actually recently had to uninstall Podman and replace it with Docker due to an incompatibility!

But it works enough of the time without any changes that it's reasonable to call it a drop-in replacement.

Re:Bun v1.0.0 by jedahan on Friday September 08, 2023 @04:24PM (#37438944)
Either I missed this on first read-through, or they just added it.

It seems the note mentioning this feels buried for me under a large banner image, instead of near all the other text about compatibility.

Anyway, glad it is there, hope that their communications design improves in the future as at least a few others got caught with mismanaged expectations.

Re:Bun v1.0.0 by ARandomerDude on Friday September 08, 2023 @02:20PM (#37437326)
> Cursory glance looks like for modules - 17 implemented - 17 partially implemented - 7 unimplemented

The question isn't just how many? but also which ones?. Anecdotally, I've been test driving bun for a large application with millions of existing customers. So far, the only issue I've had isn't with bun per se, it's with patch-package not yet supporting the lock file (bun.lockb).

Bun is without question faster than yarn by a wide margin. And say this as someone who really loves yarn.

Re:Bun v1.0.0 by jedahan on Friday September 08, 2023 @04:29PM (#37439011)
All good questions - and every person has different needs.

The fact is each potential adopter either needs to go through and comb over the compatibility page (not what I would expect with a drop-in replacement); or just try and see if it works, and be surprised later if they run into an unimplemented module because they were operating under an incorrect assumption.

Re:Bun v1.0.0 by vasergen on Friday September 08, 2023 @05:23PM (#37439613)
I think the version is actually closer to `1.0.0-beta` than to `1.0.0`. I just installed v 1.0.0 and run `bun repl` and it failed with exit status code 1, it turns out the repl wants to use port 3000, which was used in my case already. There are probably a lot of other small things like that, look on reported bugs in github. So, I also should be 'skeptical' about all claims they did.

Nevertheless I am super impressed with their speed and exited with the result. Didn't expect this project to grow so quickly to this state, I though it will take them much more time. For comparison, deno was started way earlier and now they are miles behind (personal feeling). I am considering to use it for my pet projects

Re:Bun v1.0.0 by Jarred on Friday September 08, 2023 @05:38PM (#37439745)
bun repl was a last-minute hack we added. All it does is "bun x bun-repl" which is currently not an official thing.

The repl is about to be added and rewritten completely

Re:Bun v1.0.0 by MatthiasPortzel on Friday September 08, 2023 @06:27PM (#37440110)
I’m a little surprised they announced 1.0 already. When I tried bun a little while ago, I noticed many bugs reported on GitHub around reading from standard-in and readline. I attributed it to being a pre-1.0 thing, but those bugs have not been resolved as far as I can tell.
Re:Bun v1.0.0 by Jarred on Friday September 08, 2023 @07:22PM (#37440516)
What issues are you running into? We added support for setRawMode in Bun v0.8 (a month ago) and that addressed many issues with stdin and readline.
Re:Bun v1.0.0 by whalesalad on Friday September 08, 2023 @07:47PM (#37440706)
The port being in use is user error not really fair to put that on bun.
Re:Bun v1.0.0 by frutiger on Saturday September 09, 2023 @12:58AM (#37442433)
The following is probably not relevant for bun. But as an aside:

Most programs should bind to port 0 and let the OS allocate a free port and then report the resulting port to any future clients.

Re:Bun v1.0.0 by PoignardAzur on Saturday September 09, 2023 @06:02AM (#37443755)
It is when you're trying to run a REPL. You really shouldn't need exclusive access to a port for that.
Re:Bun v1.0.0 by ShadowBanThis01 on Friday September 08, 2023 @08:03PM (#37440836)
How is Deno "miles behind?"

I just started a new project, writing the back end. I'm new to JS and TS, and I don't want to deal with NPM and a morass of modules at all. Deno, Oak, and MariaDB seem like a pretty tidy combo. I have routes and queries up and working with no experience in writing server-side code since PHP 5.

What makes Bun better?

Re:Bun v1.0.0 by Tomuus on Saturday September 09, 2023 @12:19AM (#37442244)
1.0.0 means the API and semantics are stable, not that there are no bugs.
Re:Bun v1.0.0 by graynk on Thursday September 14, 2023 @02:02AM (#37505496)
I second this notion. I was really excited to try it out, only to have it fail to run most of our projects:

* can't use AWS SDK v3 because throws an error when parsing a response;

* can't use octokit (or anything that depends on jsonwebtoken, for that matter) because node:crypto is not fully implemented;

* can’t run our tests, because jest.resetAllMocks() is missing

* in another project, bun test failed to even run, complaining about invalid call to shared library So for me the local workflow is “run it with bun, see if it fails, re-run with node if it does”. At least I can always replace npm with it, I guess? Can’t imagine running our services with it just yet. Really excited for the future of the project, because when it works - it really is amazing. But I wouldn’t call it 1.0 if the selling feature is Node compatibility.

Re:Bun v1.0.0 by helsontaveras18 on Friday September 08, 2023 @01:32PM (#37436683)
Congrats on the launch! I have been following Bun’s journey since the beginning. Excited to make the transition once it’s got more compatibility with our Node tooling (prisma specifically).
Re:Bun v1.0.0 by dfabulich on Friday September 08, 2023 @01:49PM (#37436923)
How does Bun support CJS and ESM in the same file? Is it transpiling CJS to ESM? Or is it transpiling ESM to CJS?

ESM can use top-level await and CJS can't. So this can't possibly work, right?

    // x.mjs
    export const x = await 'x';

    // y.cjs
    console.log(require('./x.mjs').x);
And, indeed, it doesn't work in Bun. When I `bun y.cjs` it gives me this error message:

   TypeError: require() async module "/tmp/x.mjs" is unsupported. use "await import()" instead.
… but using "await import()" instead is exactly what I was trying to avoid! I can use "await import()" in Node, too.

But it looks like it does work in Bun if I drop the `await` from y.mjs. So, is it just transpiling ESM to CJS, and failing out if the ESM uses top-level await?

EDIT: I see the documentation page https://bun.sh/docs/runtime/modules has a "low-level details" section, explaining how import(CJS) works (by transpiling CJS to ESM), but it doesn't say anything there about how require(ESM) works, which is unfortunate, because that's by far the most interesting part! I've filed a doc bug on this. https://github.com/oven-sh/bun/issues/4601

Re:Bun v1.0.0 by ayewo on Friday September 08, 2023 @03:36PM (#37438370)
I believe Jarred has answered this upthread: https://news.ycombinator.com/item?id=37437848
Re:Bun v1.0.0 by flagged24 on Saturday September 09, 2023 @07:39AM (#37444237)
By dropping a major feature of ESM: top-level await.
Re:Bun v1.0.0 by makingstuffs on Friday September 08, 2023 @01:49PM (#37436926)
Just wanted to say thanks. I’ve not been as excited to tryout some new tech in a *long* time.
Re:Bun v1.0.0 by dang on Friday September 08, 2023 @02:21PM (#37437345)
Re:Bun v1.0.0 by Jarred on Friday September 08, 2023 @03:41PM (#37438440)
Thank you