AI in business

Babbage’s Analytical Engine and Ada Lovelace – The Birth of Programming

How did Charles Babbage design the first programmable machine, and how did Ada Lovelace write the first algorithm in history? Discover the birth of programming, from Jacquard’s cards to the visionary nineteenth-century ideas that anticipated computers by 100 years.

The year is 1822. Charles Babbage, an eccentric English mathematician, sits over a stack of hand-calculated logarithm tables riddled with errors. He flies into a rage and utters a line that would become famous: “I wish to God these calculations had been executed by steam!” That sentence will change history. Babbage resolves to build a machine that calculates everything on its own: no mistakes, no fatigue, no human fallibility. He does not yet know that his design, the Analytical Engine, will become the first conceptual computer in history, more than a hundred years ahead of the silicon age.

Around 1833, Babbage drew up a far more ambitious plan. The Analytical Engine was to be a general-purpose machine, capable of executing any algorithm rather than just one kind of calculation. Its architecture bore an astonishing resemblance to a modern computer: it had a “store” (for holding data, the equivalent of RAM), a “mill” (the processing unit, the equivalent of a CPU), a mechanism for controlling the sequence of operations, and input and output devices. Instructions were to be fed in on punched cards, the very same kind used in the Jacquard loom. Babbage took his inspiration directly from the weaving invention: information encoded on pasteboard cards could control not only the threads of a fabric but also the sequence of calculations in a mechanical machine.

In 1833, Babbage invited seventeen-year-old Ada Byron, later Countess of Lovelace and the daughter of the poet Lord Byron, to a demonstration of his Difference Engine. Instead of echoing the other guests’ vague admiration, she asked sharp technical questions. Babbage was astonished. Over the following years she became his closest intellectual collaborator and came to understand the principles of the Analytical Engine in depth. In 1843 she translated from French a paper by the Italian mathematician Luigi Menabrea describing the Analytical Engine. But she did not stop at translating. She added her own notes, three times longer than the original. In them she included something Menabrea had not written and Babbage had not proposed: history’s first precise, step-by-step description of an algorithm designed for a machine. The algorithm computed Bernoulli numbers, a complex mathematical sequence. It was the first complete computer procedure ever written.

Ada Lovelace went far beyond the role of translator, or even documenter. Her notes contained insights more than a century ahead of technological thinking. First, she saw that the Analytical Engine could process not only numbers but any symbols at all, as long as they were properly encoded. That meant it could compose music, process language and carry out logical reasoning. It was a vision of the general-purpose computer, written down in 1843. Second, Ada described what we now call loops and conditional statements, the building blocks of every programming language. Her algorithm for Bernoulli numbers included jumps back to earlier steps, in other words a loop. It was the first documented algorithm with logical branching. Third, Ada wrote something prophetic: that the machine cannot originate anything of its own, cannot create anything that does not follow from the instructions it has been given. It was the first philosophical reflection on the limits of artificial intelligence, the very one Alan Turing took up in 1950 as “Lady Lovelace’s Objection.”

Babbage had started with a more modest project, the Difference Engine, which was meant to compute mathematical tables automatically using the method of finite differences. The British government agreed to fund it: the first public funding of a computing project in history. Over the years that followed, Babbage sank thousands of hours of work and thousands of pounds into it, producing precise technical drawings of a machine made up of thousands of parts. It was to weigh more than a dozen tons and calculate to 20 decimal digits. It was never finished, not for lack of ideas but for lack of technology and steady funding. Only in 1991 did engineers at the Science Museum in London, working from Babbage’s original drawings, build a working Difference Engine No. 2. It performed exactly as Babbage had designed it 150 years earlier.

Babbage spent the rest of his life trying to raise money and build the Analytical Engine. He never succeeded, not for lack of genius but for lack of technology and money. Nineteenth-century metalworking was simply not precise enough to build a machine of tens of thousands of parts to the tolerances it needed to work. Ada Lovelace, who might have become his intellectual heir, died of cancer in 1852, aged just 36. Babbage died in 1871. Their vision lay forgotten for decades. It took the Second World War, with its urgent demand for ballistic and code-breaking calculations, to bring the real leap toward electronic computing machines. Yet the architecture Babbage had designed (memory, a processor, an instruction language, input and output) was essentially the same as that of ENIAC and the Mark I. Babbage and Lovelace were true co-creators of the computer age. The world just wasn’t ready for them yet.