in reply to Re^16: Why is the execution order of subexpressions undefined?
in thread Why is the execution order of subexpressions undefined?
It simply isn't enough to say "Don't write expression that could have EODs, because already, it is near impossible to know when even a single, apparently non-lvalue expression could involve sideeffects.But this is one of the hard problems because of Turing-Completeness/Halting-Problem. What we'd really like to do is outlaw those expressions in the first place. But if the compiler was smart enough to recognize all of those instances, then there are also programs that would cause the compiler to never finish executing :-(
And, if you explictly define an order of evaluation for everything, then of course you won't gain anything through parallelization (because everything has to be executed sequentially, by definition).
You should really check into Haskell, no side-effects to screw up things.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |