Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on libretechni.ca

16 replies

Fun fact: After Anthropic rewrote Bun in Rust, Zig's lead developer stated that they used Bun as an example of how not to write Zig code. So, the answer is that is always did.

90

Because of the names, your comment sounds utterly ridiculous to someone who has never heard of Bun or Zig.

Source: someone who has never heard of Bun or Zig.

59
mamg22reply
sh.itjust.works

So they rewrote poor Zig code into what probably is even poorer Rust code, and from what I've seen, using their AI to do it. Yeah, that sounds like they're getting a fully functional and non-buggy piece of software.

22
Ghoelianreply
piefed.social

And they're initially doing it without Rust's memory safety borrow checker iirc, so a big part of the benefit isn't there

7

Unsafe Rust code doesn't turn off the borrow checker, it basically just allows you to play with pointers and call code that the compiler can't (or can't right now) statically assert is sound. IE if you roll your own Vtable the functions are safe to call, but the compiler can't tell so you have to use unsafe

7

Ok this is funny. Like "look bro, we rewrote bun in Rust because it's ✨Safe✨ and all that", and they're not even trying lmao

In all seriousness, part of that issue probably comes from the original code already ignoring the safety features of Zig, and whatever LLM they used to port it just doing the most half-assed thing and doing a literal translation of the code.

The future of software development, ladies and gentlemen

::: spoiler Edit: rust safety Yes I know unsafe in rust doesn't mean unsafe code, it just that the compiler trusts you to correctly use the interfaces and references since it won't check them inside such blocks :::

2

I mean, Bun itself serves a language that should not exist

2
Jackreply
slrpnk.net

They haven't had a release after the rewrite, I doubt they will have one soon.

17

Even better, they used to release twice a month (minimum), it's been 4 months now.

12
lemmy.world

Does this mean that half of all the repos on GitHub will soon disappear?

15

You reached the end

you should have gone for the head | Spyke