News for hackers. Stuff that matters.
Re:Rust is more than safety by mmstick on Wednesday December 28, 2016 @04:05PM (#13273633)
Exceptions have high cost so I don't see where you are coming from. Rust's RAII goes further along than C++'s. C++ is playing a game of catchup to steal the move semantics from Rust.
Re:Rust is more than safety by olejorgenb on Wednesday December 28, 2016 @05:24PM (#13274215)
According to http://stackoverflow.com/a/13836329/1517969 modern c++ exceptions are free when no throw occurs.
Re:Rust is more than safety by mmstick on Wednesday December 28, 2016 @05:29PM (#13274240)
In addition, Rust Results/Options are free when no throw occurs. So the argument is moot.
Re:Rust is more than safety by softc on Wednesday December 28, 2016 @05:38PM (#13274285)
No they aren't, you must issue a compare instruction to verify the result was successful.
Re:Rust is more than safety by oconnor663 on Saturday January 07, 2017 @05:37PM (#13347077)
Do you know whether branch prediction makes them effectively free, in places where the result is almost always successful?
Re:Rust is more than safety by softc on Wednesday December 28, 2016 @05:28PM (#13274235)
Exception handling in C++ is absolutely zero-cost when no exception occurs. Look up the Itanium ABI. In Rust, even if no error occurs, the return value must still be checked.

Additionally, Move semantics were borrowed from C++, not the other way around.