hn.today

Show HN: The DNA of DOOM – How code structure survives across 44 ports

squid-protocol.github.io4 points3 comments
Screenshot of Show HN: The DNA of DOOM – How code structure survives across 44 ports

A software-archaeology study examines 43 descendants of DOOM’s 1997 source release, including faithful copies, modernized engines, and translations into languages such as Go, Scheme, Fortran, and COBOL. It asks whether a program’s structure can reveal its ancestry even when names, comments, and readable code are removed. First, direct source comparisons show that function names alone are misleading: Chocolate Doom preserves 87% of DOOM’s function names but only 35% of the code inside them, while other forks retain many labels despite extensively rewriting their contents. A structural fingerprint instead measures function size, branching, inputs, and calls. Its matches are credible: 93% of detected look-alike functions are genuine copies, though the method finds only about two-thirds of all copied functions.

Structural signals also distinguish related code from unrelated C programs and reveal patterns that survive translation. With names hidden, the engine assigns functions in a Go port to the correct game subsystem 60% of the time, versus 20% by chance; scrambling the program’s call connections weakens the result. Scheme and Go retain DOOM’s inter-part wiring about as well as a straightforward C copy, while Java, Kotlin, and C# show little surviving structure. The study also finds sideways borrowing between descendants, including shared functions in display-text libraries. Its family links rely on projects’ stated histories, not inferred ancestry. The method measures code shape, not behavior, and comparisons across languages are limited: heavy reorganization or very short functions can erase detectable signals even when design influences may remain.

Read on squid-protocol.github.io3 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.