I've recently finished reading The Preparation of Programs for an Electronic Digital Computer. This book is an incredible resource for anyone interested in the history of computing and programming.
First published in 1951, a reprint is available from The Charles Babbage Institute. Often referred to as the first programming textbook, this book is reputed to have been very influential in the early days of computing, being affectionately known as WWG, after the initials of its authors.
WWG describes a computer called the EDSAC, built in Cambridge, England, along with the techniques that had been developed for programming it.
The EDSAC had only been operational for 2 years when WWG was published, so it's a fascinating peek into both the thinking of some of the very first programmers, and also into how quickly some of our standard programming techniques and problems were discovered.
Interpretive routines (what we might call "interpreters" or "virtual machines" these days) were used to make it easier to program with floating point numbers and complex numbers. Although the languages interpreted were very low level, they were meant to be written in by humans, so it also seems reasonable to also call these Domain Specific Languages. It's significant to me that these ideas were developed so early. Modifying our environment in order to fit our needs and wants is a fundamental human characteristic, but doing it purely within software seems like a breakthrough to me.
It's also interesting how quickly programmers started having problems with errors in their programs. The book contains "tracing routines" which will run a program at a tiny fraction of its normal speed, but print out what instructions the program is executing. They can even be configured to trace only certain sections of the code. These routines clearly took a great deal of effort to develop, and I can only imagine this effort being justified by a high rate of programming errors in the early programs.
Other techniques that this book proves to be very old include jump tables and binary/decimal conversions for I/O.
Although the EDSAC used single address instructions, WWG spends a little bit of space discussing other designs, including one where each instruction includes the address of the next instruction to be executed. Used on a storage medium like drum memory or acoustic delay memory where you need to wait for the correct data to become available, this could reduce waiting times. From a data structure perspective, this idea is interesting because it turns the code into a primitive sort of linked list threading its way through memory.
There's a whole section devoted to repetition. There are even subroutines specifically for the purpose of repeating a piece of code a given number of times. Apparently executing a loop the wrong number of times was also a problem right from the start.
It's also interesting how quickly conventions were developed around documentation and program design at Cambridge.
The program listings in the book show, next to each instruction, what instructions jump to that instruction. Apparently the difficulties of tracking jumps were recognized early and this was an effective aid in their management.
The book also contains documentation for a fairly extensive subroutine library. Subroutines were heavily relied upon to save labor, reduce mistakes, and allow the programmer to think about smaller parts of the program at once. This last purpose, explicitly stated in the book, foreshadows structured programming.
If you want to try out the EDSAC, check out the India simulator, which you can
run in your browser or download (alternate site).
This EDSAC simulator only runs on Windows (and old Macs) and doesn't come with source code, but has some very good documents about how the EDSAC worked.
Sunday, June 28, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment