The Ancient History of Computers and Code

  • Details
  • Text
  • Audio
  • Downloads
  • Extra Reading

What links an ancient shipwreck to the textile mills of Northern England? Both contained forerunners of the computing we use today. In fact, computer language and software have a long history, featuring military research and the repurposing of early programs widely used in manufacturing. This lecture delves into the earliest archives of processing, prediction, difference and analytical engines, to discover who really made them all work.

Download Text

The Ancient History of Computers and Code

Dr Victoria Baines, IT Livery Company Professor of IT
24 September 2024

In the last year, I have received more questions about the rise of machines than I could ever have expected. When are the killer robots taking over the world? What are the consequences of Artificial Intelligence (AI) for our jobs, our children’s education, and humanity? Is greater automation inherently good or bad, or should we be focused more on the people who misuse it? We seem to be in an unprecedented phase of technological development, a ’tipping point’ for humanity. But have we really never faced these questions or concerns before? The deeper I have delved into the research for this year’s lecture series on The Prehistory of IT, the more convinced I have become that not only is there much to learn from the past about how we got here, but also that it can help us answer the big questions we face right now.

The digital computers we use today owe their existence to largely 20th century inventions. But their heritage goes back much further. There dwell mechanical engines for predicting the movements of the heavens, humans who performed the calculations on which colonial expansion and international trade depended, and industrial devices that produced software in the 19th century. 

The world’s oldest computer (so far)
Our journey back in time begins only a little later, in 1901, when sponge divers discovered an amorphous lump of metal off the coast of the Greek island of Antikythera. It was found on the wreck of a Roman cargo ship dated to between 70 and 60 BCE. It was housed in a wooden-framed case and appeared to contain a number of gears.
In the century following, researchers from several disciplines speculated on its purpose, and examined it using successive generations’ leading-edge technology. In 1971, X-ray and gamma ray images were taken, which for the first time allowed researchers to see inside what by then were 82 fragments. In 2005, a team at Cardiff University began using non-invasive 3D scanning techniques and custom internal X-ray tomography to decipher the Greek inscriptions on the fragments. [1]

120 years after its discovery, there is general consensus that the device is a hand-powered orrery: a model of the solar system used to predict celestial movements. What has come to be known as the Antikythera Mechanism is the oldest known example of an analogue computer, and it is truly astounding. We now know that it had at least 37 meshing bronze gears for predicting the movements of the Sun and the Moon through the zodiac years in advance, along with eclipses and the cycles of panhellenic athletic games like the Olympiad, and several dials to input the settings for these.

But the more we learn about the device, the more questions it prompts. How old is it? Who made it? And, perhaps most puzzling of all, why is it the sole surviving example from this period? Was it the only one of its kind, or did other devices exist that are now lost to us? The scans conducted by the Cardiff team revealed that it contained a differential gear. Until 2005, it was generally held that these had not been invented until the 16th century. The discovery and reading of the Antikythera Mechanism have therefore changed the history of science.

There’s a lovely conceit here, in that recent developments in IT enable us to make incredible discoveries about the IT of the past. But there’s also a recurring theme of obsolescence, of technologies like MiniDisc and Betamax that fall by the wayside as they lose out to rivals or are leapfrogged, and of the barriers – be they technical, social, or environmental – that can prevent a particular technology or device being adopted by the mainstream. Might the Antikythera Mechanism have been a plaything for the elite that didn’t break into more widespread use, or a prototype that didn’t live up to the hype?

There are fleeting mentions in ancient literature of devices that may have been similar. In Cicero’s Republic, written in the middle of the first century BCE, one of the participants in an imagined dialogue says:

I remember…that Gaius Sulpicius Gallus…being by chance in the house of Marcus Claudius Marcellus, who had been in the consulate with him, ordered a sphere to be placed before him, which the ancestor of Marcellus had taken from the conquered Syracusans, and brought out of their wealthy and embellished city, the only thing he had possessed himself of among so great a spoil. I had heard a great deal of this sphere, on account of the fame of Archimedes, but did not admire the construction of it so much; for another which Archimedes also had made, and which the same Marcellus had placed in the temple of virtue, was more elegant and remarkable in the general opinion…Gallus said, that the other solid and full sphere was an old invention, and was first wrought by Thales of Miletas, but afterwards was delineated over with the fixed stars in the heavens by Eudoxus the Cnidian, a disciple of Plato…The mechanism of this sphere, however, on which the motions of the sun, moon, and those five stars which are called wandering and irregular, are shown, could not be illustrated on that solid sphere. But what appeared very admirable in this invention of Archimedes was, that he had discovered a method of producing the unequal and various courses, with their dissimilar velocities, by one revolution.
Cicero, Republic XIV

