Dartmouth BASIC

Dartmouth BASIC is the original version of the BASIC programming language. It is so named because it was designed and implemented at Dartmouth College. The language was designed by John Kemeny and Thomas Kurtz as part of the Dartmouth Time Sharing System (DTSS) and was the one of the first programming languages intended to be used interactively.

Several versions were produced over the years, all implemented as compilers by undergraduate teams working under the direction of the designers. The very first version was produced before the time-sharing system was ready. Known as CardBASIC, it was intended for the standard card-reader based batch processing system. 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.

The first interactive version implemented the following statement types, taking some of its operators and keywords from FORTRAN II and some from ALGOL 60.

Contents

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 am, 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 according to a 1974 interview in which John Kemeny and John 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. In 1976, Steve Garland added structured programming 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.

User interface

DTSS implemented an early integrated development environment (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 because of the use of teletypes as the terminal units for the Dartmouth Timesharing system.

List of commands

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

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

Keywords

List of statements

  • DEF -- for defining single line functions
  • DIM -- for defining the size of arrays
  • END -- for defining the end of the program
  • STOP -- for stopping a program before the textual end
  • FOR / TO / STEP -- for defining loops
  • NEXT -- for marking the end of loops
  • GOSUB -- for transferring control to simple subroutines
  • RETURN -- for returning control from simple subroutines
  • GOTO -- for transferring control to another statement
  • IF / THEN -- for decision making
  • LET / = -- for assignment of formula results to a variable
  • PRINT -- for output of results
  • DATA -- for storing data within the program
  • READ -- for input of data stored in DATA statements
  • REM -- for comments

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

Aritmetical operatorsRelational/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

  • INT -- Integer value
  • ABS -- Absolute value
  • SQR -- Square root value
  • SIN -- Sine value
  • COS -- Cosine value
  • ATN -- Arctangent value
  • LOG -- Natural Logarithmic value
  • EXP -- Exponential value
  • RND -- Random value

References

External links

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools