10 ms·
What did Ada Lovelace's program actually do? (2018)
- countrymile 2y agoGreat article, does anyone have a breakdown of the programs babbage wrote? It always seemed odd that Lovelace was the first programmer, suggesting Babbage created a machine without thinking how his it could be used.
- robocat 2y agoFrom article: Babbage also wrote more than twenty programs that he never published.[19] So it’s not quite accurate to say that Lovelace wrote or published the first program, though
- countrymile 2y agoI was wondering if there was another source for the programs? I don't have the book it references.
- gregalt 2y agoI talk about his "Series L" tables here and link to scans of them: https://pairdebuggingwithlovelace.hashnode.dev/lovelaces-program-part-9-the-first-computer-program https://pairdebuggingwithlovelace.hashnode.dev/lovelaces-pro...
- countrymile 2y agoThis is excellent and makes a good case for Ada being the first programmer, many thanks for sharing. I've also stumbled across the science museum Babbage archive: https://collection.sciencemuseumgroup.org.uk/documents/aa110000003/the-babbage-papers https://collection.sciencemuseumgroup.org.uk/documents/aa110...
- bluGill 2y agoLovelace seems to be the first to use loops. Babbage clearly created something first, but without any looping they were by nature much less complex, and so you could make an argument they don't count as programs ("hello world" would only count as a program because the library print function is likely to have some loop in it by this argument). Of course not all of Babbage's programs survive, it is entirely possible Babbage did have loops in some earlier programs that Ada knew of when she wrote her programs. Ada had much correspondence with Babbage, so it is possible she wrote programs before the ones we know of, but they are lost as well, who knows. Bottom line Ada and Babbage were working together (though countries apart) and so would have been thinking about what this new thing could do while it was in design the phase. You can make whatever argument you want about first programmer. Ada was a smart person who clearly understood what this machine could do and had visions of the future of this machine. Even if you decide she wasn't actually the first programmer she is worth knowing about as an early pioneer.
- countrymile 2y agoAda was clearly incredibly intelligent. I can't source the original texts for Babbage's program, but it does seem that he was aware of loops, and might have implemented them: "In the absence of other evi- dence I have had to adopt the minimal default assumption that both the operation and variable cards can only be turned back- ward as is necessary to implement the loops used in Babbage’s sample programs cited in Ada Lovelace’s notes (originals in L series notations)" https://ieeexplore.ieee.org/document/887986 https://ieeexplore.ieee.org/document/887986
- stefantalpalaru 2y ago[dead]
- jonahx 2y agoThis insight was all the more remarkable given that Menabrea saw the Analytical Engine primarily as a tool for automating “long and arid computation,” which would free up the intellectual capacities of brilliant scientists for more advanced thinking. It's funny how enduring this trope about automation is. The same thing is said now of LLMs.
- coldtea 2y agoWell, isn't the main point of computers as tools (as opposed to consumption devices) the automating of “long and arid computation"?
- jonahx 2y agoI wasn't saying it's bad or untrue necessarily. Just funny how the same thing is said while the goalposts keep moving, buttressed by this vague, unspecified notion of "the real creative work" or "the things only humans are good it". And with current LLMs, and the spectre of even greater automated intelligence, our sphere of unique ability shrinks.
- digging 2y ago> more advanced thinking does not imply > vague, unspecified notion of "the real creative work" or "the things only humans are good it". It's just true that increasingly advanced tools enable increasingly advanced work.
- bluGill 2y agoAda Lovelace had the wisdom to die before computers that could run her programs were invented thus saving herself from having to debug her own code.
- shermantanktop 2y agoThe XKCD engineers sword-fighting on the chairs could offer that as an excuse I guess…
- stefantalpalaru 2y ago[dead]
- uberman 2y agoWhat I think is the coolest part is her actual work in the "notes" she attached to the translation. See: https://upload.wikimedia.org/wikipedia/commons/c/cf/Diagram_for_the_computation_of_Bernoulli_numbers.jpg https://upload.wikimedia.org/wikipedia/commons/c/cf/Diagram_... and: https://en.wikipedia.org/wiki/Note_G https://en.wikipedia.org/wiki/Note_G The article also references this python translation of her work: https://enigmaticcode.wordpress.com/tag/bernoulli-numbers/ https://enigmaticcode.wordpress.com/tag/bernoulli-numbers/
- 0points 2y agoHalf the article is about Note A and Note G.
- uberman 2y agoSure, but it is spoken about in the abstract. I enjoyed the article, but why not at least include "some" of the actual notes she wrote or at least a screenshot?
- stnmtn 2y agoThere was a link to directly to note G in the article, in fact, it's the exact same URL that you linked to.
- uberman 2y agoYes, and I said that explicitly in my post. The difference is in my post it is one of the featured things. In the article that claims to show what the program actually did it is buried in the text.
- deleted 2y ago[deleted]
- StableAlkyne 2y ago> The Difference Engine was not a computer, because all it did was add and subtract. The definition of computer is pretty grey for the pre-digital era, and it wasn't turing complete, but is it actually controversial whether it was a computer?
- exitb 2y agoDifference Engine basically implemented one algorithm in hardware, while Analytical Engine was supposed to run a program. I believe that could make the latter one a computer.
- jandrese 2y agoThe first stored program computer is a remarkable achievement, even if they didn't actually build it.
- Manuel_D 2y agoThe analytical engine wasn't a stored program computer. It most closely follows the Harvard architecture, with instructions read from punch card memory. The analytical engine's claim to fame is that it was the first Turing complete computer to be designed.
- area51org 2y ago> with instructions read from punch card memory If that isn't a stored program, I don't know what is.
- Manuel_D 2y agoA stored program computer refers to the computer architecture where program instructions and data are stored in the same memory. This is also referred to as the Von Neumann architecture. In contrast, a lot of early computers were built with separate instruction memory like punch cards. This is called the Harvard Architecture. If the instructions were immutable, which they usually were, then things like modifying the program at runtime were not possible. Concrete examples of this difference is the Harvard Mk 1 and the Manchester Mk 1, the former being a Harvard architecture computer and the latter is a stored program computer or a von Neumann architecture.
- jandrese 2y ago> In her “diagram of development,” Lovelace gives the fourth operation as v5 / v4. But the correct ordering here is v4 / v5. This may well have been a typesetting error and not an error in the program that Lovelace devised. All the same, this must be the oldest bug in computing. I marveled that, for ten minutes or so, unknowingly, I had wrestled with this first ever bug. The real mark of a non-trivial program is that it doesn't work on the first try. It's incredible how Babbage, frustrated that the mass production precision machining technology necessary to make his simple engine work didn't exist yet, decides that the best way forward is to design a new system an order of magnitude more complex and then go to Italy to find more advanced manufacturing somehow.
- deleted 2y ago[deleted]
- ChrisMarshallNY 2y agoI had an employee like that. He'd want to do something, and hit a roadblock, so he'd design his own tool (He wrote his own font, once, because he didn't like the way the built-in ones worked at teeny point sizes). Best damn engineer I ever knew, but I had to keep an eye out for rabbitholing.
- mrspuratic 2y agoI didn't just create my own font, I created a font editor too because nothing else was just right (context: MSDOS 5/VGA era). For clarity, I was not that employee :) Up until quite recently I used to render a fixed-width TrueType to bitmaps so I could fix some rendering and typographical foibles, in order to use it with rxvt. I too may have a rabbit-holing problem.
- jandrese 2y agoBabbage would have likely had more success if he stayed in England and opened his own precision machine shop.
- DemocracyFTW2 2y ago
- dkdbejwi383 2y ago> In fact, aside from the profusion of variables with unhelpful names, the C translation of Lovelace’s program doesn’t look that alien at all. Clearly the author never met my coworkers.
- seanhunter 2y ago...or worked with any mathematicians/physicists/engineers who program. As soon as I saw that, I thought "typical quant". Like my dad (A chemical engineer) learned to program in FORTRAN, which used to insist variable names were 1 letter and up to 2 digits. He later learned Basic, but his code was still spiritually FORTRAN so the one-letter-two digits thing stuck. I thought that was just him but then much later I went to work on Wall St and had to work with quants who were copying code out of "Numerical Recipes" and it was exactly the same just now in C.
- glouwbug 2y agoThat naming convention makes perfect sense to the mathematician, so why not? It's why we use `for(int i = i; i < n; i++)` in for loops; its the mathematical sigma sum of values with the same naming convention
- seanhunter 2y agoOh yeah. And if you're like my dad you call them "do loops" not "for loops"
- adrian_b 2y agoWhile the Americans have encountered first the "DO loops" of FORTRAN (1954), the "for loops" of ALGOL are derived from the earlier use in Europe of "for loops" in programming (actually "für loops", Heinz Rutishauser, 1951), which in turn had been preceded by the use in mathematics of the "for-all" quantifier (Gerhard Gentzen, 1935), which includes an implicit loop (and in many more recent programming languages, starting with Alphard in 1974, it is preferred for the most frequent loops to use a syntax essentially identical to the mathematical notation from 1935, i.e. like "forall X in A do ...").
- deleted 2y ago[deleted]
- neuronet 2y agoA really cool article. From the Intro: > She thought carefully about how operations could be organized into groups that could be repeated, thereby inventing the loop. She realized how important it was to track the state of variables as they changed, introducing a notation to illustrate those changes. As a programmer myself, I’m startled to see how much of what Lovelace was doing resembles the experience of writing software today. > So let’s take a closer look at Lovelace’s program. She designed it to calculate the Bernoulli numbers. To understand what those are, we have to go back a couple millennia to the genesis of one of mathematics’ oldest problems. It does a nice job getting into just enough detail to make you appreciate what she did. If she were alive today, you could imagine her down the hall grinding away on some problem in Rust (I have a feeling she'd have a strong preference for statically typed languages).
- int_19h 2y agoHowever much credit Ada deserves for her programming techniques, to me the thing that always stood out is her ability to see the big picture wrt computation: > Again, it [Analytical Engine] 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. Imagine coming up with this idea in 1842, a whole century before the first actual programmable computers would be built, based solely on a description of a prototype of a mechanical computer. This is hacking extraordinaire.
- JohnMakin 2y agoProgrammable looms (which used a type of punchcard) such as the Jacquard Loom had existed for a little while - if I recall she specifically referenced this as inspiration for some of her ideas. Not trying to diminish how impressive her work was, but I do believe some form of primitive mechanical computation had already been done for a little while.
- dang 2y agoDiscussed at the time (of the article): What Did Ada Lovelace’s Program Actually Do? - https://news.ycombinator.com/item?id=17797003 https://news.ycombinator.com/item?id=17797003 - Aug 2018 (52 comments)
- olddustytrail 2y ago> Discussed at the time (of the article) Thank you for that careful clarification. The discussion in "Bell's Life in London and Sporting Chronicle" was far less enlightening.
- eesmith 2y agoAlso relevant is "Untangling the Tale of Ada Lovelace" from December, 2015 at https://writings.stephenwolfram.com/2015/12/untangling-the-tale-of-ada-lovelace/ https://writings.stephenwolfram.com/2015/12/untangling-the-t... with 35 comments from the time at https://news.ycombinator.com/item?id=10709730 https://news.ycombinator.com/item?id=10709730 .
- glouwbug 2y agoHas anyone built a virtual machine out of Babbage's instruction set and then tried Ada's program?
- gregalt 2y agoHere's a blog series where I get her program running on a modern computer using a simple transliteration to C: https://pairdebuggingwithlovelace.hashnode.dev/ https://pairdebuggingwithlovelace.hashnode.dev/
- cchianel 2y agoJohn Walker built a virtual machine for the Babbage's instruction set, and it has a web emulator: https://fourmilab.ch/babbage/emulator.html https://fourmilab.ch/babbage/emulator.html. I don't think Ada program is available as an example though, so you'll need to input it manually. Fun fact: my compiler course project was creating a C compiler targeting the emulator https://github.com/Christopher-Chianelli/ccpa https://github.com/Christopher-Chianelli/ccpa (warning, said code is terrible).
- alanjay 2y agoNot quite, but this emulates her program. https://github.com/MarquisdeGeek/Ada-Origins https://github.com/MarquisdeGeek/Ada-Origins
- LeroyRaz 2y agoGood article. This is the clearest explaination I've read of how and why Ada was meaningfully innovative, and worthy of her recognition.
- rob74 2y ago> In 1975, Paul Allen flew out to Albuquerque to demonstrate the BASIC interpreter that he and Bill Gates had written for the Altair microcomputer. Because neither of them had a working Altair, Allen and Gates tested their interpreter using an emulator that they wrote and ran on Harvard’s computer system. The emulator was based on nothing more than the published specifications for the Intel 8080 processor. When Allen finally ran their interpreter on a real Altair—in front of the person he and Gates hoped would buy their software—he had no idea if it would work. But it did. So, the real unsung heroes here are the Intel engineers who wrote a spec that was so exact that software running on an emulator written based just on the spec would also run without a hitch on the actual hardware?
- sema4hacker 2y agoIn 1976 my first commercial programming job was converting a 8008 emulator written in Fortran to work on a Data General mini as an 8080 emulator, so another programmer writing 8080 firmware for a plotter could debug his code. The emulator source code originated with Intel as something called INTERP/8 8008, and I believe that's what Allen and Gates also used, as suggested in other online posts.
- kazinator 2y agoRegarding the dispute of whether Ada wrote the first program. On a related topic, I believe that credit for the invention of hashing should go to certain scholars in China. The invention of a data structure and algorithm must not be confused with its first implementation in electronic computers. For at least a century before the computing revolution, hashing was used in China to find characters in dictionaries. First, a character is examined, and reduced to a numeric code according to steps that constitute a hashing function. For instance the Four Corner Code. The code is then used to find a page or section of the dictionary by direct access: the mapping between codes and dictionary sections is straightforward. The character is then found within a small bucket of collisions by a linear search.
- poulpy123 2y agoShe certainly didn't write the first code, except if you think that babbage could have worked for year on his machine without ever writing a code. However the first program published that was designed to work on what is considered as a computer is under her name. As their names say, algorithms and code are much older
- lmm 2y agoThe Four Corner Code is not really a hash, just an index. Do you have evidence of the use of unnatural, random-looking "hash" functions for the sake of an even distribution? That's the key insight that makes a hash table what it is.
- firesteelrain 2y agoFour corner code is foundational to modern hash tables and helped with collision resolution.
- kazinator 2y agoThe 4cc gets a decent distribution in that you don't have to examine very many collisions to find the character you're looking for (or conclude it's not found). A poor distribution is an obvious bug in hashing; if you don't suffer from that bug, you don't have to do anything. If you have the bug, it's obvious you have to change your hash calculation to avoid it. The developers of 4cc may have struggled with bugs where they had buckets that were too large for efficient searching. Convoluted hashing functions are not always used for hash tables. When hash tables are pointers (e.g. object identities themselves are used as keys to associated objects with additional properties), sophisticated hashing functions are not needed; e.g. simply extracting a few bits of the pointer, avoiding the lowest bits (which might all be zero due to alignment!). I believe that the 4cc dictionaries hit upon the key insights of hashing: calculating a numeric key from an object which then directly identifies a small search bucket. The Four Corner Code abandons semantics like radicals. Codes are assigned according to certain stroke patterns in the four quadrants of the character, without regard for their semantic role. The inventors hit a key insight there: that any way of calculating a hash code is valid as long as it can be consistently followed, and leads to short searches. The function can look at meaningless fragments of the object (exactly like when we take the middle bits of a pointer). A character's etymology need not play any role in how it is digested. Whereas in the radical methods, you have to know that for instance 火 and 灬 both mean "fire" and are understood as the same radical #86. So in some sense, the predecessor methods like radical indexing may have been almost-hashing. It's hard to argue that 4cc isn't.
- readyplayernull 2y ago1 - 1 + 1 - 1 + 1 - 1... I rabbitholed with that years ago while playing around with Python, probabilities and infinity. That "thing" was discovered by a religious guy who thought it had something to do with God, as a series that created something from nothing, and harassed a famous Calculus mathematician for years to study it. I found it's related to Thomson's Lamp, and I'm convinced it hides the key to a new kind of Math, beyond quantum computing: supertasks. The deepest I went into the problem was classifying those supertasks like Grandi's, Thomson's, the sum of all natural numbers, and there are others, but they form patterns.
- poizan42 2y agoA bit of an aside I have been wondering about is what people called her in her own time. Her name was Augusta Ada King, and she was the Countess of Lovelace. Was it common back then to shorten the title into a last name, or is it only something we have been doing in more recent time?
- pacaro 2y agoFor the title holder, in this case the Earl of Lovelace, they are often referred to ("styled") simply by the place name. So after William King-Noel was created Earl.of Lovelace he was styled "Lovelace". She would have been styled "Lady Lovelace" in society, and "Countess of Lovelace" in formal contexts