| Line 2: |
Line 2: |
| | '''Ada Lovelace''' (1815-1852) was a British mathematician involved in the extremely early history of computers, long before the "modern era" of actual construction of working computers. She worked with [[Charles Babbage]] on an extremely visionary, completely mechanical, computer called the "analytical engine". It was never built, because Babbage's design was way ahead of its time. | | '''Ada Lovelace''' (1815-1852) was a British mathematician involved in the extremely early history of computers, long before the "modern era" of actual construction of working computers. She worked with [[Charles Babbage]] on an extremely visionary, completely mechanical, computer called the "analytical engine". It was never built, because Babbage's design was way ahead of its time. |
| | | | |
| − | Along with Babbage and others, she made notes for programming the proposed computer, and she became famous in the modern era for her description of the "classic recurrence relation for computing Bernoulli numbers"<ref>
| + | She is noteworthy for writing an 1843 paper with Luigi Menabrea (it actually started out has her translation of Menabrea's shorter paper from French to English; she then added extensive notes) about the analytical engine<ref name "thepaper">[http://www.fourmilab.ch/babbage/sketch.html Menabrea's Sketch and Ada's Notes]</ref>. The paper ends with the famous "Note G", in which she analyzes an algorithm for calculating [[Bernoulli numbers]] and shows the code for it on the (never built) machine. Because of this, she is often credited with "writing the first computer program" and "being the world's first computer programmer."<ref name="sciam">[http://www.cs.virginia.edu/~robins/Ada_and_the_First_Computer.pdf Scientific American, May 1999, pp76]</ref><ref>http://cs-www.cs.yale.edu/homes/tap/Files/ada-bio.html</ref><ref>http://www.cs.fit.edu/~ryan/ada/lovelace.html</ref><ref>http://www.well.com/user/adatoole/bio.htm</ref><ref>[http://www.cs.fit.edu/~ryan/ada/lovelace.html Augusta Ada Byron (1815-1852)] - Ryan Stansifer, Associate Professor - Department of Computer Sciences - Florida Institute of Technology</ref>. While this was not a program written in anything that would be recognized as a programming language in the modern sense, it was the first mathematical algorithm ''encoded for the purpose of being executed by an automatically controlled digital computer''. That is, she wrote the first published, surviving computer program designed to solve a real problem. |
| − | [http://www.cs.fit.edu/~ryan/ada/lovelace.html Augusta Ada Byron (1815-1852)] - Ryan Stansifer, Associate Professor - Department of Computer Sciences - Florida Institute of Technology</ref> used by [[Jakob Bernoulli]]. On this basis, feminists eager to promote [[women in science]] decided to dub her "the first computer programmer".<ref name="sciam">[http://www.cs.virginia.edu/~robins/Ada_and_the_First_Computer.pdf Scientific American, May 1999, pp76]</ref><ref>http://cs-www.cs.yale.edu/homes/tap/Files/ada-bio.html</ref><ref>http://www.cs.fit.edu/~ryan/ada/lovelace.html</ref>. This claim arises from the fact that she was first to publish a paper (in 1843) containing a mathematical algorithm ''encoded for the purpose of being executed by an automatically controlled digital computer''. Her program calculated [[Bernoulli numbers]]. That is, she wrote the first published, surviving computer program designed to solve a real problem. | |
| | | | |
| − | But the issue is not clear-cut, because there are different opinions about what constitutes a "program" and what constitutes a "computer". Perhaps the main objection is that the computer for which her program was written was never built, so her program did not actually run. Ada had to write the algorithm on paper, rather than at a keypunch or computer terminal, of course. But, to use modern terminology, she actually "wrote code". Also, since the term "program" had not been coined, she described her algorithm as a "plan". In the 20th century, the program was carefully analyzed and simulated, and found to have a minor "bug". | + | But the issue is not clear-cut, because there are different opinions about what constitutes a "program" and what constitutes a "computer". Perhaps the main objection is that the computer for which her program was written was never built, so her program did not actually run. Ada had to write the algorithm on paper, rather than at a keypunch or computer terminal, of course. But, to use modern terminology, she actually "wrote code". Also, since the term "program" had not been coined, she described her algorithm as a "plan". In the 20th century, the program was carefully analyzed and simulated, and found to have a minor "bug". The controversy will be discussed at length below. |
| | | | |
| | ==Early Life== | | ==Early Life== |
| Line 14: |
Line 13: |
| | In October of 1842 Luigi Federico Menabrea (1809-1896), an Italian professor of mechanics at University of Turin (and later premier of the Kingdom of Italy), published a paper describing the function and theory of Babbage's Analytical Engine. Ada translated the paper from French to English and added her own extensive comments. (See ''Science and Reform, Selected Works of Charles Babbage'' by Anthony Hyman.) This was published in 1843 and impressed Babbage, for it included, as Babbage himself wrote, | | In October of 1842 Luigi Federico Menabrea (1809-1896), an Italian professor of mechanics at University of Turin (and later premier of the Kingdom of Italy), published a paper describing the function and theory of Babbage's Analytical Engine. Ada translated the paper from French to English and added her own extensive comments. (See ''Science and Reform, Selected Works of Charles Babbage'' by Anthony Hyman.) This was published in 1843 and impressed Babbage, for it included, as Babbage himself wrote, |
| | {{cquote|some complicated programs of her own, the most complex of these being one to calculate the sequence of Bernoulli numbers.}} | | {{cquote|some complicated programs of her own, the most complex of these being one to calculate the sequence of Bernoulli numbers.}} |
| | + | |
| | + | ==What would the program have done, had the Analytical Engine been built?== |
| | + | Her program calculated [[Bernoulli numbers]]. These are a series of numbers (unlike the factorials or Fibonacci numbers, they are not integers—the Analytical Engine could handle that) that have certain interesting properties in mathematical analysis. They are significantly harder to calculate than factorials or Fibonacci numbers. It should be noted that the recurrence relations and power series coefficients used to compute them were known well before Ada's paper—she just coded it for the analytical engine. |
| | | | |
| | ==What did Ada's Bernoulli program look like?== | | ==What did Ada's Bernoulli program look like?== |
| − | The program, and detailed technical commentary, appeared in a paper "Sketch of the Analytical Engine Invented by Charles Babbage" that Ada wrote in 1843. The program itself has been reproduced in the "sidebar" on page 79<ref name="sciam"/>. | + | The program, and detailed technical commentary, appeared in a paper "Sketch of the Analytical Engine Invented by Charles Babbage" that Ada wrote in 1843. The program itself has been reproduced in the "sidebar" on page 79<ref name="sciam"/>. First there is a list of the six input and output variables that are used: V1, V2, V3, V21, V22 and V23. And the temporary variables V4 through V13. In modern terminology in a strongly typed language such as C++, we would write something like: |
| − | First there is a list of the six input and output variables that are used: V1, V2, V3, V21, V22 and V23. And the temporary variables V4 through V13. In modern terminology in a strongly typed language such as C++, we would write something like: | |
| | | | |
| | int V1, V2, V3; // inputs | | int V1, V2, V3; // inputs |
| Line 25: |
Line 26: |
| | At the start of the program, she gives initialization of V1=1, V2=2, and V3=N. (Modern computers often have "immediate" instructions to handle constants without using up registers.) | | At the start of the program, she gives initialization of V1=1, V2=2, and V3=N. (Modern computers often have "immediate" instructions to handle constants without using up registers.) |
| | | | |
| − | Then she lists the 23 instructions, giving their source and destination registers, opcodes, and commentary on the progress of the program. The first 5 instructions, for example, are: | + | Then she lists the 25 instructions, giving their source and destination registers, opcodes, and commentary on the progress of the program. The first 5 instructions, for example, are: |
| | | | |
| | V4=V5=V6 = V2 * V3; // Get 2N. The machine allowed multiple destination registers. | | V4=V5=V6 = V2 * V3; // Get 2N. The machine allowed multiple destination registers. |
| Line 40: |
Line 41: |
| | The "analytical engine" was so far ahead of its time that one might be tempted to call it just a "visionary idea". The technology of the time was nowhere near capable of building it. Even the much-less-ambitious "difference engine" was beyond the technology of the day—making the counters do arithmetic reliably required very careful machining of the parts. Only a small partial prototype of the difference engine was built in Babbage's lifetime. But Babbage clearly knew what he wanted<ref>That Babbage knew what he was doing is attested to by the fact that his full difference engine was finally constructed in 1991 (the bicentennial of Babbage's birth) and is on display at the London Science Museum. Babbage's original plans were almost exactly correct.</ref>. His vision of a calculating device that can perform operations under control of a "program" punched into cards, and that makes control decisions based on the data resulting from the calculation steps, was incredibly prescient. It was exactly the principle used in modern computers. Lovelace understood that vision, and even extended it to the idea that computers might perform tasks beyond purely numerical ones, such as composing music. The fact that the analytical engine was mechanical rather than electronic did not make it any less a computer. It just made it harder to build. It took about 100 years for the field of electrical engineering to make computers such as that envisioned by Babbage realizable. | | The "analytical engine" was so far ahead of its time that one might be tempted to call it just a "visionary idea". The technology of the time was nowhere near capable of building it. Even the much-less-ambitious "difference engine" was beyond the technology of the day—making the counters do arithmetic reliably required very careful machining of the parts. Only a small partial prototype of the difference engine was built in Babbage's lifetime. But Babbage clearly knew what he wanted<ref>That Babbage knew what he was doing is attested to by the fact that his full difference engine was finally constructed in 1991 (the bicentennial of Babbage's birth) and is on display at the London Science Museum. Babbage's original plans were almost exactly correct.</ref>. His vision of a calculating device that can perform operations under control of a "program" punched into cards, and that makes control decisions based on the data resulting from the calculation steps, was incredibly prescient. It was exactly the principle used in modern computers. Lovelace understood that vision, and even extended it to the idea that computers might perform tasks beyond purely numerical ones, such as composing music. The fact that the analytical engine was mechanical rather than electronic did not make it any less a computer. It just made it harder to build. It took about 100 years for the field of electrical engineering to make computers such as that envisioned by Babbage realizable. |
| | | | |
| − | ==Was it a RISC machine or a CISC machine?== | + | ==How can someone have written a computer program in 1843? Computers hadn't been invented!== |
| − | From looking at Ada's program for Bernoulli polynomials, it is clear that the machine did its calculation by manipulating numbers in specific registers. It did not have any "random access memory" that could be addressed. CISC machines address memory in their operation instructions, while RISC machines operate on registers, loading and storing memory locations only with specific instructions. So the analytical engine would have to be classified as a RISC machine in that sense.
| + | One needs to be flexible in one's thinking about what constitutes a "computer" or a "program". It's certainly true that nothing like the modern conception of a computer had been invented. But, at a deeper philosophical level, we can say that Babbage, Lovelace, and Menabrea (and undoubtedly a few of their colleagues) saw a fundamental truth: '''It is possible for an automatic machine to process information.''' That is the essence of computing. |
| | + | |
| | + | The computer involved was the "Analytical Engine", conceived and designed by the amazingly talented Charles Babbage. His visionary idea of a machine that automatically processes information (that is, a computer) was about 100 years ahead of its time. It was purely mechanical (that fact alone makes it seriously inferior to modern electronic computers), but it was, in principle, a workable idea. Babbage was very familiar with the Jacquard loom, which was a device for weaving complex tapestries under the control of punched cards mechanically linked together and running around a track. It had the ability to move the cards forward and backward, executing complex loops. (This makes it somewhat like a Turing Machine, though the similarity ends there.) The Analytical Engine was essentially a glorified Jacquard loom, controlling an arithmetic unit (completely mechanical, of course) instead of a weaving loom. A mechanical arithmetic unit was also a rather visionary idea, but Babbage knew how to do it, as shown by his earlier design of the "Difference Engine". The Difference Engine was not completed in Babbage's lifetime either, but it came close. Both machines were beyond the ability of the mechanical engineering technology of the day. But in 1991 a Difference Engine was completed, and it works perfectly (albeit millions of times slower than an electronic computer.) |
| | + | |
| | + | The Analytical Engine was basically a Difference Engine programmed by the punched cards of a Jacquard loom. The Difference Engine part of it is what we would now call the "Arithmetic Logic Unit", or ALU. (At the time, it was called the "mill".) |
| | + | |
| | + | The Analytical Engine design got the attention of Luigi Federico Menabrea (1809-1896), an Italian professor of mechanics at University of Turin (and later premier of the Kingdom of Italy), and of Ade Lovelace. Menabrea wrote a paper about it in 1842, and, at Babbage's suggestion, Lovelace translated it from French to English. She also added notes of her own, that in fact comprised about 3/4ths of the final paper, and are frequently quoted even today. |
| | + | |
| | + | Biographer Betty Toole wrote: "Her 'Notes' also predict that, given the right algorithms, calculating engines might compose music and create graphics. She even presaged Alan Turing and the 'garbage-in, garbage out' effect, saying, 'The Analytical Engine has no pretensions whatever to originate any thing. It can do whatever we know how to order it to perform -- it has no power of anticipating any analytical relations or truths.'" This statement is often quoted even today as a profound truism about computers. |
| | + | |
| | + | Toole further says: "Ada suggested to Babbage writing a plan for how the engine might calculate Bernoulli numbers. This plan is now regarded as the first 'computer program.'"<ref>http://cs-www.cs.yale.edu/homes/tap/Files/ada-bio.html</ref> |
| | + | |
| | + | Ada's "Note G" contains the Bernoulli program. Reading the Menabrea/Lovelace paper, one is struck by the degree to which they had to break new ground. Computers, and the field of computer science, had not been invented. They had to figure out what it meant to have a computer, and to encode mathematical algorithms for it. What they figured out is very different from modern computer science, but one can see the beginnings in the Menabrea/Lovelace paper. |
| | + | |
| | + | ==But was it really a program?== |
| | + | It is impossible to answer this to everyone's satisfaction. One's answer to this depends on how much one is willing to accept something that looks very different from what programs look like today. Keep in mind that essentially all of the vocabulary of modern computer science did not exist. For example, here are some terms that are staples of thinking about computers in the modern world: |
| | + | ::*Computer |
| | + | ::*Program |
| | + | ::*Programmer |
| | + | ::*Software |
| | + | ::*Source Code |
| | + | ::*Machine code |
| | + | ::*Assembly Code |
| | + | ::*any kind of Code |
| | + | ::*High-Level Language |
| | + | ::*Low-level Language |
| | + | ::*Assembly Language |
| | + | ::*any kind of Computer Language |
| | + | ::*Assembler |
| | + | ::*Compiler |
| | + | ::*Flow Chart |
| | + | ::*If/Then/Else |
| | + | ::*Do/While |
| | + | ::*Goto |
| | + | ::*Array |
| | + | ::*Struct |
| | + | ::*Class |
| | + | |
| | + | None of these terms existed at the time. (Of course the ''words'' existed, but they had no meaning in the context of computers.) Nevertheless, Babbage, Lovelace, and Menabrea understood what it would mean for an automatic machine to process information, a vision that would not come to fruition for another century. |
| | + | |
| | + | One must keep an open mind about what "machine code" looks like for a machine that reads its instructions with rods poking through holes in large punched cards running around on a track, and does its arithmetic by counting teeth on turning gears. |
| | | | |
| − | ==Was Ada's program a real program, or just a "description of an algorithm"?==
| + | Ada certainly didn't punch the program on cards or type it into a computer terminal. (She might conceivably have punched it onto cards if Babbage had made his design sufficiently concrete as to assign binary opcodes, but he never got anywhere near that far.) Since it never ran on a computer in the form in which she wrote it, it could be argued that it wasn't a program, but was merely an algorithm. But, whatever it was, it was written in the peculiarly stilted language of computer machine code. That is, the numbers that it was manipulating were assigned to specific registers. As the iteration loop cycled around, those registers were overwritten with new values. That is not the way ordinary mathematical algorithms are expressed. They are expressed in terms of more abstract formulas and recurrences. In Ada's case, the formulas were broken down into individual operations, manipulating specific registers that she specified. |
| − | It is impossible to answer this to everyone's satisfaction. She certainly didn't punch it on cards or type it into a computer terminal. (She might conceivably have punched it onto cards if Babbage had made his design sufficiently concrete as to assign binary opcodes, but he never got anywhere near that far.) Since it never ran on a computer in the form in which she wrote it, it could be argued that it wasn't a program, but was merely an algorithm. But, whatever it was, it was written in the peculiarly stilted language of computer machine code. That is, the numbers that it was manipulating were assigned to specific registers. As the iteration loop cycled around, those registers were overwritten with new values. That is not the way ordinary mathematical algorithms are expressed. They are expressed in terms of more abstract formulas and recurrences. In Ada's case, the formulas were broken down into individual operations, manipulating specific registers that she specified. The recurrence was specified by manipulating a count register and testing whether it had reached zero.
| |
| | | | |
| | Algorithms like Euclid's algorithm or Heron's formula, or even integration techniques or the description of the factorial function, are not described that way unless one is writing a computer program. | | Algorithms like Euclid's algorithm or Heron's formula, or even integration techniques or the description of the factorial function, are not described that way unless one is writing a computer program. |
| Line 50: |
Line 90: |
| | "Algorithms" for calculating Bernoulli numbers had been known for some time. But she wrote this "algorithm" in the form of ''specifically realizable numerical operations'' that she (naively, Babbage's design was ''far'' beyond what the technology of the day would have provided) believed the analytical engine could have done. And she used the ''specific ability of a calculating device to make control decisions based on the data''. | | "Algorithms" for calculating Bernoulli numbers had been known for some time. But she wrote this "algorithm" in the form of ''specifically realizable numerical operations'' that she (naively, Babbage's design was ''far'' beyond what the technology of the day would have provided) believed the analytical engine could have done. And she used the ''specific ability of a calculating device to make control decisions based on the data''. |
| | | | |
| − | * Ada suggested to Babbage writing a plan for how the engine might calculate Bernoulli numbers. This plan, is now regarded as the first "computer program." [http://www.well.com/user/adatoole/bio.htm]
| + | Biographer Martin Campbell-Kelly says that she was "a computer pioneer, if not a programmer as the term is understood today". |
| | | | |
| − | ==Was Ada really first? Were the Bernoulli notes the first program?==
| + | Some have suggested that Ada could not have been a programmer because, as her Biographer Betty Toole wrote: "Ada certainly did not invent a computer language."<ref>http://www.salon.com/21st/feature/1999/03/16feature2.html</ref>. Toole is correct; no computer language was involved. |
| | | | |
| − | The decision to dub Ada Lovelace the [[first computer programmer]] ignores the historical fact that | + | The important point is that the algorithm that Lovelace put in her "Note G" was '''encoded for the purpose of being executed by an automatically controlled digital computer'''. That is, she wrote the first published, surviving computer program designed to solve a real problem. |
| − | *Babbage and others also had written “programs” for the never completed Analytical Engine. [http://www.cs.fit.edu/~ryan/ada/lovelace.html]
| |
| | | | |
| − | Also, she was not the sole author of the notes on calculating [[Bernoulli numbers]]. The notes were originally written by another person, and she translated these and expanded upon them. This would make her a co-author of the notes.
| + | ==How about loops? "Do/while"? "For"? "Goto"?== |
| | + | As Ada's note C points out, the Jacquard loom, and hence the analytical engine, had the ability to automatically back up the card sequence and thereby repeat instructions in what would now be called a "loop", though the exact mechanism isn't described. Note G shows the repetition: cards 1-12 are processed once (we would call this "initialization"), cards 13-23 are repeated a number of times depending on which Bernoulli number is desired (we would call this the "loop") and cards 24-25 are processed once at the end. (Calculation of B<sub>1</sub> is a special case and does not involve cards 8-12.) |
| | | | |
| | + | But, since programming languages had not been invented, Lovelace had to express this in terms of the way the Jacquard loom worked. She did this by drawing large "curly braces" in the left margin. The paper does not say how that would actually be coded so that the analytical engine would control the operation. |
| | + | |
| | + | ==Was Ada really first? Was the Bernoulli program the first program?== |
| | There are those who claim <ref>http://projects.exeter.ac.uk/babbage/ada.html</ref> that Babbage himself, or an assistant of his, or perhaps some of his sons, must have written "programs" before Ada did. Issues like this arise from time to time, perhaps most notably in the "calculus war" between Newton and Leibniz, or the "non-Euclidean geometry war" among Gauss, Bolyai, and Lobachevsky. The scientific community generally gives great weight to the act of publishing one's work. If these other people wrote programs before Ada did, they don't seem to have published them, and they are lost. It is not known what problems these earlier programs might have been solving. | | There are those who claim <ref>http://projects.exeter.ac.uk/babbage/ada.html</ref> that Babbage himself, or an assistant of his, or perhaps some of his sons, must have written "programs" before Ada did. Issues like this arise from time to time, perhaps most notably in the "calculus war" between Newton and Leibniz, or the "non-Euclidean geometry war" among Gauss, Bolyai, and Lobachevsky. The scientific community generally gives great weight to the act of publishing one's work. If these other people wrote programs before Ada did, they don't seem to have published them, and they are lost. It is not known what problems these earlier programs might have been solving. |
| | | | |
| − | She was certainly one of the pioneers of software development, but whether she was the first person to write notes for an algorithm that a machine could carry out is not certain. Nor is there wide agreement on whether such notes constitute an actual [[computer program]].
| + | ==Why is there controversy about this?== |
| | + | In addition to the inevitable controversy about the scientific issues: |
| | + | ::*Was a "program" written 100 years before the invention of the modern computer really a "program"? |
| | + | ::*Was the Analytical Engine really a computer? |
| | + | ::*Is it significant that the Analytical Engine was never built, and hence that this program never ran as intended? |
| | + | ::*Was the Lovelace/Bernoulli program actually first? |
| | + | |
| | + | there may be additional social/political issues because Ada Lovelace was a woman. The issue of [[Women in Science and Mathematics]] has long been a contentious one, because the field is dominated by men. There are those that feel that women who have made significant contributions should be held up as role models to encourage girls to go into these fields<ref>This sometimes gets rather silly: [http://shop.mattel.com/product/index.jsp?productId=4032107]</ref> (the effect is particularly pronounced in the case of Marie Curie), and those who disagree. As often happens, people sometimes mix these issues with other political issues, such as the entire issue of feminism. |
| | | | |
| − | ==Controversy==
| + | But one should keep in mind that nothing about modern feminism or educational/social issues has any bearing on what happened 170 years ago. |
| − | Some people, perhaps motivated by misdirected passion over the issue of feminism, take an unexpectedly strong stand in favor of, or against, the idea that she was the world's first computer programmer. What one person did 170 years ago really has nothing to do with contemporary social issues.
| |
| | | | |
| | ==The [[ADA (computer language)|ADA]] programming language== | | ==The [[ADA (computer language)|ADA]] programming language== |
| Line 75: |
Line 124: |
| | *[http://www.salon.com/21st/feature/1999/03/16feature2.html Repurposing Ada] - contains several denials (including one by a biographer) that her "Notes" were a [[computer program]] | | *[http://www.salon.com/21st/feature/1999/03/16feature2.html Repurposing Ada] - contains several denials (including one by a biographer) that her "Notes" were a [[computer program]] |
| | *[http://www.fourmilab.ch/babbage/sketch.html Menabrea's Sketch and Ada's Notes] | | *[http://www.fourmilab.ch/babbage/sketch.html Menabrea's Sketch and Ada's Notes] |
| | + | *[http://www.well.com/~adatoole/ Ada, The Enchantress of Numbers: Poetical Science, Betty Toole (e-book)] |
| | + | *Ada, the Enchantress of Numbers: A Selection from the Letters of Lord Byron's Daughter and Her Description of the First Computer, Betty Toole, 1992, ISBN 978-0912647098 |
| | + | *Ada, the Enchantress of Numbers: Prophet of the Computer Age, Betty Toole, 1998, ISBN 978-0912647180 |
| | + | *Computer: A History Of The Information Machine, Second Edition, Martin Campbell-Kelly & William Aspray, 2004, ISBN 978-0813342641 |
| | | | |
| | {{DEFAULTSORT: Lovelace, Ada}} | | {{DEFAULTSORT: Lovelace, Ada}} |
| | [[category:Women]] | | [[category:Women]] |