Programming in assembly is brutal, beautiful, and maybe even a path to improved AI

Photo of author

By [email protected]


Roller coaster tycoon It wasn’t the hottest computer game in 1999. But if you look beneath the pixels—the rickety rides, the hungry, thirsty crowds, the butlers (and the doormen wiping their feet in their heels)—you’re deep down at the level of a computer game. codeI’ve seen the craftsmanship so obsessive that it verges on insanity. Chris Sawyer, the game’s sole developer, wrote everything in the compilation.

Some programming languages ​​such as Python Or Go or C++, they’re called “high-level” because they work sort of like human language, written in commands and jargon that might fit in a poetry slam. Generally, a program like a compiler converts this into what the machine actually reads: blocks of 1’s and 0’s (or perhaps hexadecimal) that tell the actual transistors how to behave. Assembly language, the lowest of the “low-level” languages, has close to one-to-one compatibility with the machine’s native language. It encodes directly to metal. Building a complex computer game from assembly is like weaving a tapestry from shed cat fur.

Why would anyone do this? I recently asked Sawyer, who lives in his native Scotland. Efficiency was one reason, he told me. In the 1990s, high-level programming tools were not entirely present. The compilers were very slow. Correctors sucked. Sawyer can avoid them by doing his own work in compiling x86, the common language for Intel chips.

We both knew that wasn’t the real reason. The real reason was love. Before turning to Rollercoaster, Sawyer wrote another game in the compilation, Transport pole. It puts players in charge of the city’s roads, railway stations, lanes and ports. I envisioned Sawyer as a model train hobbyist, laying every section of track, hand-stitching the artificial turf, every detail a choice and a chore. To move these carefully designed pixels from bitmaps to displays, Sawyer had to exploit the full potential of the chip. “Roller Coaster Tycoon It only happened because I was aware of the limits of what was possible.

Working within limits? Perhaps a strange idea in this age of digital abundance, when calling a single function in… Amnesty International The training algorithm can involve a million GPUs. With compilation, you get one thing and one thing only, which is the thing you ask for, even as many programmers have learned the hard way, if it’s wrong. The assembly is brutal and beautiful that way. It requires you to say exactly what you mean.

I have done the assembly Harmful creators. They wanted things to be easier, not harder. I imagine they’re tired of loading up punch cards and flipping switches on their giant steampunk beasts. Maybe they dreamed of a world like ours, where computers could do a lot with minimal guidance.



https://media.wired.com/photos/68e6c45f693f7ce213ae491f/191:100/w_1280,c_limit/MR%20011%20'Assembly%20Codes'.jpg

Source link

Leave a Comment