BASIC

From Maze

(Difference between revisions)
Jump to: navigation, search
(→A Brief History of Programming)
(→A Brief History of Programming)
Line 21:Line 21:
There is plenty of dispute about who should be rightly called the first computer programmer, but many have awarded this designation to Ada Byron, Lady Lovelace. She was brought up by her mother and educated extensively in mathematics and logic so that she might avoid becoming a poet like her father, Lord Byron. The struggle to keep computation apart from poetics and aesthetics, instead of allowing them to mingle as they do in 10 PRINT, has a long history.
There is plenty of dispute about who should be rightly called the first computer programmer, but many have awarded this designation to Ada Byron, Lady Lovelace. She was brought up by her mother and educated extensively in mathematics and logic so that she might avoid becoming a poet like her father, Lord Byron. The struggle to keep computation apart from poetics and aesthetics, instead of allowing them to mingle as they do in 10 PRINT, has a long history.
−
Her contributions as an early "programmer" can be found in her translation of and notes to an Italian article about Charles Babbage's Analytical Engine by Louis Menebrea. In this work, completed in 1843, she envisioned the Analytical Engine as a general-purpose computer and described an algorithm that could be used to output Bernoulli numbers. Although the computer Lovelace programmed was never built, and there is evidence that the algorithm in question was originally written by Babbage, Lovelace's project was important to the modern idea of the computer program. In it was the earliest concept of a program algorithm specified in mathematical notation.
+
Her contributions as an early "programmer" can be found in her translation of and notes to an Italian article about Charles Babbage's Analytical Engine by Louis Menebrea. In this work, completed in 1843, she envisioned the Analytical Engine as a general-purpose computer and described an algorithm that could be used to output Bernoulli numbers. Although the computer Lovelace programmed was never built, and there is evidence that the algorithm in question was originally written by Babbage, Lovelace's project was important to the modern idea of the computer program. This earliest concept of a program was of an algorithm specified in mathematical notation.
−
The computer programs that followed in the electromechanical and early electronic age of computing were quite a bit less intelligible, with a much less direct relationship to familiar symbols. The ENIAC, a fully electronic computer built at the University of Pennsylvania from 1943 to 1945, was programmed initially by plugging in an elaborate set of cables. [http://www.columbia.edu/acis/history/eniac.html] To run particular calculations, constants were then set using dials.
+
The computer programs that followed in the electromechanical and early electronic age of computing were quite a bit less intelligible, with a much less direct relationship to familiar symbols. The ENIAC, a fully electronic computer built at the University of Pennsylvania from 1943 to 1945, was programmed initially by plugging in an elaborate set of cables (da Cruz). To run particular calculations, constants were then set using dials.
−
The next step in programming was machine language. A program in machine language is simply a sequence of numbers. On the ENIAC, these were decimal (base 10) numbers, but different bases were used on other significant early systems. The EDVAC used binary; the ORDVAC, octal; and the BRLESC, sexadecimal. [Fifty years of Army computing by U.S. Army Research Laboratory, p. 62] In all of these cases, programmers needed to arduously determine the sequence of numbers that would constitute a program, writing something that did not look remotely human language at all. Each operation the computer was to perform corresponded to a number, while the operands, if there were any, were provided as similar numbers. For instance, to jump unconditionally to a particular absolute address, an opcode such as "76" (in base 10) is used, followed by two bytes specifying the address. In fact, this is the opcode used for an unconditional branch to an absolute address on the Commodore 64.
+
The next step in programming was machine language. A program in machine language is simply a sequence of numbers. On the ENIAC, these were decimal (base 10) numbers, but different bases were used on other significant early systems. The EDVAC used binary; the ORDVAC, octal; and the BRLESC, sexadecimal (Bergin p. 62). In all of these cases, programmers needed to arduously determine the sequence of numbers that would constitute a program, writing something that did not look remotely like human language. Each operation the computer was to perform corresponded to a number, while the operands, if there were any, were provided as similar numbers. For instance, to jump unconditionally to a particular absolute address, an opcode such as "76" (in base 10) is used, followed by two bytes specifying the address. In fact, this is the opcode used for an unconditional branch to an absolute address on the Commodore 64.
−
The first step toward more legible code arose in the second generation programming languages, assembly languages. Assembly allows the use of mnemonics for operators such as LDA ("load accumulator"), JMP ("jump"), and INC ("increment memory") to stand in for the less easily remembered numeric codes. On the Commodore 64, the letters JMP followed by an absolute address are converted by the assembler to "76" in a machine language program. The first assembler ran on Cambridge University's EDSAC, the first stored-program computer, in 1949. [http://liveforsinging.com/categoryA/language_history/assembly_language_history.html]
+
A more legible form of code arose in the second generation programming languages, assembly languages. Assembly allows the use of mnemonics for operators such as LDA ("load accumulator"), JMP ("jump"), and INC ("increment memory") to stand in for the less easily remembered numeric codes. On the Commodore 64, the letters JMP followed by an absolute address are converted by the assembler to "76" in a machine language program. The first assembler ran on Cambridge University's EDSAC, the first stored-program computer, in 1949 (Campbell-Kelly and Aspray p. 184).
−
Although cryptic compared to a high-level language such as BASIC, an assembler program is nevertheless much more comprehensible to a human than a machine language program is. While assembly is still used today in, for instance, programming firmware and in the demoscene, there are usually significant disadvantages to programming at this level. Programming in assembly highlights technical details of platforms and the transfer of values between memory locations and registers. Higher-level languages allow the programmer to concentrate on other matters, such as solving mathematical and scientific problems or mapping programs to business processes.
+
Although cryptic compared to a high-level language such as BASIC, an assembler program is nevertheless much more comprehensible to a human than a machine language program is. While assembly is still used today in, for instance, programming firmware and in the demoscene, there are usually significant disadvantages to programming at this level. Programming in assembly highlights technical details of platforms and the transfer of values between memory locations and registers. Higher-level languages allow the programmer to concentrate on other matters, such as solving mathematical and scientific problems or modeling business processes.
During the first decade of electronic computing, programming was still crawling toward the ideal of Lovelace's "programs" that specified algorithms in high-level, human-readable form. To reach a level of programming more appropriate for mathematical and scientific tasks, FORTRAN (Formula Translation) was specified in 1954 and first implemented in 1957. This language, and particularly the next version of it (FORTRAN II, which appeared in 1958), had a very strong influence on BASIC.
During the first decade of electronic computing, programming was still crawling toward the ideal of Lovelace's "programs" that specified algorithms in high-level, human-readable form. To reach a level of programming more appropriate for mathematical and scientific tasks, FORTRAN (Formula Translation) was specified in 1954 and first implemented in 1957. This language, and particularly the next version of it (FORTRAN II, which appeared in 1958), had a very strong influence on BASIC.
−
Programming languages were developed for other purposes as well. To address business uses, COBOL was specified in 1959 and implemented in 1960. FORTRAN and COBOL both allowed for more intelligible code than had assembly, but both were also developed for the context of batch processing for use with stacks of punched cards. Specifically, they were developed for what became known as simply "the IBM card," IBM's 1928 punched card that had 80 columns. (As explained in the chapter "Regularity," the Commodore 64's 80-column logical line, which appears as two 40-column lines on the screen, is one legacy of this early material medium for computing.) Programs written in early versions of COBOL and FORTRAN were specific to the punched card in certain ways: COBOL reserved columns 1-6 for the line number and column 7 for a continuation mark if the card's code ran on from the previous one. FORTRAN was similar, with columns 1-5 indicating the statement number. "Comments" (usually the program name) went in columns 73-80 in both languages; a "C" in the first column indicated that the whole FORTRAN card was to be considered a comment. Unless a programmer wrote a one-liner -- which in this case means writing a program that fits on a single card -- a COBOL or FORTRAN program would take the form of a stack, often a massive stack, of punched cards. These had to be punched on a keypunch machine and fed into a card reader by an operator. Line numbers were of great importance in one particular situation: if someone dropped the stack of cards and they needed to be sorted into order.
+
Programming languages were developed for other purposes as well. To address business uses, COBOL was specified in 1959 and implemented in 1960. FORTRAN and COBOL both allowed for more intelligible code, improving on assembly, but both were also developed for the context of batch processing, for use with stacks of punched cards. Specifically, they were developed for what became known as simply "the IBM card," IBM's 1928 punched card that had 80 columns. As explained in the chapter "Regularity," the Commodore 64's 80-column logical line, which appears as two 40-column lines on the screen, is one legacy of this early material medium for computing.
−
FORTRAN's GOTO command was the basis for the GOTO in the original BASIC (MoP p. 86), which of course was carried over into Commodore 64 BASIC. GOTO functions in the same way the assembly language JMP does. There is not much of an advantage to using BASIC if one is simply interested in easily writing JMP, but other BASIC commands, such as PRINT, allow one to very efficiently accomplish what would take very many machine-language operations.
+
Programs written in early versions of COBOL and FORTRAN were specific to the punched card in certain ways: COBOL reserved columns 1-6 for the line number and column 7 for a continuation mark if the card's code ran on from the previous one. FORTRAN was similar, with columns 1-5 indicating the statement number. "Comments" (usually the program name) went in columns 73-80 in both languages; a "C" in the first column indicated that the whole FORTRAN card was to be considered a comment. Unless a programmer wrote a one-liner -- which in this case means writing a program that fits on a single card -- a COBOL or FORTRAN program would take the form of a stack, often a massive stack, of punched cards. These had to be punched on a keypunch machine and fed into a card reader by an operator. Line numbers were of great importance in one particular situation: if someone dropped the stack of cards and they needed to be sorted into order.
 +
 +
FORTRAN's GOTO command was the basis for the GOTO in the original BASIC (MoP p. 86), which of course was carried over into Commodore 64 BASIC. GOTO functions in the same way the assembly language JMP does. There is not much of an advantage to using BASIC if one is simply interested in easily writing JMP, but other BASIC commands, such as PRINT, allow one to efficiently accomplish what would take very many machine-language operations.
The creators of BASIC hoped to develop a programming language for the next computing revolution, one that would go beyond punched cards and batch processing to allow numerous users interactive access to a system simultaneously. This revolution was time-sharing.
The creators of BASIC hoped to develop a programming language for the next computing revolution, one that would go beyond punched cards and batch processing to allow numerous users interactive access to a system simultaneously. This revolution was time-sharing.

Revision as of 20:39, 11 July 2011

View this revision of BASIC.

Personal tools