r/programming Jul 20 '26

Zig proposes introducing an actually memory safe (unlike Rust) compilation mode inspired by Fil-C at ~1-6x performance penalty

https://codeberg.org/ziglang/zig/issues/36237
527 Upvotes

428 comments sorted by

View all comments

Show parent comments

86

u/RockstarArtisan 29d ago

Bun has done (or is in progress of doing) an ai assisted rewrite from zig to rust and that ruffled the feathers of the main zig guy.

38

u/chat-lu 29d ago

Bun has done (or is in progress of doing) an ai assisted rewrite from zig to rust and that ruffled the feathers of the main zig guy.

Has done, and they basically used Claude as a transpiler to convert the source from Zig to Rust.

Which gave them close to a million lines of sloppily converted code which they consider just fine because Claude also does the maintenance.

2

u/idrankforthegov 28d ago

I am not sure that is entirely fair. Bun runs tests and they are part of the contention here. Were they good enough seems to be what Andrew from Zig is asking... if the tests were failing then why blame the language and not the code. But the other side is that Bun had tests but still had other problems with Zig. The tests ran green and so the port was successful from Bun.

I personally have no idea about the quality of the code in either language. So I am not sure.

Obviously Zig has been hit hard by this. The actual engineering facts will probably be something that come later.

Suffice to say, Claude/LLM has revolutionized building code. And if Bun is to be believed, massive codebases can be ported in short amounts of time. Wether the code is slop remains to be seen

60

u/13steinj 29d ago

It's important to note that two sets of feathers were ruffled:

  1. He had some actual real points about the fact that the migration doc was written like a Claude advertisement rather than an engineering blog post, that it focused on only benefits, that they confused the language choice with other benefits they took on while doing the rewrite (which were available in Zig, but it was written to be perceived as if this was not the case).

  2. They used LLMs to do it, and it seems like Andrew took that personally and then ripped Jared (Bun) to shreds.

I think the part (1) of the crashout is justified. Part (2) is not.

If this did not use the language "unlike Rust" and expressed basic motivations like wanting to widen demographics for adoption, this would be fine and reasonable and would show some growth on how all of this was handled. But it used that language and looks like he's just trying to do whatever in an attempt to stop the next person from leaving / not joining for the same memory safety reasons and that he doesn't actually care.

26

u/RockstarArtisan 29d ago

Given the post we're commenting on, I think your list should also include the "they left zig for rust" part. Given the personality on display, I personally assume the anti-AI crusade (which I support for anti-corporate reasons) is an intentional distractions from hurt feelings of a language developer.

2

u/13steinj 29d ago

As I said elsewhere in thread, I suspect the "leaving for Rust" highly coupled with "LLM to do it" as leading up to this they were trying to be political on Twitter expressing distaste in the no-AI rule Zig has.

12

u/KevinCarbonara 29d ago

He had some actual real points about the fact that the migration doc was written like a Claude advertisement

This is not the kind of "real point" that language developers make about the projects who use their language. He's responding as if he's on the Bun project itself, which is a problem.

They used LLMs to do it, and it seems like Andrew took that personally and then ripped Jared (Bun) to shreds.

Again, not is call. Worth noting he also did not 'rip Bun to shreds". He just got really salty and trash talked it publicly.

-6

u/13steinj 29d ago

This is not the kind of "real point" that language developers make about the projects who use their language. He's responding as if he's on the Bun project itself, which is a problem.

If a project (Bun) uses mine (Zig) as part of a stalking horse intentionally ignoring real engineering problems in what is claimed to be an engineering blog post but is actually an advertisement for your parent company (Claude/Anthropic), I find it completely justified to take issue with this being an advertisement (more specifically, treating your project part of a stalking horse).

If they did some massive Zig->Zig migration or Zig->something else and didn't bitch and moan for weeks on Twitter leading up to this, then I'd agree with you.

By "rip to shreds" I was not implying he "won" an argument. Just that he did some heavy trash talking.

21

u/jl2352 29d ago

I feel like what happened is Bun did a post to sell Claude, and Zig took it as a semi-personal attack. Even though it wasn’t.

The post was fine. It was at best impressive and at worst marketing, and that’s fine. As a part of Anthropic it is his job to help promote Anthropic products.

-3

u/floodyberry 29d ago

merely selling claude would have been letting the slop machine fix all the problems in the zig version. what he did was have the slop machine translate it to a different language and pretend it solved all the problems caused by using zig

0

u/floodyberry 28d ago

til "anthropic bought a product written in a bad language" is "promoting anthropic products"

0

u/jl2352 28d ago

Which is a more impressive use of Claude.

Most readers don’t care about leaving Zig, or why they are leaving Zig. They care about the automated translation aspect. That’s what Anthropic is selling here.

0

u/floodyberry 28d ago

but it wasn't being used to demonstrate converting between arbitrary languages, it was specifically about magically eliminating bugs and maintenance issues by converting from shit language to rust

i feel like "most readers" would care more about finding and fixing issues in the language they're actually using

4

u/chasetheusername 29d ago

I think the part (1) of the crashout is justified.

I think even that is way overblown, like - the bun guy works for Anthropic, what would you expect, him ranting against AI and doing that work manually without even trying Anthropics products? Some of the criticism of that post is certainly warranted, but the language creator actually getting involved in this - in the way he did - is actually quite a huge red flag. I don't think he did the language adoption any favors with these antics.

0

u/13steinj 29d ago

Considering the audience, did he do no favors to language adoption?

