logoalt Hacker News

pjmlp • last Wednesday at 7:50 PM • 1 reply • view on HN

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.


Replies

Veserv • last Wednesday at 8:01 PM

"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.

➕ show 1 reply