3 ms·
> Also, compilers don't reason about code the same way humans do. Not these compilers for sure. But I don't agree that all compilers are broken. > They apply
by grumpyprole 3y ago
> Also, compilers don't reason about code the same way humans do.
Not these compilers for sure. But I don't agree that all compilers are broken.
> They apply a large number of small transformations, each of these transformations is very reasonable and it is their combination that results in "absurd" optimization results.
Humans use techniques like natural deduction to apply a series of transformations that do not lead to absurd results.
- muldvarp 3y ago> Humans use techniques like natural deduction to apply a series of transformations that do not lead to absurd results. All men are immortal. Socrates is a man. Therefore, Socrates is immortal. If you were to give a group of CS students the exercise to determine whether the this deduction is valid, they would all answer yes. So no, humans that apply natural deduction can also derive absurd results. That said, I don't think all C programmers would agree that the result of that optimization is absurd in the first place.