News for hackers. Stuff that matters.
Re:Bun v1.0.0 by padjo on Friday September 08, 2023 @12:09PM (#37435497)
Looks great but the fact that it uses zig which is pre 1.0 and describes itself “not for use in production” gives me pause.

Realistically how much of a problem is this likely to be?

Re:Bun v1.0.0 by shawabawa3 on Friday September 08, 2023 @12:34PM (#37435868)
I guarantee zig is 100x more production ready than 99% of the 4 million nested dependencies included in the average js project
Re:Bun v1.0.0 by nonethewiser on Friday September 08, 2023 @12:58PM (#37436199)
Node or Deno dependencies would be a fairer comparison.
Re:Bun v1.0.0 by vntx on Friday September 08, 2023 @12:59PM (#37436210)
Wow, that many guarantees should persuade me to base my tech stack on Bun and Zig.

Seriously, I think this question is worth asking. Why was Zig chosen as the language when it’s not even stable, and what implications does this have for the long term viability of the project (besides the fact that its _fast_)? Zig’s head guy isn’t even sure when Zig will hit v.1.0, and Bun’s head guy hasn’t really responded either AFAIK.

Re:Bun v1.0.0 by jeroenhd on Friday September 08, 2023 @01:34PM (#37436707)
Zig is fast, promising, compatible with existing C libraries, and relatively barebones. The language itself may not be ready for production, but the binaries built in the language work just fine.

If Zig dies tomorrow, bun could probably continue using it as-is, perhaps after fixing the bugs they encounter. It's "the API and language spec isn't complete yet" unstable, not "we haven't implemented floating point operations yet" unstable. So far, only the allocalypse has caused major grief in terms of language changes, as far as I know.

Re:Bun v1.0.0 by nusaru on Friday September 08, 2023 @02:54PM (#37437809)
What does "allocalypse" mean here? Were memory allocations in Zig less explicit in the past?
Re:Bun v1.0.0 by hiccuphippo on Friday September 08, 2023 @06:57PM (#37440319)
No, they changed the allocator API so everyone had to update their code, here's the story:

https://pithlessly.github.io/allocgate.html

Re:Bun v1.0.0 by omginternets on Friday September 08, 2023 @03:55PM (#37438598)
>The language itself may not be ready for production, but the binaries built in the language work just fine.

Why is it not ready for production if the binaries work just fine?

Re:Bun v1.0.0 by sroussey on Friday September 08, 2023 @06:09PM (#37439974)
Because they may yet still change the language spec.
Re:Bun v1.0.0 by jeroenhd on Saturday September 09, 2023 @12:56AM (#37442426)
Because an update to the compiler could come out next week that completely alters the language. If you're developing a product in this language, you'll need to put significant effort into keeping it up to date, and any dependencies you've downloaded in source form may not work on the most recent compiler.

In one such change, all *Allocator parameters were turned into Allocator parameters (not the missing *). That meant rewriting tons of function bodies and signatures, because passing specific allocators around is one of Zig's strengths. The compiled binaries came out just fine, but every major Zig component needed refactoring from one compiler version to the next.

Re:Bun v1.0.0 by warent on Friday September 08, 2023 @01:15PM (#37436427)
it's possible that they chose Zig if this started as an unpaid passion project, and it simply sounded the most interesting to them.

Demonstrably by this 1.0 bun release it seems safe to say it ended up being a fine decision, no?

Re:Bun v1.0.0 by afavour on Friday September 08, 2023 @02:32PM (#37437519)
> Demonstrably by this 1.0 bun release it seems safe to say it ended up being a fine decision, no?

That’s just a decision they’ve made themselves. I honestly think it’s an interesting question: can software built on a <1.0 base legitimately call itself 1.0? What if there are big underlying issues discovered within Zig?

Re:Bun v1.0.0 by pseg134 on Friday September 08, 2023 @03:07PM (#37437983)
Well sure, it can legitimately call itself anything. You are wondering if Bun’s standards for 1.0 match up with the standards for 1.0 that you have in your head, but of course only you can answer that.
Re:Bun v1.0.0 by rockorager on Friday September 08, 2023 @04:41PM (#37439129)
I don't see why not. 1.0 would mean the API isn't changing. And they can certainly swap out the language and still keep the API the same.
Re:Bun v1.0.0 by 2c2c2c on Friday September 08, 2023 @03:11PM (#37438024)
they probably figure the developer velocity gained from using it over c++/rust is worth possibly having to make large refactors if a feature in the language is removed.
Re:Bun v1.0.0 by petabytes on Saturday September 09, 2023 @02:51AM (#37442881)
I tried to compile a hello world template for Zig a few months ago. Pulled it from GitHub, zig build and it gave an error. The problem? They recently redesigned a major part of the build system and deprecated old functions. No deprecated message, and no backwards compatibility. Just a plain old undefined function error.

That's what I don't like about these modern languages. You have to be in the community and keep up with the latest releases in order to use the language. I just want something that's stable. I don't want to keep relearning everything.

Re:Bun v1.0.0 by dgb23 on Friday September 08, 2023 @12:48PM (#37436066)
> Realistically how much of a problem is this likely to be?

It is a very young language with momentum and a foundation behind it. I'm not aware of any pre 1.0 stability guarantees.

In fact it is generally recommended to use the nightly release (see: https://ziglang.org/learn/getting-started/) because they are moving quickly.

Definitely seems to be in a early adopters and tinkerers phase.

Re:Bun v1.0.0 by postalrat on Friday September 08, 2023 @09:23PM (#37441261)
Calm down Gramps. People have moved on. Rust is yesterday's technology.