What did Ada Lovelace's program actually do? (2018)
twobithistory.org
twobithistory.org
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.
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.
Wonder how many folks here have done the same thing, building and discarding in the throes of creation like tibetan monks:
I am still using a custom mouse cursor I made almost 20 years ago.
I got the idea from another cursor I'd seen back then, and the basic tail was based on it. I think I did the animated ones, the blue dot was my own addition, and the fox head is entirely my own creation.
It doesn't actually flicker in and out like that, it seems to be some quirk from recording it.
An example that comes to my mind is the Rust library mio. The Metal database for which it was the I/O component never materialized. But mio is a core component in the Rust ecosystem.
Similarly, many applications could benefit from a font that's legible at tiny sizes, not just the one that it was developed for. (Though obviously in most work cultures, this would be considered inappropriate, and for good reasons. My remarks apply mostly to greenfield research/personal projects where deadlines are loose.)
This guy has a high school diploma, and regularly stunned the Ph.Ds in Japan.
Only you'd know but that seems rather uncharitable.
I think maybe Java wasn't his first language. But to me, not realizing that Java would have something like System.out.println was a bad sign.
That's similar to how Donald Knuth came up with TeX and Metafont.
I think that he has an ID here, so we could probably ask him. It's a very good tool.
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.
not true.
(1) he was let down by precision machining not existing (Tim Robinson https://www.meccano.us/difference_engines/rde_1/ says that "I have no doubt that if the Meccano of the 1920's had existed 100 years earlier, Babbage would have been entirely successful in his quest"), and
(2) he designed a more complex system, tried Italy, etc,
I don't think it's fair to say that he decided that (2) was the best way forward from (1); it's rather that both were consequences of his ideas outpacing what was realistically feasible: he was a software guy thrust into hardware, coming with up ideas that seemed straightforward and discovering that manufacturing was impossible. Apart from his lack of business/project-planning sense (scope it down; don't aim for 10 digits etc), I think other complicating factors that went into the tragedy of Babbage were:
(1) He kept coming up with new/better ideas and pursued them (basically rabbitholing as mentioned),
(2) He had won a bunch of awards at a young age simply for proposing the Difference Engine (everyone could see it was a good idea and also seem to have expected it to be straightforward to build: a fait accompli) — so in the intervening decades he must have felt like he couldn't give up,
(3) He got entangled with the government. IMO the tragedy here is that he was just middle-class enough to have a romantic idea of government: while the nobles distrusted government/politics as they sort of looked down on it, and the lower classes distrusted government as it had never done anything much for them, he was of just the right class (his father came from humble origins and had made money in banking) to have patriotic notions of government and all that — he wanted to offer his invention to "the nation" (government), and conversely thought the government "ought to" reward him for it, rather than understanding the practical problems of government officials in funding his project. (The government offered to give his invention back to him, but he refused.)
(4) Possibly as a result of these awards, he seems to have been attached to the idea of being a "smart" person (many examples, e.g. the anecdote quoted in one of the appendices in Sydney Padua's wonderful book, where he refused to judge an award along with Faraday — he thought he "deserved" to be the sole judge) — this also probably got in the way of doing practical things rather than pie-in-the-sky "genius-type" ideas.
I think the government entanglement is probably a big part of the story (he asked them basically "I haven't completed the Difference Engine but I have a much better Analytical Engine that I could implement with more money, what should I do?" and they sat indecisively for twenty years!), and it's interesting to read his accounts (in his memoirs) vs others', e.g. Lord Playfair's account from the same appendix:
> "He was in chronic war with the Government because it refused to furnish supplies for his new machine, the ground of refusal being that he never completed the first. […] Babbage always considered himself a badly treated man, and this feeling at last produced an egotism which restricted the numbers of his friends. […] Babbage, who was delighted with the suggestion, but made it a condition that he alone should be appointed, as a reparation for all the neglect of the Government towards his inventions. Even the association of such a distinguished man as Faraday would take away from the recognition which was due to him."
Anyway Padua's book (The Thrilling Adventures of Lovelace and Babbage) seems very well-researched (I admit I haven't read much of it but read all the appendices in detail; would strongly recommend anyway).
> 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).
> 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.
What Ada is saying here is that, once you have a machine that let you do generic operations on numbers, you can use it to do all kinds of non-math stuff so long as you can come up with ways to encode other things as numbers (= finite sets of symbols). This was not at all obvious to other people who worked on the Engine, including Babbage himself.
The thing that really stuck out to me was how similar it was to static single assignment. https://en.wikipedia.org/wiki/Static_single-assignment_form#...
I think this is a state-of-the-art technique today and she had it, what, 180 years ago?
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?
See: https://upload.wikimedia.org/wikipedia/commons/c/cf/Diagram_...
and: https://en.wikipedia.org/wiki/Note_G
The article also references this python translation of her work:
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.
Clearly the author never met my coworkers.
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.
(I suspect the latter)
Still amazed that the nearly-incomprehensible code (and the port) worked
Incidentally, the various Autocode languages of the 1950s in Britain had 1-character variable names.
I HAD to of course name all of my variables as poets and poems.
So you have "Edgar_Allen gets new The_Road_Not_Taken", all was fine during my tests but for some reason it did not interface well with the code provided by the teacher to do the actual input so I had to take it to the TA for help.
I then learnt why descriptive names, not just comments are helpful. Although, the TA was impressed by my selections XD
It's funny how enduring this trope about automation is. The same thing is said now of LLMs.
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.
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.
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 (warning, said code is terrible).
What Did Ada Lovelace’s Program Actually Do? - https://news.ycombinator.com/item?id=17797003 - Aug 2018 (52 comments)
Thank you for that careful clarification. The discussion in "Bell's Life in London and Sporting Chronicle" was far less enlightening.
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.
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?
If that isn't a stored program, I don't know what is.
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.
The "Harvard architecture" had nothing to do with Harvard and it was not a novel thing. Having separate memories for programs and for data has been the standard structure for all programmable computers that have been made before the end of WWII, in all countries, and the methods for storing computer programs had been derived from those used in programmable looms and in the much earlier music boxes, which are the earliest programmable sequencers. Like the computer keyboards have a history of millennia since their origin in musical instruments (i.e. organs), the computer program memories have also their origin in (automatic) musical instruments, more than a millennium ago.
So, did Pong run on a computer?
Mathematicians for 150 years: Ada Lovelace is kind of on top of it.
Random from 2024: probably just a diversity footnote.
Meanwhile Ada over here going "Oh shit this can do literally anything that can be done by steps of math. Someday machines following that formula will make music"
Ada is not the first programmer. Ada is the first computer scientist. She understood the ramifications of what we would eventually call "turing complete" systems, and understood the value of "general purpose" in a general purpose computer, and seemingly understood that more than just numbers could be represented and calculated in a computer.
> All but one of the programs cited in her notes had been prepared by Babbage from three to seven years earlier. The exception was prepared by Babbage for her, although she did detect a "bug" in it. Not only is there no evidence that Ada ever prepared a program for the Analytical Engine, but her correspondence with Babbage shows that she did not have the knowledge to do so.
> Bruce Collier wrote that Lovelace "made a considerable contribution to publicizing the Analytical Engine, but there is no evidence that she advanced the design or theory of it in any way"
The common claims are that Ada Lovelace was the first person to write a computer program, or that she was actually the primary driver in developing the analytical engine. Both such claims fall into the area "DEI retcon" as you choose to phrase it.
Although on a more pedantic note, Babbage wasn't the first person to program a computer either. Computers that aren't Turing complete are still computers. The Jacquard loom is one such example, and unlike the analytical engine it was actually built and put to practical use.
It was not the case. She was translating someone else’s article, and it does not seem she did it under direction or supervision.
> so many people assume it was her work and not Babbage's.
What she did was quite common. She had ideas about the thing she was translating and thus added them as notes. All fairly straightforward.
> the obsession with attributing the first ever computer program to her seems entirely ideologically motivated.
To me the obsession that some people (not you, but some definitely do and use the same arguments) have with bringing her down is entirely ideologically motivated. She was recognised for a long time, and while there are discussions about exactly who was first and such (as there always are when discussing History), her role was mostly uncontroversial. Also bear in mind that calculator and then programmer were women’s jobs until some point in the 2nd half of the 20th century. Having a woman write code was not controversial before the establishment of the bro culture.
There really aren't more of those than there are people trying to give more credit to those women than there is evidence for. In the end there are foul play from both sides, but currently one side is dominating academia so there is much more need to argue against that side than the other.
That doesn't line up with my life experience at all. Do you have any evidence to support that assertion?
I understand and support steel-manning arguments in order to test one’s own convictions. But applied in actual debates with actual consequences, at some point you end up as the kneejerk contrarian that nobody takes seriously, and that undermines the truth seeking aspect of discussion.
Earlier comment expressing annoyance at a mislabeling:
Often you'll hear about fully homomorphic encryption (FHE) being Turing-complete. But you can't actually have a Turing complete system with variable-run-time loops that's homomorphically encrypted, because that leaks information about the inputs.
When they say FHE is Turing-complete, what they mean is that you can take an arbitrary program requiring Turing completeness, then time-bound it, unroll it into a fixed-length circuit, and run that homomorphically. Since you can keep upping the time bound, you can compute any function. So the system that translates your programs into those circuits, with no limit on the bound you set, could then be called Turing-complete -- but you couldn't say that about any of those circuits individually.
Earlier related comment: https://news.ycombinator.com/item?id=40078494
Does the iterative method used by the difference engine constitute a 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.
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.
Right, but if you don't have and solve that problem then what you have made isn't a hash table. Often you don't need a hash table - if you have something that already has a nice distribution, you can use a simpler data structure (like, IDK, a radix tree) and get all the properties you wanted.
> 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.
If they did, then I would agree you're right. But do we know that they did? Or might they have seen it as just a different way of considering radicals? (E.g. did they ever try indexing anything else that way, not just characters?)
The key aspect of the four corner code is that it mashes together completely unrelated characters. There's no meaningful index to it. It's not easy to look at a four corner code to figure out the list of characters it aliases for.
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, thoughhttps://collection.sciencemuseumgroup.org.uk/documents/aa110...
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.
"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)"