News for hackers. Stuff that matters.
Re:Rust Weird Expressions by estebank on Friday May 14, 2021 @12:49PM (#27156439)
Genuine question, is iterator invalidation still a problem that people can hit with modern C++ constructs? A quick search seems to answer "yes"[1], but I'm not involved in writing C++ to evaluate what the common mitigations are.

For what is worth, I believe that 99% of what you can express in one language you can in the other. If you're hitting walls with the borrow checker when writing Rust you always have the options of either using the equivalents of unique_ptr<T> and shared_ptr<T>, or of cloning memory.

> A Rust compiler bug could expose you to a memory fault, in the same way that a C++ library bug could; but the compiler is well exercised and tested, much as is is a mature library.

I'm not sure what this sentence was expressing, but it seems you're implying here that rustc isn't well exercised and tested?

[1]: https://medium.com/@lightcone/iterator-invalidation-in-moder...

Re:Rust Weird Expressions by ncmncm on Friday May 14, 2021 @01:01PM (#27156595)
Iterator invalidation, like pointer invalidation, remains a thing. Iterators and pointers are normally treated as ephemeral, except where guarantees are provided.

It is hard for me to imagine how "the compiler is well exercised and tested" could be perceived to mean the opposite. Explain?

Re:Rust Weird Expressions by estebank on Friday May 14, 2021 @01:25PM (#27157026)
> It is hard for me to imagine how "the compiler is well exercised and tested" could be perceived to mean the opposite. Explain?

I misread it as talking about modern c++ compilers and libraries being well exercised and tested, and contrasting that with rustc.