
What Did Ada Lovelace’s Program Actually Do? - weebst
https://twobithistory.org/2018/08/18/ada-lovelace-note-g.html
======
zaroth
Holy shit. I got shivers the moment I realized Sinclair actually finds and
fixes a bug from the very first program written in 1843.

    
    
      In her “diagram of development,” Lovelace gives the
      fourth operation as v5 / v4. But the correct ordering
      here is v4 / v5. 
    

1843!

I was recently at the _Musee des arts et metiers_ in Paris, and they have
several original Pascalines on display. So many marvels packed into a very
tight space, it is one of my favorite in Paris and I would highly recommend
it. I'm not sure what they have on Lovelace, I'll admit I was pretty
overwhelmed with the collection. Their computer collection alone is a museums
worth, and they cover much, much more than just computer history (a lot of
mechanical engineering for starters). If they don't have this algorithm on
display, they absolutely should.

A leather-bound first edition Lovelace including this algorithm recently sold
for about $120,000. That actually seems like a bargain when you think about
the level of the accomplishment. [1]

I agree with OP that most likely the bug is in the transcription and not
present in the original manuscript.

[1] - [https://www.theguardian.com/books/2018/jul/24/ada-
lovelace-f...](https://www.theguardian.com/books/2018/jul/24/ada-lovelace-
first-edition-pioneering-algorithm-program)

~~~
kornish
What else would you recommend checking out in Paris by way of museums?

