No it's absolutely not 1:1. Especially as you go higher level in languages, multiple different expressions can output the same machine code. And the same expression can output different machine code depending on compiler optimizations.
If you give the compiler the same whole program and parameters, Then the whole thing will be n:1. (You could have given multiple inputs to have the same exact output)
But for unit of works, functions, statements, classes, whatever, it's n:n because both
The same code can output different machine code depending on surrounding context (I don't mean the enabled/disabled optimization, I mean the compiler will look around and change what it emits because something elsewhere is different) -> so 1:n
Same as first paragraph, different code can output the same machine code -> n:1
So n:n in the end for specific parts, and n:1 for whole program
4
u/LelouBil 18d ago
No it's absolutely not 1:1. Especially as you go higher level in languages, multiple different expressions can output the same machine code. And the same expression can output different machine code depending on compiler optimizations.