News for hackers. Stuff that matters.
Re:Thread Safety Analysis in Clang by nurettin on Wednesday March 29, 2017 @01:00AM (#13983544)
So is this a Rust killer?
Re:Thread Safety Analysis in Clang by wyldfire on Wednesday March 29, 2017 @09:48AM (#13986138)
Rust 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

Re:Thread Safety Analysis in Clang by rurban on Wednesday March 29, 2017 @02:07AM (#13983829)
Why 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.

Re:Thread Safety Analysis in Clang by adrianN on Wednesday March 29, 2017 @04:25AM (#13984345)
> Rust doesn't have concurrency capabilities

https://doc.rust-lang.org/book/concurrency.html

[dead]
Re:Thread Safety Analysis in Clang by stymaar on Wednesday March 29, 2017 @01:33PM (#13988636)
> 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...

Re:Thread Safety Analysis in Clang by sctb on Thursday March 30, 2017 @02:31PM (#13997749)
> 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.

Re:Thread Safety Analysis in Clang by steveklabnik on Wednesday March 29, 2017 @12:37PM (#13987980)
> 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.

Re:Thread Safety Analysis in Clang by KenanSulayman on Wednesday March 29, 2017 @08:39AM (#13985461)
wat