Remix.run Logo
dayvster 3 days ago

this is an excellent example do you mind if I examine it a bit closer and perhaps use it in my article?

K0nserv 3 days ago | parent [-]

Yes of course, although, as I said in a sibling comment, it's a bit convoluted as an example. The fundamental problem is that the xor mutable and shared reference rule gets in your way when you access separate fields through &self and &mut self even if the borrows are non-overlapping.

There has been discussion to solve this particular problem[0].

0: https://github.com/rust-lang/rfcs/issues/1215

minraws 3 days ago | parent [-]

That RFC and Polonius, which Rust folks have been working on for the last 5-6 years is proof that there has been much effort made in related directions.

Rust being sub par for so long just shows how much people won't want to fund these problems and how hard they are to solve during program compile.

I ofc like Zig quite a bit but I find Rust to suit my tastes better. Zig feels too much like C with extra steps. And the lack of good tooling and stability around Zig hurts large scale adoption.

But I think in 10 years Zig will be the de facto better-ish C.

And Rust will be the low level language for any large project where safety is amongst the top 3 priorities.

K0nserv 3 days ago | parent [-]

The problems Rust are trying to solve are both novel and difficult so it isn't particularly surprising that it's taking time. The team has also landed great improvements, like NLL. I'm optimistic about the direction of this, even if it takes time.

Zig feels much younger than Rust so we'll see how it develops, but it's certainly interesting. In particular, comptime and explicit allocators are two ideas I hope Rust borrow more from Zig.

> And Rust will be the low level language for any large project where safety is amongst the top 3 priorities.

Personally I don't really see what'd be left for Zig, because in most software of consequence safety is already a top 3 priority.