~~~
lostlogin
The National Museum of Natural History is unlike any other I’ve been to. It is
fairly worn out but is great. It is displayed in a very different t format to
what I’m used to.
[https://en.m.wikipedia.org/wiki/National_Museum_of_Natural_H...](https://en.m.wikipedia.org/wiki/National_Museum_of_Natural_History_\(France\))

Quiet and completely excellent, The Museum of Heritage and Architecture.
[https://www.unjourdeplusaparis.com/en/paris-culture/musee-
ci...](https://www.unjourdeplusaparis.com/en/paris-culture/musee-cite-de-
larchitecture-et-du-patrimoine-paris)

The Army Museum is worth a visit - it is interesting to see a less Anglo
centric view of the wars, particularly WW1. The paintings are deeply grim -
not ideal if you have young kids.
[https://en.m.wikipedia.org/wiki/Musée_de_l%27Armée](https://en.m.wikipedia.org/wiki/Musée_de_l%27Armée)

The Museum of the Middle Ages is currently being renovated but is well
regarded.
[https://en.m.wikipedia.org/wiki/Musée_de_Cluny_–_Musée_natio...](https://en.m.wikipedia.org/wiki/Musée_de_Cluny_–_Musée_national_du_Moyen_Âge)

Probably a candidate for best museum in the world, the Louvre is a great way
to completely waste a day with massive crowds, sore feet, food and water
shortages, closed exhibits, intense heat and even more crowds. Get a map ahead
of time and check that the things you want to see aren’t closed before you go.

~~~
jfk13
If you want to see an outstanding collection of art without having to face the
Louvre crowds, try the Musée d'Orsay: a vastly more pleasant experience, IMO.
[https://en.wikipedia.org/wiki/Musée_d%27Orsay](https://en.wikipedia.org/wiki/Musée_d%27Orsay)

------
kristoff_it
Great article. In some ways it reminds me of Jonathan Blow's presentation
titled "Truth in Game Design" [1]

The author is saying that Ada deserves the title of first programmer both
because she did publish an elaborate algorithm and because she understood the
potential of the Analytical Engine better than Babbage and Menabrea.

Jonathan Blow's presentation is more about that second point and how computers
(or rather, sufficiently complex dynamical systems) can "give you something
back that you didn't put in".

System theory is nothing new so it might not be exact equivalent of thinking
about engines that can compose music in 1842, but it seems to me that it is
not a widespread and well-understood concept as it should be, and that the
public opinion is re-discovering it mainly through Deep Learning advancements.

[1]
[https://www.youtube.com/watch?v=C5FUtrmO7gI](https://www.youtube.com/watch?v=C5FUtrmO7gI)

~~~
jl2718
Modesty by the creator is not due to lack of foresight, it is due to the exact
nature of their understanding.

------
imhoguy
Just for anyone curious there is attempt to build Babbage's Analytical Engine
started by John Graham-Cumming's Plan 28 project[0]. Currently there is a lot
of fragmented knowledge to be collected from the vast Babbage's writings. To
understand the size of the project here is the excerpt from their blog[1]:

>in the context of manufacturing methods Babbage calculates that the total
number of teeth to be formed for a store with 1,000 registers would be
1,800,000.

[0] [https://plan28.org/](https://plan28.org/)

[1] [http://blog.plan28.org/2018/05/spring-2018-report-to-
compute...](http://blog.plan28.org/2018/05/spring-2018-report-to-
computer.html)

------
acqq
The "C translation" of the program by the article author:

[https://gist.github.com/sinclairtarget/ad18ac65d277e453da5f4...](https://gist.github.com/sinclairtarget/ad18ac65d277e453da5f479d6ccfc20e)

It's definitely far from being trivial!

Also note the use of floats in the C version. A lot of simpler CPUs didn't and
still don't have floats.

Fascinatingly, the Analytical Engine's number representation was 40 digits
(and later: 50)(!) base 10 (but not "floating" but "fixed" point):

[https://www.fourmilab.ch/babbage/authentic.html](https://www.fourmilab.ch/babbage/authentic.html)

Moreover, a lot of simpler CPUs also don't have the "division" in the
"instruction set", the Engine has it!

Given the emulator already existing, maybe somebody will now create the cards
from Lovelace's program, and run it as intended?

[https://www.fourmilab.ch/babbage/emulator.html](https://www.fourmilab.ch/babbage/emulator.html)

~~~
corpMaverick
In case anyone missed it, these last two articles were written by John Walker.
Founder of Autodesk, Inc. and co-author of AutoCAD.

------
DoreenMichele
This is really a very gripping piece, and I'm not actually a programmer. It's
also interesting mathematically and just as general history, for lack of a
better term.

~~~
sedatk
I’m a programmer and respected Ada Lovelace simply because of her having the
title of the first programmer. Now I think she deserves more recognition
because she also envisioned the modern use of computers in everyday tasks.
Amazing.

------
jordigh
There is a very lucid graphical explanation of the hardware of the difference
and analytical engines functions in a lengthy appendix to The Thrilling
Adventures of Lovelace and Babbage. I really love this book and I can't
recommend it enough. I wish it were adapted into animation! It is historical
fantasy of the highest calibre.

[https://en.wikipedia.org/wiki/The_Thrilling_Adventures_of_Lo...](https://en.wikipedia.org/wiki/The_Thrilling_Adventures_of_Lovelace_and_Babbage)

------
rossdavidh
This is a great article, and I also found myself shuddering to think what
would happen if the world ever saw the first program I ever wrote (whatever
that was).

~~~
scarecrowbob
For me, that's no big deal:

10 PRINT "HELLO WORLD"

Even the horrible crap I wrote as an novice is probably less embarrassing to
me that the stuff I wrote as a journeyman who shoulda known better.

Thankfully, the most embarrassing things are, like, spending 2 days
configuring postfix and not realizing that I could just read the log files and
it tells me specifically what isn't working. A valuable lesson, but
embarrassment has its cost.

~~~
TangoTrotFox
Hahaha, mine:

    
    
        mov ah, 2
        mov dl, 7
        int 21
        int 20
    

Discovering that I could write my own programs with debug.com was earth
shaking. Picked up some decade old book on it at Half Price Books (which went
well with my decade old machine -- an 80s model IBM with integrated monochrome
green screen) and never looked back.

~~~
ktRolster
I can smell your program. All that new hardware around me. The smell of dot
matrix ink.

~~~
onemoresoop
Yes! I remember my first experience with a PC in the 80s was with a Robotron
8086 PC. It did emanate a smell and I could hear interesting mechanical sounds
from inside. The motherboard was huge and it had a small 14 inch monochrome
green monitor on top of it.

------
hackerbabz
> she made groups of operations and in the text of her note specified when
> they should repeat.

Does anyone know what "should repeat" means? Was the machine capable of
repeating or does this mean the human operator needed to do the repeating?

~~~
TangoTrotFox
You can see the exact 'program' here [1].

It's really just a series of mathematical steps with a store of values in
between. Notions that would have _clearly_ taken it from being a series of
mathematical steps, to a program, such as branching, looping, or jumping are
left completely unspecified. So her 'loop' was specified literally as "here
follows a repetition of operations 13-23".

In other words, "should repeat" is left an as exercise to the reader.

[1] - [https://i.imgur.com/HSWjbUl.jpg](https://i.imgur.com/HSWjbUl.jpg)

~~~
NeedMoreTea
It's easy to be dismissive from today's perspective, but I think it adequately
conveys the algorithm. As I don't think Babbage ever published an instruction
set I'm not sure it could have gone a lot further.

------
farhanhubble
Amazing article! There's a bug in it though. The LHS of the sum of cubes
formula ends in n^2 instead of n^3.

~~~
lokedhs
There is an error in the squares formula as well. The correct formula is:

    
    
        (n*(n+1)*(2*n+1))/6.

~~~
weebst
Thanks a lot for pointing these out! I've corrected them.

