News for hackers. Stuff that matters.
Re:Mrustc: a Rust compiler written in C++ by pjmlp on Friday September 22, 2017 @01:00AM (#15309492)
Ada, for example.

There is an open source version available in every system supported by gcc.

However C++17 is quite safe, provided one doesn't follow "write C with C++ compiler" idiom.

Re:Mrustc: a Rust compiler written in C++ by pcwalton on Friday September 22, 2017 @01:50AM (#15309697)
> However C++17 is quite safe, provided one doesn't follow "write C with C++ compiler" idiom.

No, it's not. There is no use-after-free protection among other things. It doesn't matter how much you write code like C or not: it's just not safe.

Re:Mrustc: a Rust compiler written in C++ by pjmlp on Friday September 22, 2017 @02:33AM (#15309855)
Then better stop using LLVM on Rust.

Until then, those comments only annoy those of us that happen to like Rust, but don't find it mature enough to replace C++ on the use cases we happen to care about.

Re:Mrustc: a Rust compiler written in C++ by pcwalton on Friday September 22, 2017 @03:21AM (#15310055)
I didn't say you can't write useful software in C++. I said that C++ software is not, in general, memory safe. Sometimes the benefits of a particular piece of software (for example, having an excellent production-grade optimizer) outweigh its drawbacks (for example, not being memory-safe).

I don't think you'd find a single LLVM developer who would claim that LLVM is memory safe. Giving invalid IR to LLVM and not running the verifier frequently segfaults it, for example...

Re:Mrustc: a Rust compiler written in C++ by pjmlp on Friday September 22, 2017 @04:02AM (#15310208)
I do agree with that, but that is exactly why I always mention the "C with C++ compiler" idiom, which is usually followed by your remark.
Re:Mrustc: a Rust compiler written in C++ by rtpg on Friday September 22, 2017 @02:05AM (#15309750)
safety is a spectrum, I think declaring it unsafe entirely might not be conducive to more interesting points