Culture / Development / Technology

Programming and Model Railroads

11 Apr 2021 6:00am, by

Why are some programmers fascinated by model railroading? A mechanical technology from the 19th century has somehow remained a powerful totem in the culture of programmers throughout the decades.

Several have noted the resemblance of miniature model train layouts to a programmable system, delighting once more in the fact that no matter how far we’ve come, our modern insights can still mingle with our memories of mighty engines from long ago. Even as the world of model trains, like programming itself, is transformed by ever more sophisticated tools, logical brains keep solving the new challenges that arise.

While working as a part-time programmer, I’ve dreamed about building my own high-tech model train set — and it turns out I’m not the only one. Last month the New York Times reported that several model train makers were seeing a jump in sales during the pandemic. “For many people, the chance to create a separate, better world in the living room — with stunning mountains, tiny chugging locomotives and communities of inch-high people where no one needs a mask — is hard to resist,” the newspaper speculated. One Swedish high school teacher gushed that his train set was “a little piece of a perfect world.”

The Times also noticed that miniature train sets from Märklin, the 162-year-old German maker of electric train parts, are now fitted with some very modern technology. Tiny speakers play authentic sounds of train whistles and chugging engines. There are tiny electric lights on both the outside and inside of cars, and model locomotives even spew real steam. The trains can all be controlled through a phone app, a computer console, or even with software that simulates the display of a real-world train engineer.

The proprietor of the company’s museum calls it “a traditional toy that through digital functions, like sound and light, has become more and more like a real train.”

With cutting-edge technology, there’s now literally no limit to what can be modeled. One model railroading site notes that some enthusiasts now even use 3D printers to generate models of virtually anything they can dream up.

Connected by History

But the ongoing culture of programming itself has a long-standing connection to train sets that began in the 1950s at MIT’s Tech Model Railroad Club. Steven Levy remembers in his 1984 book “Hackers: Heroes of the Computer Revolution” all those young techies of the 1950s who’d reverently tended The System, a controlling array of wires and relays under the club’s model railroad layout that was “something like a collaboration between Rube Goldberg and Wernher von Braun.”

They’d had their own slang words, including one term that was ultimately handed down through the ages. “A project undertaken or a product built not solely to fulfill some constructive goal, but with some wild pleasure taken in mere involvement, was called a ‘hack’… There was serious respect implied… [I]t would be understood that, to qualify as a hack, the feat must be imbued with innovation, style, and technical virtuosity…

“The most productive people working on Signals and Power called themselves ‘hackers’ with great pride.'”

Their interest in model railroading technology eventually led them to a new subculture growing around MIT’s new IBM 704 mainframe and the $3 million TX-O (one of the world’s first transistor-powered computers) — and they brought the word “hacker” along with them.

An IBM 704 - circa 1957 - 1514px-IBM_Electronic_Data_Processing_Machine_-_GPN-2000-001881 by NASA via Wikipedia

This transfer of cultures was commemorated, among other places, in The Jargon File, an influential compendium of terms from technical culture that circulated online for over a decade (later re-published in 1991 and edited by future Open Source advocate Eric S. Raymond as “The New Hacker’s Dictionary.) And it remembers that the club also may have had a hand in the popularity of the word “foo.” By 1962 the layout had included power-cutting “scram” switches to be used in emergencies — and also an early digital clock. “When someone hit a scram switch the clock stopped and the display was replaced with the word `FOO’; at TMRC the scram switches are therefore called ‘foo switches’…”

“Almost the entire staff of what later became the MIT AI Lab was involved with TMRC, and the word spread from there.”

Technical Toys

Green_Building_-_MIT,_Cambridge,_MA_-_DSC05589 - by Daderot via WikipediaMIT’s model railroading club is still active to this day, now boasting a “fully computer-controlled” layout that uses circuit boards designed by the club’s members, tracking the location of trains (which it can map onto a graphic display) and even measuring their speed, determining whether the way is clear using software programs — and appropriately turning the miniature signal lights from red to yellow to green.

Their layout includes a plywood/lumber model of the real-world Green Building on the M.I.T. campus, one of the largest buildings in Cambridge, perfectly scaled to match the model railroad’s size (using the actual plans of the original builder, which they’d checked out from M.I.T.’s archives). Although, unlike its real-world counterpart, this model building also lets you play Tetris with the lights shining through its miniature windows, thanks to a set of internal circuit boards.

In 2012 this ultimately inspired what may be the most ambitious “hack” in MIT history, when the windows of the actual, real-world Green Building were themselves finally converted into a giant game of Tetris.

It’s not the only time that programmers have found themselves influenced by the world of model railroading. In fact, it was software controlling model trains that helped establish the legal enforceability of open source licenses in 2009 (including the right to seek redress for copyright violations). It was a closely-watched case (in which the global nonprofit Creative Commons filed an amicus brief) where a programmer/train enthusiast argued their software had been bundled into a competing proprietary project — and ultimately received a settlement of $100,000.

And an artist’s collective in Vienna once even built a model they called “the Turing train terminal,” a functioning Turing machine using model train tracks and a miniature locomotive, where track-switching junctions ultimately capture the states needed for calculations. “The operating system of this reckoning worm is the ultimate universal calculator, the Turing machine, and is able to calculate whatever is capable of being calculated.”

The basic concept of a computational train set was first proposed in a 1994 research paper, and later written up in a column in Scientific American. The basic principles are laid out on the “Turing Trains” website, which shows how the parts of a calculation can be mapped onto train switches.

The fascination continues to this day. This month Scott Aaronson, a theoretical computer scientist at the University of Texas at Austin, attempted something similar with a train set he’d bought for his four-year-old son Daniel, ultimately resulting in a blog post titled “The Computational Expressiveness of a Model Train Set: A Paperlet.”

One YouTube video even shows a simple Lego Duplo set used to implement a “computational train track” that counts up to the number 111 in binary.

Ultimately train sets offer logical brains a fresh venue in which to play. “I have a lot of fun applying my electrical engineering and computer systems experience to model trains,” one enthusiast gushed on a model railroading blog, showing off the N-scale train set they’d hidden under a panel in a coffee table. An app on their tablet computer controls things in the tiny town — including lights on the crossing, buildings and vehicles. There’s even a miniature drive-in movie screen playing a real movie:

And for a final feat of amazement, small cameras transmit the view from the cab of the train’s engine — or from a miniature car’s window on a street in the layout.

Maybe it’s all proof that model railroading, like technology itself, is always constantly advancing. And there’s something comforting in knowing that as our powerful technologies evolve — they’re also allowing us to build better and better model trains.

Feature Image par jggrz de Pixabay

A newsletter digest of the week’s most important stories & analyses.