Where Archimedes is credited with the invention of the device described by Cicero, it has been suggested that the 2nd century BCE astronomer Hipparchus of Rhodes may have been involved or at least consulted in the construction of the Antikythera Mechanism, since it can be used to predict the irregular orbit of the moon first modelled by him.[2] This theory is to some extent supported by the dates proposed for the calibration of the device (204 BCE and 178 BCE among them) and research asserting that the parapegma (calendar) is set to track events for the range of latitude in which Rhodes is situated.[3]  This kind of hypothesis uses reverse engineering to uncover previously unknown detail about the who, where, what, when, and how of an artefact. The process is similar to that of IT forensics, which uses technical data to evidence cyber-attacks and identify those responsible. Wherever our knowledge is incomplete, there is also room for mythmaking, and the Antikythera Mechanism is no exception. It is, perhaps, the ultimate steampunk accessory, and it should arguably come as no surprise that it reportedly served as the inspiration for the ‘dial of destiny’ in the most recent exploits of everyone’s favourite archaeological adventurer, Indiana Jones.[4]

The device is extraordinarily sophisticated. We don’t see machines like it again until the astronomical clocks of the 14th century.[5] On the back door of its case was inscribed the settings for the dials, its instruction manual, if you will. As we will see below in our exploration of pre-digital software, when operating instructions pertain to calculation, they have more than a little in common with the algorithms that enable modern computers to perform myriad functions.

When computers were people
While the Antikythera Mechanism changes our understanding of what pre-digital computers could do, people like Mary Edwards (c.1750-1815) challenge our modern expectations of what computers are. For hundreds of years, computers were not machines at all. They were people, mathematicians who performed calculations on which countries’ economies relied. The first recorded use of the word ‘computer’ in 1613, by the Jacobean poet Richard Braithwaite, was in reference to someone described as “the best arithmetician that ever breathed.” [6]

In the 18th century, a network of human computers overseen by the Astronomer Royal produced the Nautical Almanac, astronomical tables that sailors used to find their latitude and longitude at sea. Computers performed these calculations and checked each other’s work using seven-figure logarithms. Because the position of the moon changes from year to year, new tables were computed and published annually. These were predictive, tracking the motion of planets and stars several years ahead for the longer sea voyages. As recorded by researcher Mary Croarken (see Further Reading), by 1793 the computer network was working so quickly and efficiently that calculations were being prepared ten years in advance. This was deemed to be too far ahead, leading to the work being suspended by the Board of Longitude for several years. This in turn resulted in loss of livelihood for the computers, one of whom was Mary Edwards, the only female computer in the network and the widow of a computer. Her daughter Eliza later followed her into the profession.
 
Fig. 1 Page from 1799 Nautical Almanac computed by Mary Edwards, taken from Croarken (2003) (see Further Reading)

Computers were generally understood to be people until the latter part of the 20th century. In an evolution that to some extent mirrors that of another high-tech industry, weaving, by the middle of the century most computers were women overseen by men. Absences of the male workforce due to war and the fact that women could be paid less than men arguably influenced this shift (for which see David Grier’s excellent book in Further Reading).

When millions were (fabric) programmers
In the early 20th century, around 600,000 people were employed in around 2,500 Lancashire textile mills, among them my great-grandparents, who met while working as weavers at Elm Street Mill in Burnley. They were the tech workforce of the industrial, mechanical age, over 60 per cent of whom were women.[7]  Power loom operators worked four looms simultaneously. They were skilled workers, who in many cases were trained to weave and design complex patterned fabrics on Jacquard looms. In Burnley, many mill workers received formal training at the Technical Institute, where James Holmes (1861-1934) had established a prestigious weaving department. Holmes was one of the foremost authorities of his generation on weaving and textiles. His handwritten textbook was originally intended solely for the students of his first-year weaving course but travelled all around the English-speaking world. As well as providing text descriptions of the principles and procedures for designing patterns and operating a power loom, Holmes’ manuscript includes examples of patterns and practical exercises for the student to complete.
 
Fig.2 Pages from the manuscript of James Holmes’ First Year Weaving course

