Dartmouth BASIC
Encyclopedia
Dartmouth BASIC is the original version of the BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

. It is so named because it was designed and implemented at Dartmouth College
Dartmouth College
Dartmouth College is a private, Ivy League university in Hanover, New Hampshire, United States. The institution comprises a liberal arts college, Dartmouth Medical School, Thayer School of Engineering, and the Tuck School of Business, as well as 19 graduate programs in the arts and sciences...

. The language was designed by John Kemeny
John George Kemeny
John George Kemeny was a Hungarian American mathematician, computer scientist, and educator best known for co-developing the BASIC programming language in 1964 with Thomas E. Kurtz. Kemeny served as the 13th President of Dartmouth College from 1970 to 1981 and pioneered the use of computers in...

 and Thomas Kurtz
Thomas Eugene Kurtz
Thomas Eugene Kurtz is an American computer scientist who co-developed the BASIC programming language during 1963 to 1964, together with John G. Kemeny....

 as part of the Dartmouth Time Sharing System
Dartmouth Time Sharing System
The Dartmouth Time-Sharing System, or DTSS for short, was the first large-scale time-sharing system to be implemented successfully. DTSS was inspired by a PDP-1-based time-sharing system at Bolt, Beranek and Newman. In 1962, John Kemeny and Thomas Kurtz at Dartmouth College submitted a grant for...

 (DTSS) and was one of the first programming languages intended to be used interactively.

Several versions were produced at Dartmouth over the years, all implemented as compilers, unlike many of the versions of the language implemented elsewhere, which were interpreters
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

. The first compiler was produced before the time-sharing system was ready. Known as CardBASIC, it was intended for the standard card-reader based batch processing system. Like all the following versions, it was implemented by a team of undergraduate programmers working under the direction of Kemeny and Kurtz. The first interactive version was made available to general users in June, 1964; the second in October, 1964; the third in 1966; the fourth in 1969; the fifth in 1970; the sixth in 1971; and the seventh in 1979.

Development history

Work on the compiler and the operating system was done concurrently, and so the first BASIC programs were run in batch mode as part of the development process during early 1964. However on May 1, 1964 at 4 a.m. ET
Eastern Time Zone
The Eastern Time Zone of the United States and Canada is a time zone that falls mostly along the east coast of North America. Its UTC time offset is −5 hrs during standard time and −4 hrs during daylight saving time...

, John Kemeny and John McGeachie ran the first BASIC programs to be executed successfully from terminals by the DTSS system. It is not completely clear what the first programs were. However, the programs either consisted of the single line:

PRINT 2 + 2

or were implementations of the Sieve of Eratosthenes
Sieve of Eratosthenes
In mathematics, the sieve of Eratosthenes , one of a number of prime number sieves, is a simple, ancient algorithm for finding all prime numbers up to a specified integer....

, according to a 1974 interview in which Kemeny and McGeachie took part.

The second version of BASIC only made minimal changes, adding the semicolon operator to the PRINT statement and zero subscripts to arrays.

For the third version, the INPUT statement was introduced along with the powerful MAT statements for matrix manipulation and the RESTORE statement for use with READ/DATA. Development continued with the introduction of text manipulation and variables, also known as string variables, for version 4 and true file handling in version 5. Version 6 saw the introduction of separately compilable procedures with parameters; this is the version from which most later BASIC dialects descend. In 1976, Steve Garland added structured programming
Structured programming
Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops - in contrast to using simple tests and jumps such as the goto statement which could...

 features to create Dartmouth SBASIC, a precompiler which produced version 6 output (and which formed the basis of ANSI BASIC). In 1979 Kemeny and Kurtz released an ANSI BASIC compiler as the seventh and final version of BASIC at Dartmouth before leaving the college to concentrate on the further development of ANSI BASIC in the form of True BASIC
True BASIC
True BASIC is a variant of the BASIC programming language descended from Dartmouth BASIC — the original BASIC — invented by college professors John G. Kemeny and Thomas E...

.

The early versions of BASIC were used and tested by other Dartmouth students working in the College Psychology labs in early 1964. The departments shared several IBM card punch machines that were used to run batch statistical analysis programs.

Students working on NSF grants in both departments lived in the same rural New Hampshire farmhouse during the summer of 1964. They often met to share ideas. A notable contribution of these late night sessions was the GOTO statement
Goto
goto is a statement found in many computer programming languages. It is a combination of the English words go and to. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control...

. The earliest printed versions of the users' manual were mimeographed (with the typical purple
Purple
Purple is a range of hues of color occurring between red and blue, and is classified as a secondary color as the colors are required to create the shade....

 print of Ditto machines of the era) and had a pink
