Hacker News new | ask | show | jobs
by neuronet 546 days ago
A 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).

2 comments

However 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.

I agree, this is the thing that stood out to me. There's this kind of amazing leap you have to do to understand how computers do what they do. How does a thing that adds and subtracts numbers paint pictures? Once you grasp that you can transform those things into numbers and then operate on them, the whole world of computation opens up. It's amazing Ada was thinking about this 100 years before computers really existed.
I agree she was a visionary, but take note that by the time she was active, people were already building complex mechanical automata that executed stored programs implemented using cams and gears: https://en.wikipedia.org/wiki/Jaquet-Droz_automata (see also https://en.wikipedia.org/wiki/Maillardet%27s_automaton). I think a small number of very intelligent people would see Babbage's work and Jaquet-Droz and conclude "hmm, if we mash these together with some creativity, it seems reasonable the result would be a programmable automaton capable of painting".
Programmable 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.
Jacquard loom was indeed well-known, and one of the sources of inspiration for Babbage, but it is still fundamentally about designing a system around a specific task - the cards directly encode operations on hooks.

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.

Given that the looms’ punched cards already represented non-math stuff, the thought wasn’t entirely far-fetched.
Tide prediction machines came about 30 years later as an application of the "science of harmony".
> She realized how important it was to track the state of variables as they changed, introducing a notation to illustrate those changes.

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?

Well, if you do it manually, it was never not an option!