News for hackers. Stuff that matters.
Re:When Zig is safer and faster than Rust by ok123456 on Tuesday March 07, 2023 @02:01PM (#35059601)
The core language is fine, but when you actually start building things you need to introduce lifetimes, all the traits that you polluted your interface with and then add on async, it gets out-of-hand quickly.
Re:When Zig is safer and faster than Rust by dimitrios1 on Tuesday March 07, 2023 @02:23PM (#35059913)
The top comment gave a perfect example: #![feature(strict_provenance)]

These feature enablement blocks drive me crazy. You could go from codebase to codebase and it's almost like you are working in a different language depending on how many of these are enabled or not. I've been trying rust on and off since it's release, and I still have yet to feel like I have a grasp on some "core" subset of the language I can fall back on to solve most of my problems. I always have to scour documentation for the hot new thing to turn on or do, and this isn't to scorn innovation and change, but it does get exhausting at some point.

(Please release a spec)

Re:When Zig is safer and faster than Rust by satvikpendem on Tuesday March 07, 2023 @02:30PM (#35060004)
Those feature blocks exist only for nightly/unstable Rust. You don't have those on stable Rust. The most you might have are derive blocks but those just automate what you'd write by hand anyway.
Re:When Zig is safer and faster than Rust by maxbond on Tuesday March 07, 2023 @03:11PM (#35060512)
The tooling helps a lot. If you do use something that's behind a feature gate, you'll find out in real time in your IDE, and from there you can either automatically insert the feature or you can immediately choose to use a different method. You won't have to deal with it an hour later when you've already used it in 6 places, or something like that. I haven't found it to be a big problem, personally.

The API documentation of the central data types (Option, Result, Vec, etc) is more of less your toolkit, and they're pretty cohesive (eg they all have a `map()` method, Result and Option both have an `or()` method, etc).

Spec would be excellent, of course.

Re:When Zig is safer and faster than Rust by Rusky on Tuesday March 07, 2023 @03:32PM (#35060799)
A spec is not a replacement for #![feature] attributes. It's rather the opposite: #![feature] indicates that you are stepping out of the stable, specified core language and into an area that is still a work in progress and thus cannot have a committed specification yet. You shouldn't need it at all unless you are actively experimenting with some unfinished proposal.
Re:When Zig is safer and faster than Rust by kaba0 on Tuesday March 07, 2023 @04:09PM (#35061251)
I think it is just inherent complexity in the low-level space.

(Though I do agree that Rust definitely moves fast, which is sort of understandable as a relatively newish language)