News for hackers. Stuff that matters.
Re:The compiler was supposed to end programming too by pjmlp on Wednesday October 21, 2026 @03:22PM (#50186150)
Yeah, but only toy compilers don't do optimizations.
Re:The compiler was supposed to end programming too by Veserv on Wednesday October 21, 2026 @03:37PM (#50186405)
Which is a strawman. They are clearly attempting to say that a compiler is supposed to generate a program that is semantically identical to the source code.

All observable and defined side effects should be identical otherwise you have a compiler bug. Optimizations that are not generically semantics preserving may be used, but should only be used where the program is semantically identical for your use case otherwise you have incorrectly used the options available in your compiler.

Re:The compiler was supposed to end programming too by pjmlp on Wednesday October 21, 2026 @03:50PM (#50186613)
But it isn't, anything goes as long the "as if" rule is kept.

For example a JIT compiler can produce completely different kinds of machine code depending on the application data that was processed, and the overall machine workload.

Re:The compiler was supposed to end programming too by Veserv on Wednesday October 21, 2026 @04:01PM (#50186803)
"as if" is what semantically identical means. As I further clarified: "All observable and defined side effects should be identical otherwise you have a compiler bug."

The output program does what the input source code does. The abstraction is a precise translation and non-leaky, it just admits multiple possible internals. That does not make the translation any less precise.

Re:The compiler was supposed to end programming too by pjmlp on Thursday October 22, 2026 @03:22AM (#50192261)
Yes, and just like with human intelligence offshoring projects, if the delivered microservice e.g. always sends the right email content when a notification lands, no one cares about the garbage underneath.