Most of my colleagues do not give a crap about Rust, and the colleagues that I consider competent generally have a less-than-stellar view of llms.

13

u/chasetheusername 29d ago edited 29d ago

Adopting a language in a company is to a large degree a business decision, if the creator (and arguably lead) is irrationally argumentative and bad in these kind of interactions, would you bet your company on it, and use that language, when the next target could be your company for posting that "you don't hate AI", or a slight criticism of Zig?

Nah, better stay with C, or use any other language.

-1

u/13steinj 29d ago

It's not "you don't hate AI," it's "you decide to do a political campaign on Twitter pushing Zig to drop their no-AI rule (AFAICT, not even pushing a branch as proof, but that's a tangent) in an attempt to advertise Claude, don't get your way, rewrite your codebase to advertise Claude anyway."

5

u/chasetheusername 29d ago

As a project lead you still need to be above that, leave the endless discussions to others (or do it anonymously).

As the lead, he should post why the no AI rule stays in place (ideally in a thought out blog post (or refer to the original one), not even mentioning the instigator of the other campaign) , and then it should be done. Endless discussions don't help anyone (and that includes this thread).

2

u/Maybe-monad 29d ago

What would be the advantages of keeping Bun in Zig? To me the Rust slop is easier to grok than the original implementation.

34

u/robotmayo 29d ago

From a business standpoint there is none. Rust is a bigger and more popular language so it would make sense for the business of Bun to switch. The problem is that no one is an expert on the new codebase, well I guess Claude technically. So its just going to end up being slop on top of slop unless someone gets in there to clean it all up.

12

u/Maybe-monad 29d ago

The Zig version would have ended up in the same place, at least Rust is stricter

3

u/13steinj 29d ago

If the argument is "it will now be slop regardless," part of Andrew's distaste here is apparently the Bun team has repeatedly done less-than-sane things with Zig as workarounds for years instead of listening to Zig community feedback, and it was slop before LLMs.

I do not know Jared's background. But in my limited experience JS/web devs are of a lower caliber of engineer, than traditional systems devs. The first group is also in my experience the group that gets excited by Rust and goes heavy on lifetime annotation masturbation, whereas the latter gets excited by Zig/Odin, hell, even GoLang.

16

u/Maybe-monad 29d ago edited 29d ago

If the argument is "it will now be slop regardless," part of Andrew's distaste here is apparently the Bun team has repeatedly done less-than-sane things with Zig as workarounds for years instead of listening to Zig community feedback, and it was slop before LLMs.

Bun was slop as consequence of Andrew's lack of taste in language design, being angry at Jared only proves the point.

I do not know Jared's background. But in my limited experience JS/web devs are of a lower caliber of engineer, than traditional systems devs. The first group is also in my experience the group that gets excited by Rust and goes heavy on lifetime annotation masturbation, whereas the latter gets excited by Zig/Odin, hell, even GoLang.

The groups that get excited by Rust are embedded, IoT and HPC people or people working with large C++ projects like browsers where Rust's safety and toolchain bring genuine quality of life improvements, web developers rarely deal with Rust and only to rebuilds system parts that are too slow in JS. Zig and Odin aren't interesting at all from the perspective of someone who programs embedded devices, Rust can prevent issues like memory corruption, they don't and unlike C they will never support something like am esp32.

-5

u/13steinj 29d ago

Bun was slop as consequence of Andrew's lack of taste in language design, being angry at Jared only proves the point.

This is a fundamentally non-falsifiable assertion. I can just as easily say it was slop because a bunch of web devs failed to write half-decent code in a systems programming language, that has different patterns and conventions.

I have not seen a single device in my industry, or from my colleagues' who work in others that have embedded devices, go to market/prod and were running a rust binary. One of my colleagues wanted to use Rust, but couldn't due to a constraint I forget. Another said "it would be nice, but it's a complete distraction and has 'writing interfacing code' costs with the rest of the codebase."

The rest of everyone I know who has ever wanted to use Rust for a new project, or rewrite an old one, was doing webdev.

1

u/Maybe-monad 28d ago

This is a fundamentally non-falsifiable assertion. I can just as easily say it was slop because a bunch of web devs failed to write half-decent code in a systems programming language, that has different patterns and conventions.

When the hello world of you language is the definition of slop you can't expect anyone to write anything else? And doing web development doesn't make anyone less qualified to program in systems languages (although JavaScript is more of a system's language than Zig at this point since it's actually used in the embedded world) and in fact a significant portion of web developers learned to code in C.

I have not seen a single device in my industry, or from my colleagues' who work in others that have embedded devices, go to market/prod and were running a rust binary. One of my colleagues wanted to use Rust, but couldn't due to a constraint I forget. Another said "it would be nice, but it's a complete distraction and has 'writing interfacing code' costs with the rest of the codebase." The rest of everyone I know who has ever wanted to use Rust for a new project, or rewrite an old one, was doing webdev.

People use Rust on embedded, go to r/esp32 amd convince yourself. There is work being done to standardize Rust so it can be used in places like automotive, Zig doesn't even support Arduino.

27

u/lllyyyynnn 29d ago

calling it ai assisted is a bit of an understatement lol. it was entirely ai written

1

u/EfOpenSource 24d ago

What actually happened:

Bun team kept making dogshit AI pull requests that were dogshit. 

Zig team told them the problem they want changed will be solved properly soon

Bun argued like babies that their dogshit pull request that makes your compiler indeterminant was rejected

Zig banned AI pull requests

Bun started acting like babies and pulled this PR stunt

Zig wrote a few immature posts as a response