As exquisitely illustrated above, power loom weaving was a binary (‘on/off’) system in mass use 150 years before digital computing. When a horizontal weft thread passes over the vertical warp threads, it creates a visible stitch in the cloth. But if the warp threads are lifted, the weft thread passes under and is not visible. The Jacquard loom automated this process, using punched cards that were fed into the machine in the correct order to produce the desired design. These were known as ‘operating instructions’, inspiring Charles Babbage’s designs for his Analytical Engine, Ada Lovelace’s writings on its potential uses, and 20th century computer programming. Looking backwards to Holmes’ designs and to the woven textiles of the last two centuries, we may see in them pixellated pictures that would now be described as ‘low resolution.’ When one watches the operation of a Jacquard loom, as one still can at Queen Street Mill in Burnley and Paradise Mill in Macclesfield, the experience of observing both input and output is very similar to that of a modern computer printer – albeit steam-powered and somewhat louder. [8]

There’s a kinship between the women who translated patterns into cards for weaving looms and those who in the 20th century punched cards for computers using high-level programming languages such as FORTRAN and COBOL. Whether steam-driven or powered by electricity, both workforces wrote millions of lines of code. In an era in which the dominant narrative is that of the ‘tech bro’, this may challenge our expectations of who can be a computer programmer. 

We can discern other trends and parallels that may have relevance for us today. One of these is the shift from artisanal to mass production. In Mary Edwards’ time, computing was a cottage industry, of piece workers who sent in their calculations. Just a few years later, centralisation of production in the National Almanac Office put an end to her daughter’s career. At broadly the same time, the movement of the textile industry from piece work to factory production spawned numerous popular representations in folk songs and other media of the uprooting of rural populations, the growth of urban sprawl, and the ‘Factory Girl’, while also prompting backlash from anti-industrial movements such as the Luddites. The Jacquard loom’s ability to produce more than twenty times the amount of decorated fabric per day as a hand loom reduced the human labour required, and therefore threatened the livelihoods of the previous generations’ skilled workers.[9] These are precisely the concerns being voiced by copywriters, novelists, artists, musicians, and teachers about the use of Generative AI today.

And just as the Jacquard loom made possible mass production of complex textile patterns that had previously taken many days to produce by hand, mechanical innovations promised to improve the computational accuracy and efficiency of predictive calculation. Indeed, the Nautical Almanac on which Mary and Eliza Edwards worked was the inspiration for Charles Babbage’s (1791-1871) designs for his Difference Engine, while his later Analytical Engine relied on inputs from cards, directly inspired by the Jacquard mechanism.

The Golden Age of steam (computing)
In 1812, Charles Babbage and John Herschel were commissioned by the Astronomical Society of London to compare the calculations made by independent computers for the Nautical Almanac. As he later recalled in papers kept at the Oxford Science Museum, “Finding many discordancies, I expressed to my friend the wish that we could calculate by steam.” Accordingly, he designed a mechanical machine that would use the same mathematical process as the human computers – the Finite Difference Method – to calculate numerical values and print the results. In 1822, a demonstration model of the Difference Engine was produced.

In 1834, Babbage conceived of a more powerful Analytical Engine, again powered by steam, and using punch cards as input. There was also a ‘store’, designed to retain up to 100 40-digit numbers, and a ‘mill’ to perform calculations.
 
Fig.3 Plan 25 from Charles Babbage’s design for an Analytical Engine, showing variable, number, and operation cards (Science Museum under Creative Commons CC BY-NC-SA 4.0 Licence)

In her 1843 paper on the design, Ada Lovelace (1815-1852) explicitly acknowledges the machine’s debt to weaving technology:

In this, which we may call the neutral or zero state of the engine, it is ready to receive at any moment, by means of cards constituting a portion of its mechanism (and applied on the principle of those used in the Jacquard-loom), the impress of whatever special function we may desire to develop or to tabulate. These cards contain within themselves (in a manner explained in the Memoir itself on page 6) the law of development of the particular function that may be under consideration, and they compel the mechanism to act accordingly in a certain corresponding order.
‘Notes by the translator Ada Augusta, Countess of Lovelace’, in Sketch of the Analytical Engine Invented by Charles Babbage by L. F. Menabrea, Scientific Memoirs 3

Throughout her paper, Lovelace’s sense of wonder is never far from the surface. It is particularly evident in her identification of the Analytical Engine as “embodying of the science of operations”, and of its potential for applications beyond Babbage’s intended calculations:

The bounds of arithmetic were however outstepped the moment the idea of applying the cards had occurred; and the Analytical Engine does not occupy common ground with mere “calculating machines.” It holds a position wholly its own; and the considerations it suggests are most interesting in their nature. In enabling mechanism to combine together general symbols in successions of unlimited variety and extent, a uniting link is established between the operations of matter and the abstract mental processes of the most abstract branch of mathematical science. A new, a vast, and a powerful language is developed for the future use of analysis, in which to wield its truths so that these may become of more speedy and accurate practical application for the purposes of mankind than the means hitherto in our possession have rendered possible. Thus not only the mental and the material, but the theoretical and the practical in the mathematical world, are brought into more intimate and effective connexion with each other.

She is widely credited with being the first to publish what we would now describe as a concept for general purpose computing:

The operating mechanism can even be thrown into action independently of any object to operate upon (although of course no result could then be developed). Again, it might act upon other things besides number, were objects found whose mutual fundamental relations could be expressed by those of the abstract science of operations, and which should be also susceptible of adaptations to the action of the operating notation and mechanism of the engine. Supposing, for instance, that 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.
As an example of the Analytical Engine’s potential capability, in her ‘Note G’ Lovelace published a set of instructions for calculating a complex sequence of numbers known as the Bernoulli numbers:

1st Series.—Let n = 1, and calculate (8.) [10]* for this value of n. The result is B1.
2nd Series.—Let n = 2. Calculate (8.) for this value of n, substituting the value of B1 just obtained. The result is B3.
3rd Series.—Let n = 3. Calculate (8.) for this value of n, substituting the values of B1, B3 before obtained. The result is B5. And so on, to any extent.

What Lovelace describes here as a “series of computations” is now recognisable as a computer algorithm. Since algorithms are fundamental to so much of our digitally enabled life today, she is often credited with publishing the first computer program. The punch card input allows for the sequence of operations to be changed, i.e., for the program to be modified:

The Operation-cards merely determine the succession of operations in a general manner. They in fact throw all that portion of the mechanism included in the mill into a series of different states, which we may call the adding state, or the multiplying state, &c. respectively. In each of these states the mechanism is ready to act in the way peculiar to that state, on any pair of numbers which may be permitted to come within its sphere of action.

Babbage’s Analytical Engine was never successfully completed. Lovelace never had the opportunity to test her software on a working model. But punch cards were indeed the dominant means of computer input for several decades of the 20th century, from the Hollerith machine developed to tabulate the US census to the mainframe computers produced by IBM and other tech giants of the day.  

Back to the Future
So, while we may be tempted to think our current preoccupation with the threat of machines replacing humans is unique, or at least novel, we’ve faced it several times before. Sometimes they did indeed replace certain human functions and in response humankind adapted: for example, by ceasing to be computers and becoming computer programmers instead.

The threat posed by automation is by no means a new preoccupation. In 2024, digital technology is more advanced than our ancestors could ever have anticipated, but we share similar apprehensions and face the same big questions. We are not the first generation to have concerns about machines taking over, stealing our jobs, wiping out humanity, and related threats. At the same time, our ongoing efforts to get computers to do things humans can’t, or to do things more quickly, efficiently, or accurately than us, are part of a much longer trajectory that is millennia old. They are likewise complemented by parallel drives towards human augmentation, and the desire to see further by predicting the future using increasingly scientific, less mystical methods.

In this way, we can draw a direct line between the Antikythera Mechanism, the Nautical Almanac, and the Difference Engine – between analogue computers, human computers, steam-powered computers, and the eventual arrival of digital computing. And our knowledge of how computers worked, were conceived and perceived in centuries past, whether they were humans or machines, is changing all the time. Archaeology can tell us as much about this as computer science can.

© Professor Victoria Baines 2024/5

FOOTNOTES

1] https://impact.ref.ac.uk/casestudies/CaseStudy.aspx?Id=3465

[2] https://www.theguardian.com/science/2006/nov/30/uknews

[3] https://arstechnica.com/science/2022/04/researchers-home-in-on-possible-day-zero-for-antikythera-mechanism/

[4] https://www.smithsonianmag.com/history/the-real-history-behind-archimedes-dial-in-indiana-jones-and-the-dial-of-destiny-180982435/

[5] https://www.cabinet.ox.ac.uk/astronomical-clock-richard-wallingford-d-1336; https://www.cabinet.ox.ac.uk/giovanni-dondis-astrarium-1364-0

6] https://www.computinghistory.org.uk/det/5829/Richard-Braithwaite-coined-the-phrase-computer/

