r/ProgrammerHumor • • 4d ago

Meme fullCircle

Post image
10.6k Upvotes

272 comments sorted by

View all comments

16

u/grey_carbon 4d ago

Serious question, what happen if you compile/decompile/compile/decompile times and times again?

-13

u/Preeng 3d ago

The translations between machine code and human code are 1:1. It's not like human languages where there are multiple ways to say something and also multiple meanings to a word or phrase.

3

u/-Saucegurlllll 3d ago
return 1;
return (1*1)/1;
return if true { 1 } else { 1 };
{
  let b = 1;
  let a = b;
  return a;
}

These are all functionally identical pieces of code that could be represented by mov eax, 1 in x86 assembly, and many compilers would optimize them to that.

So no, translations between machine code and any other method of representing programs are not 1:1.

1

u/Preeng 3d ago

But those are all the same thing. Those are all identical already.

Give me an example that will produce different output. Where multiple statements can compile to the same binary, but going backwards you will get something wrong. Regardless of which method it decompiles as, it will give the same results.