News for hackers. Stuff that matters.
Re:Thoughts on Go vs. Rust vs. Zig by ViewTrick1002 on Thursday December 04, 2025 @06:06PM (#46154460)
It entirely prevents race conditions due to the borrow checker and safe constructs like Mutexes.

Logical race conditions and deadlocks can still happen.

Re:Thoughts on Go vs. Rust vs. Zig by kibwen on Thursday December 04, 2025 @06:19PM (#46154614)
Rust's specific claims are that safe Rust is free from data races, but not free from general race conditions, including deadlocks.
Re:Thoughts on Go vs. Rust vs. Zig by globalnode on Thursday December 04, 2025 @06:08PM (#46154488)
ah i see, thanks. i have no idea what rust code looks like but from the article it sounds like a language where you have a lot of metadata about the intended usage of a variable so the compiler can safety check. thats its trick.
Re:Thoughts on Go vs. Rust vs. Zig by timschmidt on Thursday December 04, 2025 @06:27PM (#46154725)
That's a fairly accurate idea of it. Some folks complain about Rust's syntax looking too complex, but I've found that the most significant differences between Rust and C/C++ syntax are all related to that metadata (variable types, return types, lifetimes) and that it's not only useful for the compiler, but helps me to understand what sort of data libraries and functions expect and return without having to read through the entire library or function to figure that out myself. Which obviously makes code reuse easier and faster. And similarly allows me to reason much more easily about my own code.
Re:Thoughts on Go vs. Rust vs. Zig by mh2266 on Thursday December 04, 2025 @06:43PM (#46154887)
The only thing I really found weird syntactically when learning it was the single quote for lifetimes because it looks like it’s an unmatched character literal. Other than that it’s a pretty normal curly-braces language, & comes from C++, generic constraints look like plenty of other languages.

Of course the borrow checker and when you use lifetimes can be complex to learn, especially if you’re coming from GC-land, just the language syntax isn’t really that weird.

Re:Thoughts on Go vs. Rust vs. Zig by timschmidt on Thursday December 04, 2025 @06:52PM (#46154979)
Agreed. In practice Rust feels very much like a rationalized C++ in which 30 years of cruft have been shrugged off. The core concepts have been reduced to a minimum and reinforced. The compiler error messages are wildly better. And the tooling is helpful and starts with opinionated defaults. Which all leads to the knock-on effect of the library ecosystem feeling much more modular, interoperable, and useful.
Re:Thoughts on Go vs. Rust vs. Zig by peterfirefly on Friday December 05, 2025 @11:22AM (#46163436)
It's really an ML with type classes and a better syntax (and a non-stupid module sublanguage) that also just happens to be more C-like.
Re:Thoughts on Go vs. Rust vs. Zig by TylerE on Friday December 05, 2025 @04:52AM (#46159151)
I think you’re misconstruing the argument. Those of us that dislike the rust syntax feel at least that strongly about c++. They’re both disasters.
Re:Thoughts on Go vs. Rust vs. Zig by pornel on Thursday December 04, 2025 @08:37PM (#46155849)
Thread safety metadata in Rust is surprisingly condensed! POSIX has more fine-grained MT-unsafe concepts than Rust.

Rust data types can be "Send" (can be moved to another thread) and "Sync" (multiple threads can access them at the same time). Everything else is derived from these properties (structs are Send if their fields are Send. Wrapping non-Sync data in a Mutex makes it Sync, thread::spawn() requires Send args, etc.)

Rust doesn't even reason about thread-safety of functions themselves, only the data they access, and that is sufficient if globals are required to be "Sync".