Changes

Jump to navigation Jump to search
1,365 bytes removed ,  04:11, October 19, 2019
Remove stuff that was only in there to keep Ed Poor from blocking me. We can do better. In fact, we have a lot of good pages on computers now, and this is an important part of that.
Line 56: Line 56:  
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.
 
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?==
+
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.)
−
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.
+
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.
−
 
  −
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.
      
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.
 
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.
Line 95: Line 71:     
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.
 
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.
−
  −
==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?==
 
==Was Ada really first?  Was the Bernoulli program the first program?==
SkipCaptcha, Automoderated users, edit
3,266

edits

Navigation menu