[7] John K. Walton. “Factory work in Victorian Lancashire”. BBC Legacies. https://www.bbc.co.uk/legacies/work/england/lancashire/article_1.shtml

[8] https://www.lancashire.gov.uk/leisure-and-culture/museums/queen-street-mill-textile-museum/; https://www.thesilkmuseum.co.uk/paradise-mill

[9] https://www.scienceandindustrymuseum.org.uk/objects-and-stories/jacquard-loom

[10]* “(8.)” here denotes an independent formula.

[11] https://www.census.gov/history/www/innovations/technology/the_hollerith_tabulator.html

REFERENCES AND FURTHER READING

William Aspray, ed. (1990) Computing Before Computers. Iowa State University Press. Available at https://ed-thelen.org/comp-hist/CBC-Ch-00.pdf 

Bedtime History (2022) History of the Antikythera Mechanism for Kids [podcast] https://bedtimehistorystories.com/history-of-the-antikythera-mechanism-for-kids/ 

M. Croarken (2003) “Mary Edwards: Computing for a Living in 18th-Century England”. IEEE Annals of the History of Computing 25.4. https://doi.org/10.1109/MAHC.2003.1253886 

David Alan Grier (2005) When Computers Were Human. Princeton University Press.

Macclesfield Museums (2022) “Binary and the Jacquard Mechanism – demonstration” - https://www.youtube.com/watch?v=pzYucg3Tmho

Jo Marchant (2006) “In search of lost time”, Nature 444: 534–538

L. F. Menabrea (1843) Sketch of the Analytical Engine Invented by Charles Babbage, translation with notes upon the Memoir by the Translator Ada Augusta, Countess of Lovelace. R. & J. E. Taylor. London. Available at https://johnrhudson.me.uk/computing/Menabrea_Sketch.pdf 

University College London (2021) “Experts recreate a mechanical Cosmos for the world’s first computer” - https://www.ucl.ac.uk/news/2021/mar/experts-recreate-mechanical-cosmos-worlds-first-computer 

For younger people, the BBC has a delightful animation comparing Ada Lovelace and Alan Turing, suitable for Key Stage One (KS1) and above. https://www.bbc.co.uk/teach/class-clips-video/articles/z92jp9q

William Aspray, ed. (1990) Computing Before Computers. Iowa State University Press. Available at https://ed-thelen.org/comp-hist/CBC-Ch-00.pdf 

Bedtime History (2022) History of the Antikythera Mechanism for Kids [podcast] https://bedtimehistorystories.com/history-of-the-antikythera-mechanism-for-kids/ 

M. Croarken (2003) “Mary Edwards: Computing for a Living in 18th-Century England”. IEEE Annals of the History of Computing 25.4. https://doi.org/10.1109/MAHC.2003.1253886 

David Alan Grier (2005) When Computers Were Human. Princeton University Press.

Macclesfield Museums (2022) “Binary and the Jacquard Mechanism – demonstration” - https://www.youtube.com/watch?v=pzYucg3Tmho

Jo Marchant (2006) “In search of lost time”, Nature 444: 534–538

L. F. Menabrea (1843) Sketch of the Analytical Engine Invented by Charles Babbage, translation with notes upon the Memoir by the Translator Ada Augusta, Countess of Lovelace. R. & J. E. Taylor. London. Available at https://johnrhudson.me.uk/computing/Menabrea_Sketch.pdf 

University College London (2021) “Experts recreate a mechanical Cosmos for the world’s first computer” - https://www.ucl.ac.uk/news/2021/mar/experts-recreate-mechanical-cosmos-worlds-first-computer 

For younger people, the BBC has a delightful animation comparing Ada Lovelace and Alan Turing, suitable for Key Stage One (KS1) and above. https://www.bbc.co.uk/teach/class-clips-video/articles/z92jp9q

This event was on Tue, 24 Sep 2024

Dr Victoria Baines

Professor Victoria Baines

Gresham IT Livery Company Professor of Information Technology

Professor Victoria Baines FBCS is a leading authority in the field of online trust, safety and cybersecurity. She frequently contributes to major broadcast media outlets...

Find out more

Support Gresham

Gresham College has offered an outstanding education to the public free of charge for over 400 years. Today, Gresham plays an important role in fostering a love of learning and a greater understanding of ourselves and the world around us. Your donation will help to widen our reach and to broaden our audience, allowing more people to benefit from a high-quality education from some of the brightest minds.