3 ms·
No, i think he's suggesting knowledge understanding and science as a whole depend on observable side effects. For example, i have a program that does in fact pr
by jfoutz 17y ago
No, i think he's suggesting knowledge understanding and science as a whole depend on observable side effects. For example, i have a program that does in fact provide a counter example to fermat's last theorem. Unfortunately it does not print the result.
If you deny observable side effects as a requirement, you must accept that i do have a program that does that.
Most cs curriculums cover propositional logic. if you recall the truth table for implication, the false case always evaluates to true. my instructor used to call it the "who cares" case.
If you don't demand a witness for the proposition, the compiler is under no obligation to provide one.
- barrkel 17y agoI find it somewhat difficult to believe we're having this conversation in any seriousness. Consider this program fragment: for (;;) /* do nothing */; destroy_the_world(); /* has side-effects */ Would you say that a compiler that removed the loop changed the side-effects of the program?
- _delirium 17y agoYes, but in what vaguely reasonable circumstances would you write dead code whose deadness depends on the fact that an infinite loop precedes it? The fact that the C standard doesn't consider changing termination properties from nonterminating to terminating to be an impermissible optimization seems reasonably practical. The only thing I can guess at would be something in embedded-land that's using nonterminating loops as some sort of control-flow construct.
- barrkel 17y agoReasonable has nothing much to do with it, IMO; and I'm not really talking about C (it is only an example), but about compiler optimizers.
- buster 17y agoIn the end, this only means the following: - The C spec permits this behaviour, the Java Spec doesn't - as a programmer, know the language and the spec that you use The destroying_world() example only shows that the programmer needs to know the language he is using. The optimization is in my opinion practical and reasonable in most cases. Every programmer that depends his program workflow and important decisions on the termination of an infinite loop should be bitch slapped to hell. Do you have another more reasonable example? The only example for the infinite loop i can think of is the eventloop of some network code. But i fail to see where any code over a few lines doesn't have any side effects.
- jfoutz 17y agoYou're absolutely right. Strict evaluation requires proof of termination. I should never comment right before bed.