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.
[0]: https://github.com/ziglang/zig/issues?q=is%3Aopen+is%3Aissue...
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?
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.
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.
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.
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.
- 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.
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
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.
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.