4 ms·
I’ve been decompiling for the past (almost) two years, and it’s fun to see the bugs, compiler quirks, programmer superstitions, things that coincidentally work
by jonhohle 8mo ago
I’ve been decompiling for the past (almost) two years, and it’s fun to see the bugs, compiler quirks, programmer superstitions, things that coincidentally work because of compiler behavior not because of correctness, as well as the things modern tooling would have caught that 30-year old versions of GCC hadn’t gotten around to yet.
There were even things I thought I had to manually optimize in the early 2000s that the GCC optimizer was already taking care of in the mid-90s.
- WalterGR 8mo agoHave you written about your discoveries anywhere? They sound pretty interesting.
- thesuitonym 8mo agoHow can you tell the difference between something manually optimized and something automatically optimized?
- Philpax 8mo agoThere's not really an exact science to it, but manually-optimised code is usually more structured/systematic to make it easier for the human author to manage the dependencies and state across the board, while automatically-optimised code is free to arrange things however it would like. As an example of the kinds of optimisations that the best human programmers were doing before compilers took over, see Michael Abrash's Black Book: https://www.phatcode.net/res/224/files/html/index.html https://www.phatcode.net/res/224/files/html/index.html - you can intuit how a human might organise their code to make the most of these while still keeping it maintainable.
- deleted 8mo ago[deleted]