In 1843 someone published a step-by-step method for a machine to carry out a calculation — now widely seen as the first algorithm ever written for a machine. The machine did not exist, was never built, and at the time the word “computer” still meant a person doing sums by hand.

The someone was Ada Lovelace, an English mathematician who worked with the inventor Charles Babbage. Babbage had designed a device he called the Analytical Engine, a general-purpose calculating machine meant to be programmed with punched cards. Only a small part of it was ever built. What survives is not the machine but Lovelace’s writing about it, and that writing turned out to matter more than anyone at the time could have guessed.

A translation that became something else

Lovelace did not set out to write the founding document of software. Her task was a translation. In 1842 the Italian mathematician Luigi Menabrea had published a French account of Babbage’s engine, and Lovelace turned it into English. Then she kept going. She added seven notes of her own, labelled A to G, roughly three times the length of the paper she was translating.

Her commentary swallowed the original. The published work ran to sixty-six pages, and most of what people read it for today was Lovelace’s own addition. She was not just summarising Babbage’s machine. She was working out what it could and could not do.

Note G and the Bernoulli numbers

The last note, Note G, is the one historians point to. It lays out how the engine could compute the Bernoulli numbers, a sequence of values where each one is built from the ones before it. Lovelace’s table walks through every operation the engine would need, in order, to produce those values. That table is often described as the first published computer program.

There is a fair quibble about what to call it. The table is closer to a hand-worked trace of the calculation than to a modern program, since the real “program” in Babbage’s design was the deck of punched cards. But Lovelace was clear about her aim. Her stated “object is not simplicity or facility of computation, but the illustration of the powers of the engine”. She was trying to show what the machine was for, not do arithmetic quickly. 

Who really wrote it

The word “first” is where the argument starts. Some historians point out that Babbage had written unpublished programs of his own well before Lovelace’s Notes: Allan Bromley noted that  “All but one of the programs cited in her notes had been prepared by Babbage from three to seven years earlier”, and more recent archival work has catalogued 26 code fragments he sketched between 1836 and 1840. 

Not everyone reads it as a close call. The scientist Stephen Wolfram, in his 2016 book Idea Makers, argues that “there’s nothing as sophisticated—or as clean—as Ada’s computation of the Bernoulli numbers. Babbage certainly helped and commented on Ada’s work, but she was definitely the driver of it.” In Wolfram’s reading, the Notes contain “a clear exposition of the abstract operation of the machine—something which Babbage never did”. Other historians take the opposite view, so this remains a live debate.

The part that aged best

The dispute over the algorithm is real, but it may not be where Lovelace’s foresight truly lives. Her more durable insight sits in a quieter passage, and it is not about arithmetic at all.

Lovelace saw that a machine built to handle numbers was not, at heart, limited to numbers. It handled symbols, and numbers were only one thing symbols could stand for. She described the engine as something that “weaves algebraical patterns just as the Jacquard loom weaves flowers and leaves”. From there she made a leap that still reads as startling. If the relationships between musical notes could be written down as symbols, she suggested, then “the fundamental relations of pitched sounds in the science of harmony and of musical composition were susceptible of such expression and adaptations, the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent.”

This was speculation, not proof. The engine was never built, and nothing she wrote shows it would have composed anything. But the principle behind the guess is exactly the one that computing would later deliver. Anything you can write down as a system of symbols, a machine can work on. Music, once written as symbols, is fair game. So is language, and so is an image. That is the idea that turned a calculating machine into a general one.

She was also careful about the limits. Lovelace held that “the Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform.” It was her opinion, offered cautiously about a machine that did not yet exist.

What lasts is the reach of the vision against how little evidence she had. Lovelace, working from a machine that existed only on paper, named the thing that would make computers general: once you can write a subject down in symbols, the machine stops caring whether those symbols mean numbers or notes.