Live data from Hacker News

Zig → Rust porting guide

github.com

461–470 of 592 posts

Re: Zig → Rust porting guide

#461
post #20

Earlier quoted context omitted.

Lots of people, me included, heavily invested their time and expertise into Bun, using it as a daily driver, to bundle production code or even using it in production as a JS/TS runtime. Of course, we are interested in Bun to stay a useful tool. The Anthropic acquisition was worrying enough on its own.

But there isn't any change in someone's expertise in Bun though, currently, just in development. Why would they have to dive you into a daily stand-up about their development process?

Bun may become unusable after Antropic meddling with it. In that case the expertise would be wasted. It's not a great deal for most of users, but still.

Re: Zig → Rust porting guide

#462
post #454

Earlier quoted context omitted.

The title is "Bun is being ported from Zig to Rust". The docs/PORTING.MD starts with "Zig → Rust porting guide" I don't think the tone was the problem.

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.

Re: Zig → Rust porting guide

#463

Earlier quoted context omitted.

When you start getting hate, you’ve made it. Up until then you’re a hypothetical that people like. Maybe they’ve built a side project with you or read the docs. You only get hate when people have used your tool and butted up against limitations. We saw this with Deno too where they went from beloved potential savior to realistic, limited tool. Hate is good. It means people rely on you

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…

It’s a reasonable expectation from a clearly successful and competent engineer who is using the latest tooling.

Who is to say that it’s wrong?

Re: Zig → Rust porting guide

#464

Earlier quoted context omitted.

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

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 the Rust compiler and by multiple orders of magnitudes.

Re: Zig → Rust porting guide

#465

Earlier quoted context omitted.

One non-obvious reason is that an important aspect of their community is to shepherd new contributors [1]. LLMs crushing everything would reduce that. More obvious is all the toil for maintainers dealing with LLM PRs (broadly it’s an issue). The Zig maintainers prefer to put their energy into improving people and fostering those relationship. [1] https://kristoff.it/blog/contributor-poker-and-ai/

It's important that developers have an accurate mental model of how things work, are structured and why. LLMs promote a decoupling of mental models and the actual codebase. As much as some may want to believe, just reviewing what the LLM outputs is not equivalent to thinking about implementation details, motivations, exactly how and why things are, and how and why they work the way they do, and then writing it yourse…

Exactly. This is what many ai-sloppers ignore. Mental models are crucial. Nothing substitutes for having the program itself in your brain and being able to "mentally debug" it when something breaks.

Re: Zig → Rust porting guide

#466

Earlier quoted context omitted.

Anthropic just needs to buy Zig! Problem solved.

Perfect A/B experiment opportunity. Fork Zig, call the fork Zag. Lock the syntax/api together for a couple of years. Allow AI code in Zag. Review after a few years, see which is better.

last zig fork didn't go so well: https://ziglang.org/news/statement-regarding-zen-programming...

Re: Zig → Rust porting guide

#467
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…

> there was zero indication this was an experiment

  The goal of Phase A is a **draft** `.rs` next to the `.zig`
  that captures the logic faithfully — it does **not** need to compile. Phase B
  makes it compile crate-by-crate.
I mean, it would be hard to spell it out any clearer than that! Code that fails to compile is just not very useful for real work.

Re: Zig → Rust porting guide

#468
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

I couldn't use that title because I didn't know if it an experiment at the moment. Even now the correct title would be "Bun author says that he is entertaining the idea of porting it from Zig to Rust, creates an experimental branch".

But you also didn't know a port was happening, which the title implies.

Re: Zig → Rust porting guide

#469

The only Bun shipped product I've used in anger is OpenCode and I regularly run into segfaults on it. I doubt this is the reason for migration but every time it happens, it reminds me the real cost of unsafe code. That being said, Zig is an absolute pleasure to write and I can't wait until it has a real library ecosystem, Rust's greatest boon.

How do you even run it with bun? I get nodejs not found error when running opencode command in terminal. I installed it via bun too.

try `bunx --bun whateverthecommandis`?

Re: Zig → Rust porting guide

#470

Earlier quoted context omitted.

When you start getting hate, you’ve made it. Up until then you’re a hypothetical that people like. Maybe they’ve built a side project with you or read the docs. You only get hate when people have used your tool and butted up against limitations. We saw this with Deno too where they went from beloved potential savior to realistic, limited tool. Hate is good. It means people rely on you

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.
Post reply on HN