50 karma · joined Jan 30, 2020 (6y ago) · 27 submissions
comment 5y ago · link · parent
If I'm not mistaken, this is not true. The compiler is still allowed to elide reads and writes on atomic variables. (For example merge two consecutive writes, or remove unused reads)
comment 6y ago · link · parent
The cxx crate and the autocxx tool should make sure that the exposed C++ functions only take arguments types which have well defined semantics.
In your example, a rust Box<T> maps to a rust::Box<T> in C++, which cannot be null. And a unique_ptr from C++ maps to a cxx::UniquePtr in rust which can be empty.
If somehow the C++ code puts a dangling or null pointer into a rust::Box, that is clearly a bug in the C++ code.
comment 6y ago · link · parent
No need to write 'unsafe' because .cpp files are already known to need carefull review.
comment 6y ago · link · parent
They'd be confronted with basic question from the audience: Why would things fall down if it was not the center? (That was before Newton) Wouldn't we see paralax in the stars (stars are much further away than what was believed at the time). Wouldn't we feel it if earth turns so fast? "Maybe that explains the tides" said Galileo (but it doesn't)
The previous model was also explaining the observations quite well at the time. Why should we care for another theory? (God works in mysterious ways.)
I'm not saying that MOND is correct. ("they also laughed at Bozo the Clown".) Just that the fact that there are some unexplained missing piece does not mean one should reject it so quickly.
comment 6y ago · link · parent
comment 6y ago · link · parent
comment 6y ago · link · parent
comment 6y ago · link · parent
Given the description from the article:
> Suppose you're on a game show, > and you're given the choice of > three doors: Behind one door is > a car; behind the others, goats. > You pick a door, say No. 1, and > the host, who knows what's behind > the doors, opens another door, > say No. 3, which has a goat. He > then says to you, "Do you want > to pick door No. 2?" Is it to > your advantage to switch your > choice?
I'd say, no, it is not to my advantage because I'd think the host would only ask me to switch if I had taken the "right" choice and want to make me lose. Unless I knew that the host always ask if one wants to change, in which case the paradox indeed apply.
comment 6y ago · link · parent
Otherwise, as a host, I would only offer the players to change if they picked the car. (And if they heard about this paradox before, they might even change their choice)