News for hackers. Stuff that matters.
Re:Bun 1.0 announcement [video] by j-pb on Thursday September 07, 2023 @01:54PM (#37422894)
Despite the 1.0 release tag, given that it's written in Zig, which is super duper Alpha, I'd trust it only as far as I can throw a floppy with its source code.
Re:Bun 1.0 announcement [video] by gfodor on Thursday September 07, 2023 @02:17PM (#37423272)
Fascinating, do you have literally any evidence whatsoever that this project doesn't work or isn't realiable?
Re:Bun 1.0 announcement [video] by KolmogorovComp on Thursday September 07, 2023 @03:06PM (#37424002)
A project can only be as reliable as its compiler. Zig currently suffers from a number of miscompilation [0] that is quite higher than for a more mature compiler.

[0]: https://github.com/ziglang/zig/issues?q=is%3Aopen+is%3Aissue...

Re:Bun 1.0 announcement [video] by wdb on Thursday September 07, 2023 @06:10PM (#37426289)
That would mean you can't use LLVM either. Similar issues exists there: https://github.com/llvm/llvm-project/labels/miscompilation
Re:Bun 1.0 announcement [video] by computing on Thursday September 07, 2023 @07:18PM (#37427009)
this is the most HN thread ever
Re:Bun 1.0 announcement [video] by Thaxll on Thursday September 07, 2023 @02:32PM (#37423510)
For the end user it does not matters though it's kind of a detail of implementation.
Re:Bun 1.0 announcement [video] by j-pb on Thursday September 07, 2023 @05:23PM (#37425794)
It matters plenty if your production system goes down because of bugs caused by miscompilation of your js runtime. This level of instability doesn't uphold the social contract that a 1.0 implies.
Re:Bun 1.0 announcement [video] by bottlepalm on Thursday September 07, 2023 @08:32PM (#37427700)
It does worry me as a potential adopter of Bun what the long term outlook of the project is if the language used to write Bun isn't very accessible to prospective open source contributors.
Re:Bun 1.0 announcement [video] by AndyKelley on Thursday September 07, 2023 @09:22PM (#37428108)
You seem to be implying that zig is not open source or is otherwise unfriendly to contributions...?

It's a 501(c)(3) non profit and has been open source since `git init`. Even the financials are transparent to the public. What else could we possibly do?

Re:Bun 1.0 announcement [video] by bottlepalm on Thursday September 07, 2023 @10:23PM (#37428471)
Zig being a language that most people are not familiar with is a very high barrier of entry in it of itself.

Given how few projects are written in it, the ROI of learning it is not that great.

I'm not 'against' Zig, it's just basic Lindy effect stuff. People don't want to build or invest in a foundation and then left hung out to dry.

Just like the rest of my development choices, I try to take calculated risk so that the platforms I'm building on have a high chance of lasting into the future.

We all know that a rewrite due to obsolescence can be the death knell for a project.

Re:Bun 1.0 announcement [video] by rhodysurf on Friday September 08, 2023 @05:39AM (#37431540)
I’ve used zig for like a week total in my life and during that time I had a PR accepted to the main repo. It’s very much friendly to contributors.
Re:Bun 1.0 announcement [video] by bottlepalm on Friday September 08, 2023 @11:31AM (#37434900)
I’m not saying they’re not friendly, I’m just saying learning a new language for probably the single purpose of contributing to this repo is a pretty high barrier of entry for contributors. It is great you overcame it.
Re:Bun 1.0 announcement [video] by 59nadir on Friday September 08, 2023 @12:57PM (#37436194)
Learning Zig is a very low barrier to entry. From experience I can tell you that learning the language is a matter of weeks and most of the code in the wild will be very accessible to you once you've done that, because there aren't as many different plateaus of skill in Zig as you would find in many other languages.

For many people reading and modifying the `bun` source code is likely something they could start doing tomorrow if they were so inclined, because they already know the semantics of Zig for the most part, and it's only a question of syntax.

Re:Bun 1.0 announcement [video] by mekster on Saturday September 09, 2023 @01:07AM (#37442464)
And who has extra weeks that aren't students?
Re:Bun 1.0 announcement [video] by ricardodevelop on Saturday September 09, 2023 @03:01AM (#37442916)
Plenty of people. Otherwise open source wouldn't exist.
Re:Bun 1.0 announcement [video] by 59nadir on Saturday September 09, 2023 @06:23AM (#37443841)
I don't know what to tell you. I don't know many languages that have a shorter on-ramp than Zig (or Odin). The obvious relevant language here would be Go, but Go wouldn't be as desirable in terms of producing as good results in a confident way; Zig (and Odin) is a lot easier to spot performance deficiencies in.

If your argument is somehow that Rust, C++, Nim, D or some other alternative would do better in terms of on-ramping I can only shake my head and move on with my day, as they are all clearly much more complicated languages and they all happen to produce code that is much harder to understand from a performance perspective. If the argument is something even higher level and even more opaque in terms of performance-related behavior I think you've missed an important part of why Bun chose Zig.

In most cases that don't involve "I already know this language" the equation can never be much better than "You have to learn Zig/Odin". For every person that already knows the language in question there's a bunch that don't, and the only solution to that is quick on-ramping because it'll benefit everyone over time. It doesn't matter whether you know the language already if the language is mostly trivial to learn, read and use.

P.S.: If the argument is that C would be a better choice I don't disagree as wildly as I do with any of the other situations. C with custom allocators and a ton of static analysis added to it will be mostly fine, but both Odin and Zig provide great things on top of C in terms of basic language features without taking on too much complexity.

Re:Bun 1.0 announcement [video] by nifty_beaks on Thursday September 07, 2023 @01:58PM (#37422945)
I completely forgot it was written in Zig. Thanks for the heads up. I completely agree, I don't see how this can be labeled 1.0 release.
Re:Bun 1.0 announcement [video] by math_dandy on Thursday September 07, 2023 @02:47PM (#37423709)
I see it as a commitment to keep the public API stable.
Re:Bun 1.0 announcement [video] by bobbylarrybobby on Thursday September 07, 2023 @03:43PM (#37424536)
If they don't change the public API, they could rewrite it in Fortran for all I care.
Re:Bun 1.0 announcement [video] by j-pb on Thursday September 07, 2023 @05:23PM (#37425807)
Fortran would at least have a reliable compiler.
Re:Bun 1.0 announcement [video] by dudus on Thursday September 07, 2023 @02:19PM (#37423308)
Why would it matter to you as a user, which language it was used before it was compiled to the machine code you run?
Re:Bun 1.0 announcement [video] by bryancoxwell on Thursday September 07, 2023 @02:36PM (#37423563)
Changes to Zig could force changes to Bun, and changes to Zig are all but guaranteed.
Re:Bun 1.0 announcement [video] by generichuman on Thursday September 07, 2023 @02:46PM (#37423698)
It could force changes to Bun _internals_, which doesn't really affect users if the Bun team does not want to break API.
Re:Bun 1.0 announcement [video] by aledue on Thursday September 07, 2023 @03:26PM (#37424302)
Changes to Zig can still be very significant. I found myself stuck between a rock and an hard place when I found out that:

- Zig v0.11 doesn't have async/await, which I needed, because they haven't implemented it yet on the self-hosted compiler;

- I couldn't use v0.10 due to some bugs with comptime in the old compiler, which are solved in v0.11.

Still, while bold, I don't think it's totally unwarranted to tag Bun 1.0. They may have to put some extra effort here and there to work around the language's instability.

This is not a critique of the Zig team, they make it very clear that the language is not ready for production use yet.

Re:Bun 1.0 announcement [video] by bryancoxwell on Thursday September 07, 2023 @02:51PM (#37423787)
I’m just not sure how you guarantee no changes to the API without knowing the size or scope of changes that may come to the language it’s built on.
Re:Bun 1.0 announcement [video] by slotrans on Thursday September 07, 2023 @03:28PM (#37424342)
As an example, Java does just fine at guaranteeing its own semantics completely independently of what happens to C++.
Re:Bun 1.0 announcement [video] by gingerrr on Thursday September 07, 2023 @03:40PM (#37424503)
True, though you can't claim that's an analogous situation - C++ wasn't in alpha when the JVM was implemented.

Decoupling is of course possible, but the difference here is that the lang powering the runtime is not guaranteed to remain the same language it currently is, since it's in active initial development. That introduces a unique axis of risk to runtime stability, it's dishonest to pretend otherwise.

Re:Bun 1.0 announcement [video] by pseg134 on Thursday September 07, 2023 @05:04PM (#37425576)
Well sure if you start adding more conditionals and change the original question you can call anyone who answered the original question in good faith a liar.
Re:Bun 1.0 announcement [video] by gingerrr on Thursday September 07, 2023 @09:03PM (#37427934)
That's not what happened here. If you have difficulty keeping context of the thread we're all in, scroll up and reread. Snarking (and being wrong to boot) contributes nothing to the discussion.
Re:Bun 1.0 announcement [video] by naikrovek on Thursday September 07, 2023 @09:30PM (#37428160)
are you saying that zig is currently turing complete and that in the future it might not be? because that's the only thing that could force a change to what is possible in the language.

the internals of bun may need to change when a new version of zig requires it, and the bun developers decide to use that version of zig, but existing versions of zig will continue to exist in the future.

future versions of bun can use existing turing complete versions of Zig if they ever decide to remove turing completeness from the language in the future.

lol

Re:Bun 1.0 announcement [video] by j-pb on Thursday September 07, 2023 @05:19PM (#37425755)
Because the compiler is extremely unfinished and buggy.

With a codebase this size theres a real chance of having miscompilations in there.

What's the points of running a safe language on broken infrastructure, it's garbage in garbage out.

And with Zigs recent plans to replace llvm with their own backend I'm not even sure if they won't continue scope creeping into vapourware.

Re:Bun 1.0 announcement [video] by conradev on Thursday September 07, 2023 @10:46PM (#37428604)
That's like saying data centers shouldn't use slightly faster CPUs because they aren't tested yet.

You burn those CPUs in. You run them a bunch. Measure them. Measure their efficiency gains. If the gains are real, make a plan for scaling them up. Have fallback plans. The usual stuff. If a company has someone that does this as their job, they're on it.

If Bun affected your source code or development process, I would understand this perspective. Maybe don't use Bun-specific APIs yet, and just stick with the Node compatibility.

Re:Bun 1.0 announcement [video] by c-hendricks on Thursday September 07, 2023 @02:14PM (#37423221)
I'd imagine a floppy would fly quite far when thrown like a frisbee tho
Re:Bun 1.0 announcement [video] by Matthias247 on Friday September 08, 2023 @12:25AM (#37429303)
I don't have any opinion on Bun itself. But as someone who is pretty experienced in running large scale services, I wouldn't have a problem to use a tool that is marked as stable but internally built on top of unstable tools. As long as compilation is mostly deterministic (which is usually given for compilers), a good set of unit and integration tests should prove that the software is actually doing what its supposed to do and can be trusted with workloads. If those tests are not available, then even using a mature language might not provide a guarantee that the actual product is better.

Sure - the Bun developers might have a super hard time if Zig changes its syntax, library APIs or other things. But that would be a maintenance hassle for the Bun developers, and not necessarily for the Bun users.