How was the first program ever written?
Hi,
after learning some programming languages, I got to philosophizing a bit. The first python interpreter was written in C (I think?) and the first C compiler was written in ASM. But in which language was the first assembler written? That's what I don't understand, because humans cannot write machine language directly (Can anyone? Looking at binary files opened with less, I don't think anyone could understand or even write even a simple app that way - not to think about a compiler). So how was that made? I hope the question isn't too dumb to be answered. It's not technical, but rather just an "understanding" question. |
Mybe these 2 links will shed some light:
- How was the first compiler written? - Bootstrapping (compilers) |
Quote:
Daniel B. Martin |
Quote:
You write your program on paper using assembly or hexadecimal values. I've done that, and it's not that hard for a small program. You then transfer those values to the computer somehow. The first computers were programmed with physical switches, each switch corresponding to one bit. Of course, entering large programs using switches would take ages, so the first program you make is one that can accept input from another source. Then perhaps you use that input to feed the computer a hex editor program, then use that to make an assembler, and so on. |
Quote:
something like Code:
0xad05 Code:
lda $05 ; load the accumulator with a value of 5 Code:
int apples=5; Code:
select count from food where fruit = apple |
Quote:
I have disassembled many programs by hand from machine code to symbolic assembly language too. I had access to an Altair 8800 back in the early '80s also. Machine language programs had to be toggled in through switches on the front panel. All those programs had to be hand-assembled on paper first before entering them. When you turned off the computer, they were gone. At least, until floppy drives (8 inch) and drivers for cassette tape were available, and then they could be saved and reused. |
Bootstrapping must be done in the real world as much as in the virtual world. How were the first tools built ? By hand, piece by agonizingly tedious piece.
|
Maybe they used a binary keyboard?
|
As might be expected, the first computer program was written by the first computer programmer.
Refer to http://en.wikipedia.org/wiki/Ada_Lov...mputer_program Daniel B. Martin |
ENIAC was programmed largely by hardwiring plugboards and setting switches on "portable function tables".
http://www.columbia.edu/cu/computinghistory/eniac.html |
Augusta Ada King, the Countess of Lovelace is arguably (of course ...) the world's first computer programmer. She wrote programs for Charles Babbage's never-completed, steam-driven Difference Engine and Analytical Engine. By hand. It is unknown whether her programs contained any syntax errors. ;)
|
^ programmable loom came first, didnt it ?
|
Quote:
http://www.quadibloc.com/comp/panint.htm |
Quote:
Long ago computers had toggle switches on their front panels to let you directly store data/programs into memory while the computer was halted. I not only wrote programs in machine language, I also inserted such programs into the computer via the front panel toggle switches. Later computers had loader programs stored in ROM chips, so you could type machine language programs in hex to get them into memory. I did a lot of that as well. I never wrote anything as complicated as a compiler directly in machine language. Turing did. I'm not sure whether anyone else has. A multi layered bootstrap process is easier. Once I did the full process of bootstrapping to a high level language compiler myself: Write a crude assembler in machine language: Write a better assembler in that crude assembly language. Write the compiler for a usable subset of a high level language in that assembler. Rewrite that, plus some extra language features in that subset language. Enhance the language and compiler together, using new language features to support newer language features. |
Writing a program using switches was really not so tedious, when the computer had something like 512 registers.
(Those days memory locations were called registers - or rather the computer only had registers, and if there were many of them, they were implemented as memory.) |
All times are GMT -5. The time now is 11:21 AM. |