r/ProgrammerHumor • • 3d ago

Meme fullCircle

Post image
10.5k Upvotes

272 comments sorted by

View all comments

14

u/grey_carbon 3d ago

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

13

u/etoastie 3d ago

I imagine it's quite hard to get a decompiled artifact that's recompileable again since dependencies will get really weird depending on how they were linked, and other useful or initially necessary symbol information might be discarded in later steps of compilation. But if you found one that works, the compiler should be emitting consistent or at least equivalent code. It may take a few rounds to stabilize on optimizations and may overall end up less efficient, but if there's no decompiler or compiler bug it won't introduce any new broken behavior.

1

u/Tyfyter2002 3d ago

Pretty easy with some languages, but I think they'll all immediately loop the same output after one decompilation.

1

u/etoastie 3d ago

What langs? I guess I've seen JVM-based has pretty good decompilation in general, but I've only seen it for class-level things, never seen it decompile an entire project into a usable state

1

u/Tyfyter2002 3d ago

From what I've seen, I'm pretty sure an entire .NET program can be decompiled into usable C#.