{"id":35087,"date":"2025-10-13T11:21:49","date_gmt":"2025-10-13T11:21:49","guid":{"rendered":"https:\/\/agooka.com\/news\/business\/programming-in-assembly-is-brutal-beautiful-and-maybe-even-a-path-to-better-ai\/"},"modified":"2025-10-13T11:21:49","modified_gmt":"2025-10-13T11:21:49","slug":"programming-in-assembly-is-brutal-beautiful-and-maybe-even-a-path-to-better-ai","status":"publish","type":"post","link":"https:\/\/agooka.com\/news\/business\/programming-in-assembly-is-brutal-beautiful-and-maybe-even-a-path-to-better-ai\/","title":{"rendered":"Programming in Assembly Is Brutal, Beautiful, and Maybe Even a Path to Better AI"},"content":{"rendered":"<p>Save StorySave this storySave StorySave this story<\/p>\n<p><em>Rollercoaster Tycoon<\/em> wasn\u2019t the most fashionable computer game out there in 1999. But if you took a look beneath the pixels\u2014the rickety rides, the crowds of hungry, thirsty, barfing people (and the janitors mopping in their wake)\u2014deep down at the level of the code, you saw craftsmanship so obsessive that it bordered on insane. Chris Sawyer, the game\u2019s sole developer, wrote the whole thing in assembly.<\/p>\n<p>Certain programming languages, like Python or Go or C++, are called \u201chigh-level\u201d because they work sort of like human language, written in commands and idioms that might fit in at a poetry slam. Generally speaking, a piece of software like a compiler transforms this into what the machine really reads: blocks of 1s and 0s (or maybe hex) that tell actual transistors how to behave. Assembly, the lowest of the \u201clow-level\u201d languages, has a near one-to-one correspondence with the machine\u2019s native tongue. It\u2019s coding straight to metal. To build a complex computer game from assembly is like weaving a tapestry from shedded cat fur.<\/p>\n<p>Why would anyone do this? I recently asked Sawyer, who lives in his native Scotland. He told me that efficiency was one reason. In the 1990s, the tools for high-level programming weren\u2019t all there. Compilers were terribly slow. Debuggers sucked. Sawyer could avoid them by doing his own thing in x86 assembly, the lingua franca of Intel chips.<\/p>\n<p>We both knew that wasn\u2019t the real reason, though. The real reason was love. Before turning to roller coasters, Sawyer had written another game in assembly, <em>Transport Tycoon<\/em>. It puts players in charge of a city\u2019s roads, rail stations, runways, and ports. I imagined Sawyer as a model-train hobbyist\u2014laying each stretch of track, hand-sewing artificial turf, each detail a choice and a chore. To move these carefully crafted pixels from bitmaps to display, Sawyer had to coax out the chip\u2019s full potential. \u201c<em>RollerCoaster Tycoon<\/em> only came about because I was familiar with the limits of what was possible,\u201d he told me.<\/p>\n<p>Working within the limits? A foreign idea, perhaps, in this age of digital abundance, when calling a single function in an AI training algorithm can engage a million GPUs. With assembly, you get one thing and one thing only, and it is the thing you ask for\u2014even, as many a coder has learned the hard way, if it is wrong. Assembly is brutal and beautiful that way. It requires you to say exactly what you mean.<\/p>\n<p>I\u2019ve done assembly\u2019s creators a disservice. They wanted things to be easier, not harder. I imagine they were tired of loading up punchcards and flipping switches on their steampunk leviathans. Perhaps they dreamed of a world like ours, where computers can do so much with such minimal guidance.<\/p>\n<p>The first assembly language, created in the 1940s by Kathleen Booth (though she has not always gotten her due, surprise surprise), hardly resembled language. Codes stood in for codes. To tell the machine to perform an operation\u2014say, \u201c0,0111\u201d in machine code\u2014you\u2019d instead employ a series of letters and symbols, which a new piece of software, called an assembler, would translate into binary. Soon, the commands got human-\u00adfriendlier mnemonics like \u201cMOV.\u201d<\/p>\n<p>To know assembly was to know the CPU itself\u2014what it could do and, even more, what it couldn\u2019t. A chip\u2019s physical design, how the circuits connecting the logic gates of AND and XOR are actually laid, defines how it works. Its functions are pretty basic, breaking down instructions into elementary steps: Fetch something from memory and put it in a temporary cubby, known as a register. Decode it there. Perform some operations, like comparing two values, or adding them. Ship it back off the memory.<\/p>\n<p>As chips advanced, new dialects of assembly evolved. The code that landed the first human on the moon was assembly\u2014designed for only one chip, the Apollo 11 Guidance Computer. If you want to read the leaked source code of the Furby, you\u2019ll need fluency in 6502. To hack your Ti-83 calculator, you\u2019ll need z80. Learning the language of one chip\u2014say, Intel\u2019s x86\u2014and then moving to Arm is like studying Arabic in Beirut and then trying to get by in Tunis or Khartoum. Good luck.<\/p>\n<p>I learned x86 assembly in college as a refugee from math. Where my classmates seemed to enjoy the drab incantations of Java, I loved the logic game that was assembly. It was easy to fail, but to fail in ways that were explainable if you looked at the circuits and registers. How masterful I felt coding in the simple commands of this not-quite-language; how fragile I knew that mastery to be. To say, put these bytes there\u2014no, there, at that register, in those capacitors. Remember this. Forget that. To grind away, painting each figurine, one by one.<\/p>\n<p>It\u2019s true that there\u2019s no longer much point in using assembly in the day-to-day work of coding. High-level languages are so efficient that their abstraction is almost always preferable. Even assembly\u2019s inventor moved on to other ventures; one of Booth\u2019s final papers, in the 1990s, used neural networks to match seals with their barks. Sawyer switched over too. He\u2019s been dabbling in home automation recently\u2014lights, temperature sensors, sound systems, and the like, coded on Raspberry Pis using Python, which he initially found \u201cquite off-putting,\u201d he told me. But even on that tiny processor, it gets the job done just fine.<\/p>\n<p>Then along comes something like DeepSeek to remind you that humans can still communicate better with our hardware. Earlier this year, the Chinese company that made these incredibly efficient AI models upended the narrative that AI advancement can come only from more chips and more energy. Assembly was one surprising reason. DeepSeek\u2019s engineers reached into the subfloor of Nvidia\u2019s chips, commanding each individual machine to compress data from 32 bits to 8 bits\u2014sacrificing precision for efficiency\u2014at precisely the right moments. Observers were stunned. You could do that? The DeepSeek engineers had tapped an art most others had forgotten.<\/p>\n<p>I was similarly taken when, in 2023, researchers at DeepMind taught a machine x86 assembly, then asked it to improve on the long-standing sort() function in C. The AI made strange, unintuitive choices, performing odd jumps between registers, and in the end cut precisely one step. A fraction of a milli\u00adsecond saved, perhaps. But happening countless times a day, now that the new algorithm has been officially adopted.<\/p>\n<p>To me, it was a reminder that we humans created these machines, and even as they appear to spiral into complexity beyond our comprehension, they remain under our command. We can always make them work better. It was like what Sawyer said when he recounted his recent Raspberry Pi\u2013enabled home coding experiment. It was probably just his imagination, but the display had been a little laggy, he thought. He\u2019d redo the code if he could, he said. But alas, Sawyer and the machine did not speak the same assembly language.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Save StorySave this storySave StorySave this story Rollercoaster Tycoon wasn\u2019t the most fashionable computer game out there in 1999. But if you took a look beneath the pixels\u2014the rickety rides, the crowds of hungry, thirsty, barfing people (and the janitors mopping in their wake)\u2014deep down at the level of the code, you saw craftsmanship so [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":35088,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":{"0":"post-35087","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-business"},"_links":{"self":[{"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/posts\/35087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/comments?post=35087"}],"version-history":[{"count":0,"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/posts\/35087\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/media\/35088"}],"wp:attachment":[{"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/media?parent=35087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/categories?post=35087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agooka.com\/news\/wp-json\/wp\/v2\/tags?post=35087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}