Pink
Pink is a mixture of red and white. Commonly used for Valentine's Day and Easter, pink is sometimes referred to as "the color of love." The use of the word for the color known today as pink was first recorded in the late 17th century....

 cover.

Dr. Kemeny, an immigrant from Hungary and chairman of the Mathematics department at the time, eventually went on to serve with great distinction as president of the college. Mr. McGeachie, an undergraduate at the time, was called "Geach" by his friends and colleagues.

User interface

DTSS implemented an early integrated development environment
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

 (IDE): an interactive command line interface. There was no need to log out. If users did not respond, they were logged out after a short delay.

Any line typed in by the user, and beginning with a line number, was added to the program, replacing any previously stored line with the same number; anything else was assumed to be a DTSS command and immediately executed. Lines which consisted solely of a line number weren't stored but did remove any previously stored line with the same number. This method of editing was necessary due to use of teleprinter
Teleprinter
A teleprinter is a electromechanical typewriter that can be used to communicate typed messages from point to point and point to multipoint over a variety of communication channels that range from a simple electrical connection, such as a pair of wires, to the use of radio and microwave as the...

s as the terminal units for the Dartmouth Timesharing system.

List of commands

  • HELLO — log in to DTSS
  • BASIC — start BASIC mode
  • NEW — name and begin writing a program
  • OLD — retrieve a previously named program from permanent storage
  • LIST — display the current program
  • SAVE — save the current program in permanent storage
  • UNSAVE — clear the current program from permanent storage
  • CATALOG — display the names of programs in permanent storage
  • SCRATCH — erase the current program without clearing its name
  • RENAME — change the name of the current program without erasing it
  • RUN — execute the current programs
  • STOP — interrupt the currently running program


The commands were often believed to be part of the BASIC language by users, but, in fact, were part of the time sharing system and were also used when preparing ALGOL or FORTRAN programs via the DTSS terminals.

Keywords

The first interactive version implemented the following statement types, taking some of its operators and keywords from FORTRAN II
Fortran
Fortran is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation and scientific computing...

 and some from ALGOL 60
ALGOL
ALGOL is a family of imperative computer programming languages originally developed in the mid 1950s which greatly influenced many other languages and became the de facto way algorithms were described in textbooks and academic works for almost the next 30 years...

.

List of BASIC statements

  • DEF — define single line functions
  • DIM — (short for dimension) define the size of arrays
  • END — define the end of the program
  • STOP — stop a program before the textual end
  • FOR
    For loop
    In computer science a for loop is a programming language statement which allows code to be repeatedly executed. A for loop is classified as an iteration statement....

    / TO / STEP
    — define loops
  • NEXT — mark the end of loops
  • GOSUB
    GOSUB
    GOSUB is a command in many versions of the BASIC computer programming language. A GOSUB statement jumps to a line elsewhere in the program. That line and the following lines up to a RETURN are used as a simple kind of a subroutine without parameters or local variables.The GOSUB command may be used...

    — transfer control to simple subroutines
  • RETURN
    Return statement
    In computer programming, a return statement causes execution to leave the current subroutine and resume at the point in the code immediately after where the subroutine was called, known as its return address. The return address is saved, usually on the process's call stack, as part of the operation...

    — return control from simple subroutines
  • GOTO
    Goto
    goto is a statement found in many computer programming languages. It is a combination of the English words go and to. It performs a one-way transfer of control to another line of code; in contrast a function call normally returns control...

    — transfer control to another statement
  • IF / THEN — decision making
  • LET / = — assign formula results to a variable
  • PRINT — output results
  • DATA — store static data within the program
  • READ — input data stored in DATA statements
  • REM — comment


It also implemented floating-point numeric variables and arithmetic. Variable names were limited to A to Z, A0 to A9, B0 to B9, ..., Z0 to Z9, giving a maximum of 286 possible distinct variables. Array names were restricted to A to Z only. Arrays did not need to be defined, but in the absence of a DIM statement they defaulted to 10 elements, subscripted from 1 to 10.

List of operators

Arithmetic operators Relational/logical operators
- Negation (unary op.) = Equal To
+ Addition <> Not Equal To
- Subtraction (binary op.) < Less Than
* Multiplication <= Less Than or Equal To
/ Division > Greater Than
^ Exponentiation => Greater Than or Equal To
Grouping operator
( ) Grouping

List of functions

  • ABS -- Absolute value
  • ATN -- Arctangent value (result in radians)
  • COS -- Cosine value (argument in radians)
  • EXP -- Exponential value
  • INT -- Integer value
  • LOG -- Natural Logarithmic value
  • RND -- Random value
  • SIN -- Sine value (argument in radians)
  • SQR -- Square root value
  • TAN -- Tangent value (argument in radians)

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK