Live data from Hacker News

Zig → Rust porting guide

github.com

471–480 of 592 posts

Re: Zig → Rust porting guide

#471

Earlier quoted context omitted.

Not only because the AI part, here's a discussion [0] about it [0] https://ziggit.dev/t/bun-s-zig-fork-got-4x-faster-compilatio...

In the context of this post, that's absolutely hilarious they're vibe-porting their Zig codebase to Rust . I love Rust, but you couldn't pick a language with slower compile times... XD

[deleted]

Re: Zig → Rust porting guide

#472
post #319

I work on Bun and this is my branch This whole thread is an overreaction. 302 comments about code that does not work. We haven’t committed to rewriting. There’s a very high chance all this code gets thrown out completely. I’m curious to see what a working version of this looks, what it feels like, how it performs and if/how hard it’d be to get it to pass Bun’s test suite and be maintainable. I’d like to be able to co…

Will you have a way to measure the ecological impact it has to make such a throw away attempt?

Not actually pointing on you or anyone in particular here to be clear. And if the answer would be "not much more than forgetting the light when leaving the toilets", certainly that would be a "go have fun" cheerleading on my part.

But otherwise we collectively have to keep in mind that the prompt that we can throw mindlessly and without perceiving any direct negative feedback are possibly not anodyne.

So if you can measure it, come back also with these numbers so we can all take that into consideration next time the thrill to run it just to see what happens rise in our mind. Thanks.

Re: Zig → Rust porting guide

#473

Earlier quoted context omitted.

Presumably they aren't falling for their (extremely obvious) "grassroots" marketing, and know, like any good engineer, that LLMs are not the right tool for this. It's easy to just see Bun as a marketing stunt, as well.

> that LLMs are not the right tool for this. Claude Code itself is already heavily written by LLMs[0], so I'm not sure what's "this" here. You mean LLMs are okay for writing code but not porting? [0]: No, it's not just marketing. The codebase was leaked and anyone who glanced at it would realize the claim is likely true.

You missed the point of the question: why write Bun in Rust when CC itself can be written in Rust ostensibly for even better perf.

Re: Zig → Rust porting guide

#474

Earlier quoted context omitted.

Compiling Rust is actually quite fast in my experience. The problem with many Rust projects is that they pull in dependencies left, right, and center. Pulling in Tokio makes your project compile an entire thread management system even if you're just compiling Hello World, and simple oneliners containing macros can easily spread out into dozens of lines of code each. Linking is also slow, and the extreme amounts of me…

That's true, but then there's also the case of working on the zig compiler which is roughly a million loc, and with `--watch -fincremental` you can get 200ms recompile even if you change some of the most called function. Meanwhile even a 5k-10k rust project can take a 30s to recompile on minor changes. So the impact on velocity can be quite high, I love both languages, but the Zig compiler is undeniably faster than t…

Rust also has incremental compiling and is pretty fast, I haven't experienced 30 second compile times when using cargo watch. See also, cranelift, which is supposed to make compile times even faster.

Re: Zig → Rust porting guide

#475
post #454

Earlier quoted context omitted.

Imaging title it "Bun is being ported from Zig to Rust in an experimental branch" though. Not enough drama with that

The branch name is "claude/phase-a-port", there was zero indication this was an experiment until Jarred commented. The more accurate title might have simply been "there is a branch in the official repo of bun describing a port to rust from zig". No amount of soft titles would have prevented the discussion. People have their opinions about Bun, about Zig, about Rust and it's all going to come out in a discussion board…

Can’t every branch be considered an experiment? I have a ton of experimental branches that I don’t label «experimental». One of the reasons you use git…

Re: Zig → Rust porting guide

#476

Earlier quoted context omitted.

> that LLMs are not the right tool for this. Claude Code itself is already heavily written by LLMs[0], so I'm not sure what's "this" here. You mean LLMs are okay for writing code but not porting? [0]: No, it's not just marketing. The codebase was leaked and anyone who glanced at it would realize the claim is likely true.

You missed the point of the question: why write Bun in Rust when CC itself can be written in Rust ostensibly for even better perf.

Are you replying to the wrong comment? I clearly quoted which part I were replying to. I didn't attempt to answer the question "why write Bun in Rust when CC itself can be written in Rust."

What I said is that "they know that LLMs are not the right tool for this" is not the answer, as CC is already vibecoded so it'd be very weird to believe you can't vibecode a port of CC.

The actual answer is, of course, the whole discussion is just making a hill out of a mole. Bun is not committed to a Rust rewriting, vibed or not.

Re: Zig → Rust porting guide

#477

Earlier quoted context omitted.

It is a pity that you can't make an experimental commit on an experimental branch without igniting a fire of delirium through some people who -- if they were able to put their emotional response aside for a minute and could weigh this up on the basis of merit -- would probably agree with the motivations for researching this approach. > if/how hard it’d be to get it to pass Bun’s test suite and be maintainable Every m…

This is what it means to work on a popular project, unfortunately.

You also don't have a duty to read or respond to the social media flames. Just do the work you want to do.

If people get worked up about experimentation, that's their problem, not yours.

Re: Zig → Rust porting guide

#478
post #319

I work on Bun and this is my branch This whole thread is an overreaction. 302 comments about code that does not work. We haven’t committed to rewriting. There’s a very high chance all this code gets thrown out completely. I’m curious to see what a working version of this looks, what it feels like, how it performs and if/how hard it’d be to get it to pass Bun’s test suite and be maintainable. I’d like to be able to co…

Thank you, Jarred, for your work. It’s unfortunate to see so much backlash toward legitimate research. Bun is often seen by some as “the flagship project for zig” - especially among those frustrated with rust who want zig to "win over rust" for whatever reasons. At the end of the day, you should do what makes the most sense for your project and your circumstances, regardless of the language or tools involved. Persona…

>who want zig to "win over rust" for whatever reasons

I don't understand why this mentality is so common. Zig and Rust are both fine languages with markedly different design goals and they can coexist.

Re: Zig → Rust porting guide

#479

Earlier quoted context omitted.

What do you mean with that in this context?

That the incentives have changed after being bought by Anthropic. So don't be surprised by a sudden change of heart.

Change of heart about what?

Sorry if I’m being pedantic, but I’m not aware of Bun having made any statements about AI assisted coding before.

Re: Zig → Rust porting guide

#480

Earlier quoted context omitted.

Do you know which project gets the most hate? Nodejs, so in that sense, Nodejs has made it and it is widely deployed but this hate was the reason that two seperate alternatives for Node have emerged as Deno and bun. Recently Bun's latest version had memory leaks which crashed production code from my understanding and their attitude[0] of saying OSS will have no human contribution allowed, now doing these ports of zig…

Well yeah, it's in Zig, not a memory-safe language, so of course I'd expect memory leaks. That's why I haven't seriously used bun and instead use a runtime that actually is in a memory-safe language, Deno in Rust. It's like wearing roller skates without brakes and wondering why you keep running into things.

Memory safety has nothing to do with memory leaks, and it's perfectly valid to leak memory in Rust?

e.g. `Box::leak(Box::new( ... ))`

Post reply on HN