4 ms·
So is this a Rust killer?
by nurettin 10y ago
So is this a Rust killer?
- rurban 10y agoWhy Rust? Rust doesn't have concurrency capabilities. ponylang has. But like Rust it needs mutexes and errors with wrong or missing mutexes. So in this regard it's equal to Rust.
- adrianN 10y ago> Rust doesn't have concurrency capabilities https://doc.rust-lang.org/book/concurrency.html https://doc.rust-lang.org/book/concurrency.html
- rurban 10y agoOh my, those rusters, still downvoting what they have no idea about. So why do have to manually mutex or semaphore your threads? This is not a type system with concurrency capabilities is meant for. At least parrot and pony do away without that nonsense, guaranteed lock-free.
- steveklabnik 10y ago> still downvoting what they have no idea about. What specifically do people not have an idea about? > So why do have to manually mutex or semaphore your threads? You don't _have_ to, but it is an option. Rust, as a low-level language, provides a number of options for dealing with concurrency. Frankly, I wrote that chapter above and in a hurry; it's my least favorite out of the whole book. Rust can prove a lack of data-races at compile time, which is a big deal.
- stymaar 10y ago> So why do have to manually mutex or semaphore your threads? This is not a type system with concurrency capabilities is meant for. You don't have to use mutex ! The Rust type system has two traits to ensure thread-safety : Send and Sync, and you can safely use anything which implement those traits. Mutex is one easy way to have these capabilities, but it's not the only one. You can build your own thread-safe data structure if you want, or even use third-party ones like crossbeam[1]. The compiler will then ensure that you never use non-thread-safe objects accross threads. > At least parrot and pony do away without that nonsense. What is parrot ? I've read about pony but not parrot, and Google isn't helping. [1] : https://github.com/crossbeam-rs/crossbeam/blob/master/README.md https://github.com/crossbeam-rs/crossbeam/blob/master/README...
- sctb 10y ago> Oh my, those rusters, still downvoting what they have no idea about. Please don't include these sorts of things in comments. They're worse than unnecessary: they take us further away from the kinds of thoughtful, civil discussions we're after.
- KenanSulayman 10y agowat
- wyldfire 10y agoRust is lots of things, not the least of which includes static guarantees of safety, including safe concurrent memory usage. If you asked them, I'd bet the C++ design team would admit lots of faults in the language design. Some of those are due to a need to preserve compatibility with C and older C++ code. Some are just lessons learned as the language grows and finds new uses. Others are because computers used for software development and targets on which binaries would execute were very different from computers today. I think there's a case for looking back and asking "if we were to invent a language like C or C++ today, knowing what we know now, what would it look like?" I don't think that Rust's origin quite spawned from that, but it certainly looks like it fits that bill. This particular feature is yet-another-static-analysis-addendum-to-C++. It's a great complement to TSan. But IMO if there were ever something in this vein that could be considered "a Rust killer" it would have been TSan. No one likes going back and annotating their code. People can barely be bothered to make a new build target with "-fsanitize=thread". /signed: rust evangelism strike force