HOME

TheInfoList



OR:

Dartmouth BASIC is the original version of the
BASIC BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
. It was designed by two professors at
Dartmouth College Dartmouth College (; ) is a private research university in Hanover, New Hampshire. Established in 1769 by Eleazar Wheelock, it is one of the nine colonial colleges chartered before the American Revolution. Although founded to educate Native ...
, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time Sharing System (DTSS), it offered an interactive programming environment to all undergraduates as well as the larger university community. Several versions were produced at Dartmouth, implemented by undergraduate students and operating as a compile and go system. The first version ran on 1 May 1964, and it was opened to general users in June. Upgrades followed, culminating in the seventh and final release in 1979. Dartmouth also introduced a dramatically updated version known as Structured BASIC (or SBASIC) in 1975, which added various
structured programming Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection ( if/then/else) and repetition ( ...
concepts. SBASIC formed the basis of the
ANSI The American National Standards Institute (ANSI ) is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organi ...
-standard Standard BASIC efforts in the early 1980s. Most dialects of BASIC trace their history to the Fourth Edition (which added e.g. string variables, which most BASIC users take for granted, though the original could print strings), but generally leave out more esoteric features like matrix math. In contrast to the Dartmouth compilers, most other BASICs were written as
interpreters Interpreting is a translational activity in which one produces a first and final target-language output on the basis of a one-time exposure to an expression in a source language. The most common two modes of interpreting are simultaneous interp ...
. This decision allowed them to run in the limited
main memory Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers. The central processing unit (CPU) of a comput ...
of early
microcomputer A microcomputer is a small, relatively inexpensive computer having a central processing unit (CPU) made out of a microprocessor. The computer also includes memory and input/output (I/O) circuitry together mounted on a printed circuit board (PC ...
s.
Microsoft BASIC Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first ...
is one example, designed to run in only 4 KB of memory. By the early 1980s, tens of millions of home computers were running some variant of the MS interpreter. It became the ''de facto'' standard for BASIC, which led to the abandonment of the ANSI SBASIC efforts. Kemeny and Kurtz later formed a company to develop and promote a version of SBASIC known as True BASIC. Many early mainframe games trace their history to Dartmouth BASIC and the DTSS system. A selection of these were collected, in
HP Time-Shared BASIC HP Time-Shared BASIC (HP TSB) is a BASIC programming language interpreter for Hewlett-Packard's HP 2000 line of minicomputer-based time-sharing computer systems. TSB is historically notable as the platform that released the first public ve ...
versions, in the People's Computer Company book ''What to do after you hit Return''. Many of the original source listings in '' BASIC Computer Games'' and related works also trace their history to Dartmouth BASIC.


Development history


Earlier work

John G. Kemeny joined the mathematics department of Dartmouth College in 1953 and later became its department chairman. In 1956 he gained access to an
IBM 704 The IBM 704 is a large digital mainframe computer introduced by IBM in 1954. It was the first mass-produced computer with hardware for floating-point arithmetic. The IBM 704 ''Manual of operation'' states: The type 704 Electronic Data-Proce ...
via MIT's New England Regional Computer Center efforts. That year, he wrote the DARSIMCO language, a version of assembler which simplified the programming of mathematical operations. He was aided by Thomas E. Kurtz, who joined the department that year. DARSIMCO was forgotten when the first FORTRAN compiler was installed on the machine in 1957. The arrival of FORTRAN instilled an important lesson. Kurtz, having been indoctrinated that FORTRAN was slow, spent several months writing a program in 704 assembler which had taken up about an hour of CPU time to debug and still wasn't running. Giving up, he rewrote it in FORTRAN and had it running in five minutes. The lesson was that high-level languages could save time, regardless of their measured performance. In 1959, the school received its first computer, the drum-based
LGP-30 The LGP-30, standing for Librascope General Purpose and then Librascope General Precision, was an early off-the-shelf computer. It was manufactured by the Librascope company of Glendale, California (a division of General Precision Inc.), and s ...
. One student wrote a FORTRAN-inspired language called DART for the machine. This led to an effort to produce an ALGOL 58 compiler, turning to
ALGOL 60 ALGOL 60 (short for ''Algorithmic Language 1960'') is a member of the ALGOL family of computer programming languages. It followed on from ALGOL 58 which had introduced code blocks and the begin and end pairs for delimiting them, representing a ...
when that definition was finalized. Writing the compiler was difficult due to the very small memory size, 32 KB in modern terms, and was extremely slow, based on the drum speed of 30 rpm. Nevertheless, they were able to produce a functional cut-down version known as ALGOL 30. Further development produced SCALP, the "Self-Contained Algol Processor", a one-pass compiler that was ready to run the compiled program as soon as the
punched tape Five- and eight-hole punched paper tape Paper tape reader on the Harwell computer with a small piece of five-hole tape connected in a circle – creating a physical program loop Punched tape or perforated paper tape is a form of data storage ...
finished reading in the source. Output with the program results or any error messages would immediately appear. This compile-and-go style of operation would later be used by BASIC. In 1962, Kemeny and high-school student Sidney Marshall began experimenting with a new language, DOPE (Dartmouth Oversimplified Programming Experiment). This used numbered lines to represent instructions, for instance, to add two numbers, DOPE used: 5 + A B C Which meant "on line 5, perform an addition of the values in variables A and B and put the result in C". Although somewhat cryptic in layout, the basis for the future BASIC language can be seen. In addition to basic mathematical operations, the language included SQR, EXP, LOG, SIN and a simple branching construct.


Computing in liberal arts

Kemeny and Kurtz agreed on the need for programming literacy among students outside the traditional
STEM fields Science, technology, engineering, and mathematics (STEM) is an umbrella term used to group together the distinct but related technical disciplines of science, technology, engineering, and mathematics. The term is typically used in the context of ...
; only 25% of the students at Dartmouth took STEM-related courses, but some level of mathematics was used in almost every field. Moreover, as computers became more important in society, they wondered "How can sensible decisions about computing and its use be made by persons essentially ignorant of it?" Kemeny later noted that "Our vision was that every student on campus should have access to a computer, and any faculty member should be able to use a computer in the classroom whenever appropriate. It was as simple as that." But doing so would be largely impossible given what they had to work with; the turnaround on a typical SCALP run was about 15 minutes, and the languages were far too difficult for non-STEM users to use for basic tasks. It wasn't simply the complexity that was a problem, it was the entire concept of the
batch processing Computerized batch processing is a method of running software programs called jobs in batches automatically. While users are required to submit the jobs, no other interaction by the user is required to process the batch. Batches may automatically ...
. Students would prepare their programs on punch cards or paper tape, submit them to the computer operators, and then at some future point receive their output. This would often reveal an error that required the entire process to be repeated. As they later put it, "If it takes on the order of 1 day for one try, the student will either lose interest or forget what the problems were. At best, he will waste time standing around waiting for the day's results to appear." In 1959, due largely to Kemeny's reputation as an innovator in math teaching, the department won an
Alfred P. Sloan Foundation The Alfred P. Sloan Foundation is an American philanthropic nonprofit organization. It was established in 1934 by Alfred P. Sloan Jr., then-president and chief executive officer of General Motors. The Sloan Foundation makes grants to suppor ...
award for $500,000 to build a new department building.


Developing the concept

During a 1961 visit to MIT, they were introduced to the
PDP-1 The PDP-1 (''Programmed Data Processor-1'') is the first computer in Digital Equipment Corporation's PDP series and was first produced in 1959. It is famous for being the computer most important in the creation of hacker culture at Massachusett ...
and its recently completed experimental time-sharing
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
. John McCarthy asked Kurtz why they didn't use time sharing for their efforts to bring computing to the masses. Kurtz returned to Dartmouth and told Kemeny "we should do time sharing", to which Kemeny immediately replied "OK". In an experiment to test whether the concept was workable, students were broken into groups of five and given turns on the LGP-30 using SCALP. Computer time was broken into 15-minute sessions and each group of five was given one session and then turned it over to the next group. It was found that students could generally complete their programs in two or three "turnarounds" during a single session. This clearly suggested that an interactive system would allow hundreds of users to successfully use a single machine. The arrival of the
Teletype Model 33 The Teletype Model 33 is an electromechanical teleprinter designed for light-duty office use. It is less rugged and cost less than earlier Teletype machines. The Teletype Corporation introduced the Model 33 as a commercial product in 1963 af ...
teleprinter A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
using the newly introduced
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
over telephone lines solved the problem of access; no longer would the programmers have to submit the programs on cards or paper tape, they would now use the Model 33 to type directly into the computer. All that was needed was a new machine that was fast enough to host a time-sharing system, and a simple language for the programmers to use. When the topic of a simple language began to be considered seriously, Kemeny immediately suggested writing a new one. Kurtz was more interested in a cut-down version of FORTRAN or ALGOL. But these languages had so many idiosyncrasies that Kurtz came to agree with Kemeny: Over time, four key elements emerged; the system would use time-sharing, a new language would be needed, to get users onto the system new courses would introduce programming as an adjunct to other subjects, and finally, the terminals would be open to all users.


Initial version

The project officially started in September 1963. The goal was to develop the language and operating system on an off-the-shelf computer. In early 1964, they approached the
National Science Foundation The National Science Foundation (NSF) is an independent agency of the United States government that supports fundamental research and education in all the non-medical fields of science and engineering. Its medical counterpart is the National ...
(NSF) for funding. The NSF sent the proposals, one for the time sharing system and another for the language, out for peer review. The reviews invariably suggested they did not understand the difficulty of what they were attempting. In spite of these negative comments, the NSF went ahead with both grants. Educational discounts available from
General Electric General Electric Company (GE) is an American multinational conglomerate founded in 1892, and incorporated in New York state and headquartered in Boston. The company operated in sectors including healthcare, aviation, power, renewable ene ...
led to the purchase of a GE-225 computer, in an era when not "going IBM" was still fraught with peril. The GE-225 was paired with the much simpler DATANET-30 (DN-30) machine and a
hard drive A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with mag ...
connected to both machines in order to share programs. The DN-30 lacked any programming documentation at the time, as it was never intended to be shipped from the factory without a program already installed. It included one key feature,
direct memory access Direct memory access (DMA) is a feature of computer systems and allows certain hardware subsystems to access main system memory independently of the central processing unit (CPU). Without DMA, when the CPU is using programmed input/output, it is ...
(DMA) access to the larger GE machines. This meant small messages could be quickly passed back and forth between the machines, allowing commands typed by the user to be immediately performed by the 225. The system would work by having the DN-30 run the terminals and save the user's work to the disk. When the user typed RUN, the DN-30 would use DMA to send that command to the GE-225. The 225 would read that file, compile it, run it, and pass back the results to the DN-30 which would print the output on the terminal. In the summer of 1963, pending the purchase of the computer, GE provided access to one of their GE-225s. Kemeny began working on a prototype compiler. Students Michael Busch and John McGeachie began working on the operating system design that fall. Both the language and the OS were extensively modified during this period, although the basic goals remained the same and were published in a draft form that November. The school's machine arrived in the last week of February 1964, was operational by mid-March, and officially handed over on 1 April. By that point, the operating system design was already well developed. Most of the student programmers working on the operating system did so for 50 hours a week, in addition to their normal course load. The language was developed in parallel on borrowed time on another 225 machine. The OS was completed in April, and the entire system running on three Model 33 terminals was ready by the end of the month. John Kemeny and John McGeachie ran the first BASIC program on 1 May 1964 at 4 a.m. ET. It is not completely clear what the first programs were. Many sources, including Dartmouth, claim it was this simple program: PRINT 2 + 2 A later history of the language states that two programs were typed in at the same time, one by Kemeny and one by another unnamed programmer. They typed in their programs, typed at the same time, and received the correct results. Kurtz was an early riser and had already gone home and "missed all the fun." Over the next month the system was tested by having a numerical analysis class test programs on the system. During this period, the machine remained running properly for an average of five minutes. The problems were rapidly addressed, and in June it was decided to increase the number of terminals to eleven. It was around this time that a faster GE-235 replaced the 225. By the fall, 20 terminals were in use. GE began to refer to the combination of GE-235 and DN-30 as the GE-265, adding their model numbers together. GE built about 75 additional examples of the GE-265, many for their
service bureau A service bureau is a company that provides business services for a fee. The term has been extensively used to describe technology-based services to financial services companies, particularly banks. Service bureaus are a significant sector within t ...
business. GE referred to these as their Mark I time-sharing systems.


New system

One of the original goals of the program was to work programming into other coursework. This was a success, but it put considerable strain on the system and it became clear that it had no room for future growth. In 1965, the team approached GE for support with ongoing development. In September, Vice President Louis Rader offered the new GE-635, which ran approximately 10 times as fast and included two CPUs. Additionally, a second DN-30 would be added to handle more lines, enough for 150 simultaneous users. To house it, a larger facility would be needed than the basement of College Hall where the 265 was running. Peter Kiewit, Class of '22, along with additional support from the NSF, led to the construction of the Kiewit Computation Center, which opened in December 1966. While waiting for this machine to arrive, in the summer and fall of 1966 a GE-635 at the Rome Air Development Center was used to develop MOLDS, the "Multiple User On-Line Debugging System". The GE-635 was operational in early 1967, and using MOLDS the new operating system was fully functional in September, at which time the GE-265 was sold off. GE provided the machine for free for three years as part of a wider agreement under which Dartmouth would develop new versions of BASIC while GE used it to develop a new release of their version of the operating system. This collaboration proved to be a success; GE began deploying these machines as their Mark II time-sharing systems, and by the end of the decade they were one of the largest time-sharing vendors in the world. When this "Phase I" system became operational, the Dartmouth team began development of "Phase II", the ideal operating system. This was installed in March 1969, and changed its name to the Dartmouth Time Sharing System shortly thereafter. When the three-year period was up, GE gifted the machine to the university. Although the two teams remained in contact, and several good-faith attempts were made to continue the relationship, little further collaboration occurred and the partnership officially ended on 20 September 1972.


Expanding user base

A review in 1968 noted that 80% of the students and 70% of the faculty was making some use of the system. Hundreds of terminals were spread across the campus, from the hospital to the business school. 57% of the CPU time was used for coursework, 16% for research, and the remaining 27% for "recreational use"; Dartmouth actively encouraged users to play games as a way to get hands-on use and overcome fear of the computer. Beginning with another NFS grant, in 1967 Dartmouth also began placing terminals in off-campus locations, including high schools in the area. In terms of user counts, these terminals hosted 69% of the total users, although they used a smaller amount of computer time. By 1971 there were 79 remote terminals, as far away as
New Jersey New Jersey is a state in the Mid-Atlantic and Northeastern regions of the United States. It is bordered on the north and east by the state of New York; on the east, southeast, and south by the Atlantic Ocean; on the west by the Delawa ...
and
Bangor, Maine Bangor ( ) is a city in the U.S. state of Maine and the county seat of Penobscot County. The city proper has a population of 31,753, making it the state's 3rd-largest settlement, behind Portland (68,408) and Lewiston (37,121). Modern Bangor ...
. These were supported by
multiplexer In electronics, a multiplexer (or mux; spelled sometimes as multiplexor), also known as a data selector, is a device that selects between several analog or digital input signals and forwards the selected input to a single output line. The sel ...
systems that allowed up to 12 terminals to be supported over a single voice-grade telephone line. Additionally, a number of these lines were available for dial-up use with a
modem A modulator-demodulator or modem is a computer hardware device that converts data from a digital format into a format suitable for an analog transmission medium such as telephone or radio. A modem transmits data by modulating one or more c ...
.


Influence

Time-sharing was a major area of research in the 1960s, with many in the computer industry predicting that computing power would become inexpensive and widespread. This was most famously stated by John McCarthy, who said "computing may someday be organized as a public utility just as the telephone system is a public utility." With BASIC, such services became far more accessible to end-users whose tasks would take too long to code for them to be suitable for solving on a computer. This led to a number of manufacturers who introduced computers specifically designed for this market of users who wanted to solve small or medium-scale tasks and were not as worried about outright performance. In particular, two machines aimed directly at this market became the "most widely used small time-sharing systems ever developed". The
HP 2000 The HP 2100 is a series of 16-bit minicomputers that were produced by Hewlett-Packard (HP) from the mid-1960s to early 1990s. Tens of thousands of machines in the series were sold over its twenty-five year lifetime, making HP the fourth largest ...
ran
HP Time-Shared BASIC HP Time-Shared BASIC (HP TSB) is a BASIC programming language interpreter for Hewlett-Packard's HP 2000 line of minicomputer-based time-sharing computer systems. TSB is historically notable as the platform that released the first public ve ...
, a combination of a BASIC and a time-share operating system almost identical to the DTSS setup. The system supported up to 32 simultaneous users, using a low-end HP 2100 CPU to run the terminals in the same fashion as the Datanet-30 of the original GE-265 setup, while the programs ran on a higher-end model of the same machine, typically differing in that it had more
core memory Core or cores may refer to: Science and technology * Core (anatomy), everything except the appendages * Core (manufacturing), used in casting and molding * Core (optical fiber), the signal-carrying portion of an optical fiber * Core, the centra ...
. HP's BASIC used a semi-compiled tokenized format for storing programs, which improved loading times and meant "compiles" were zero-time.
Digital Equipment Corporation Digital Equipment Corporation (DEC ), using the trademark Digital, was a major American company in the computer industry from the 1960s to the 1990s. The company was co-founded by Ken Olsen and Harlan Anderson in 1957. Olsen was president un ...
took a different approach, using a single-machine offering based on their existing
PDP-11 The PDP-11 is a series of 16-bit minicomputers sold by Digital Equipment Corporation (DEC) from 1970 into the 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of all models were sol ...
line with the new RSTS/E operating system and BASIC-PLUS. BASIC-PLUS more closely followed the Fifth Edition, including the MAT commands, but was implemented as a pure interpreter as opposed to the Dartmouth compiler or HP's tokenized format. It also included a number of control structures following the
JOSS Joss may refer to: * Joss (name), including a list of people with the name * JOSS, a time-sharing programming language * Joss (Chinese statue), a religious object * Joss JP1, an Australian-built supercar * Joss paper, a type of burnt offering * ...
model, like . Tymshare SUPER BASIC also supported JOSS-style structures and matrix math, but retained the original compile-and-go operation. Practically every vendor of the era offered some solution to this same problem, although they may not have been so closely similar to the original. When Kurtz began considering the formation of an
ANSI The American National Standards Institute (ANSI ) is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organi ...
standard for BASIC in 1973, he found that the number of time-sharing service bureaus with BASIC available was greater than any other language. Unfortunately, this success was also a problem; by that point, there were so many variations that a standard seemed impossible.


Games in BASIC

Kemeny actively encouraged games on the DTSS platform, and considered it to be one of the major reasons for the success of the DTSS system. He was likely the author of an early mainframe game. Although Kemeny did not take credit for it, he later referred to ''FTBALL'' by stating it "was written on Sunday after a certain Dartmouth-
Princeton Princeton University is a private research university in Princeton, New Jersey. Founded in 1746 in Elizabeth as the College of New Jersey, Princeton is the fourth-oldest institution of higher education in the United States and one of the nin ...
game in 1965 when Dartmouth won the Lambert trophy. It's sort of a commemorative program". The game was an upset over heavily favored Princeton. As the system expanded, especially after the addition of string handling in BASIC, the DTSS system became a major platform for the development of many text-based games. In the early 1970s, the People's Computer Company began publishing these in their magazine, typically converted to the more widely available HP BASIC. Many of these listings were collected in their 1975 book, ''What to do after you hit return''. Although these are published in HP BASIC form, the majority of them trace their history to either DTSS or the
Lawrence Hall of Science The Lawrence Hall of Science is a public science center in Berkeley, California that offers hands-on science exhibits, designs curriculum, aids professional development, and offers after school science resources to students of all ages. The Hall ...
in California where a similar machine was set up, known as DECISION. A more famous collection is '' BASIC Computer Games'' of 1978, where about half of the programs in the book were either written at Dartmouth, including another by Kemeny, Batnum, or more commonly, one of the many high schools that were connected to it after 1968. A particularly prolific high school was Lexington High School in
Massachusetts Massachusetts (Massachusett: ''Muhsachuweesut Massachusett_writing_systems.html" ;"title="nowiki/> məhswatʃəwiːsət.html" ;"title="Massachusett writing systems">məhswatʃəwiːsət">Massachusett writing systems">məhswatʃəwiːsət'' En ...
but many other schools appear as well. A number of the programs do not list their original locations, but come from authors that were likely connected to the system through a school or public projects like Project SOLO. Multi-user games became possible in BASIC when Stephen Garland and John McGeachie developed the MOTIF Multiple Online Terminal Interface for DTSS. To start a game, a user typed LINK followed by a session name instead of RUN, thereby enabling other users to connect to the game by typing JOIN followed by the session name. MOTIF then multiplexed input and output for the BASIC program, prepending a string identifier to the beginning of each line of input and output. The first programs developed with this interface were a two-person version of FTBALL and a five-person poker game. More serious was a management game that allowed up to ten students at the Amos Tuck School of Business Administration to compete in the production and marketing of a single product.


Versions


First Edition

The original version, retroactively known as version one, supported the commands LET, PRINT, END, FOR...NEXT, GOTO, GOSUB...RETURN, IF...THEN, DEF, READ, DATA, DIM, and REM. It included basic math instructions, , , and , as well as the up-arrow for exponents "...since on a teletype typewriter it is impossible to print superscripts." In modern varieties, the up-arrow is normally replaced by the "hat" character, . Exponents took the absolute value of the number before calculation, so to calculate , one had to use . There was a further problem in the exponent function that treated as as opposed to the correct
order of operations In mathematics and computer programming, the order of operations (or operator precedence) is a collection of rules that reflect conventions about which procedures to perform first in order to evaluate a given mathematical expression. For examp ...
, which was not corrected until the third release. The INT() function always truncated towards zero. The language had a number of idiosyncrasies of its own. In contrast to later versions, the LET command was required on all statements lacking another command, so was not valid in this version. The PRINT statement used the comma when printing multiple variables, advancing to the next of five "zones". The comma was not needed in the case where one was printing a prompt and single value, so was valid. A somewhat hidden feature was that all variables were capable of representing arrays (vectors) of up to ten elements (subscripts 1 to 10, changed to 0 to 10 in the Second Edition) without being declared that way using DIM. DIM was only needed if a different vector size was required. Variable names were limited to a single letter or a letter followed by a digit (286 possible variable names). User functions could only have a single letter, thus through . All operations were done in
floating point In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can ...
. On the GE-225 and GE-235, this produced a precision of about 30 bits (roughly ten digits) with a base-2 exponent range of -256 to +255. Additionally, due to the GE-235's word size being 20-bits and using a six-bit character code, the language enshrined the use of three-letter function names because that allowed the storage of three six-bit characters in a 20-bit word (using 18 bits). This is why BASIC functions are three letters, like INT or SQR, something that remained in the many varieties of the language long after they left the GE-235.


Second Edition, CARDBASIC

The Second Edition of BASIC (though not referred to as such at the time) only made minimal changes. Released in October 1964, it could start arrays at subscript 0 instead of 1 (useful for representing
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An exampl ...
s) and added the semicolon, , to the PRINT statement. Unlike later implementations where this left space between items, the semicolon advanced printing to the next multiple of three characters, which was useful for "packing" more numbers into a line of output than the existing comma separator. The three-character size was a side-effect of the GE-235's 20-bit
word size In computing, a word is the natural unit of data used by a particular processor design. A word is a fixed-sized datum handled as a unit by the instruction set or the hardware of the processor. The number of bits or digits in a word (the ''word s ...
, which stored three six-bit characters. Skipping to the next three-character column was accomplished simply by moving to the next word in memory. The October version also included a separate definition for CARDBASIC, which was simply a version of BASIC for use on card-based workflows. CARDBASIC was almost identical to the interactive version, with the exception being that it did not include the zero-based arrays. More important to the language's future, CARDBASIC added the MAT commands that worked with numerical matrices. CARDBASIC was not developed further, as the entire idea of BASIC had been to be interactive.


Third Edition

The Third Edition, released in 1966 and the first to use the "edition" naming, was the first designed specifically with the intent of running on the new GE-635 computer which was due to arrive shortly. This version includes the MAT functions from CARDBASIC, and they can now use 0 as a subscript. The new SGN function gave the sign of its argument (positive?0 and negative?1), while RESTORE was added to "rewind" the position of READ/DATA. The exponentiation problem was fixed, so would be interpreted as . Additionally, the INT function was changed to be a true floor, as opposed to trim-toward-zero, which allowed rounding to be implemented with INT(X+0.5). The major change in this version was the new INPUT statement, which parsed numeric values, making the language truly interactive during execution for the first time; previously the only control one had during execution was to type STOP in the monitor. Additionally, the system now allowed, and encouraged, loops to be indented, a feature that was not seen on most other versions of BASIC.


Fourth Edition

The Third Edition remained in use through the GE-235's lifetime into the fall of 1967. However, as plans were made to receive the GE-635, an experimental version was created on the 635 in the spring of 1967. This version was a partnership between GE and Dartmouth, with GE contributing a new operating system as well as a number of features of BASIC from their own Mark 1 BASIC efforts. This version, initially published as a supplement to the Third Edition, added the RANDOMIZE command to "seed" the RND function, and the ON...GOTO "computed goto" that closely matched the similar feature in FORTRAN. This version also allowed ON...THEN, arguing that IF...THEN did not require the GOTO then it would not be required here. The new TAB function moved printing to a given column, from 0 to 74. Another internal change was to once again change the MAT to be 1-based; one could use the 0th index, but it would normally be ignored by the various commands. The major addition for this version was string variables, along with changes to the READ/DATA statements which could store strings in them and the INPUT statement to read them interactively. One feature of the string system was that trailing spaces were deliberately ignored in comparisons, so that "YES" and "YES " were considered equal. This was later realized to be a grave error. String variables were indicated by the dollar sign, e.g. , simply because they were running out of characters that could be found on most keyboards. Someone pointed out that the $ looked like the S in "String", and that was that. String manipulation was handled through the new command. This converted the string value in a variable to the equivalent set of ASCII values. The numeric array could then be manipulated and converted back to a string. For instance, this code produces "is" on the console: Line 140 sets the string length to 2, which has to be managed by the user. The first character is in T(1). While this system is flexible, it was by no means convenient to use. Later versions would address this with new functionality. Minor changes in this version changed the semicolon in PRINT statements to do "close packing" of output with no spaces, and the use of the apostrophe as a short-form form REM. The official Fourth Edition did not appear until 1968, which added several new features on top of the previous additions. This included the ability to define multi-line functions with the DEF command, and the powerful CHANGE statement that treated strings as arrays of
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
-like codes so individual characters could be operated on without looping over the entire string. This was also the only string manipulation function; to extract a single character or substring, one had to use CHANGE to convert it into an array of numbers, manipulate that array, and then convert it back. This was the reason MAT was 1-based again; the length of the string was placed in location zero, and it needed to be ignored normally.


Fifth Edition

The Fifth Edition, from late 1970, once again started as two supplements to the Fourth Edition, from February and April 1969. The major change was the introduction of file handling. Previously, any pre-defined data that had to be used in the program had to be placed in the lines and then read in one-at-a-time using the command. This feature could be used to read files in a similar fashion. The command could now read a single item from a file and could write one. Files were opened through the new keyword, which was followed by a list of string constants describing file names. As these were constants, changing the file name demanded the code be changed to match. The names were assigned numbers, the first name became file #1, and so on. Two file formats were supported, random-access and linear. A linear file was treated as a text file would be today, one could to read a line of text into a string variable, and then to output it to the terminal. Later versions added the to allow files to be specified by strings, although for a time this required a near the top of the program to indicate you were using this format. For random access files, the name had to specify the type of data within; indicated it contained binary data, while indicated it should be read as strings with a maximum length of . The and could be positioned anywhere in a random-access file with the command, while the current location was returned by the function, and the file length by . During sequential reads, one could also test whether it was at the end of the file using IF END THEN.... Another major change was the ability for one BASIC program to call another using the command, and pass variables to it using the list. It was later realized that this basic concept had a number of problems, but it was nevertheless used to write some large programs. String handling received a major update. The new command returned a new string clipped out of another. In the example above, the string "is" is extracted from a larger string. Using the new command, this can be reduced to , which works identically to the function found in most dialects. returned the length of a string, which was otherwise now handled internally and did not require calculation in most cases, and returned the position of one string within another, which in most dialects was handled by . The ampersand, , was introduced for string concatenation. Numerous more minor changes were also added. Among these were two-dimensional string arrays, as opposed to one-dimensional in the previous version, as well as the ability to use the to define string-based functions as well as mathematical. New system-oriented functions included , to work with times and dates, which returned the elapsed time, and which returned the user number, what would today be the username. New string functions included , , , which are common in modern BASIC dialects. The as a short form for also appeared in this version.


Sixth Edition

Work on the Sixth Edition began in the fall of 1969 before the Fifth Edition was finalized. A complete specification was written beforehand for the new version. This contrasts with previous versions where the specification documents were based on the changes in the compiler. This version was worked on by Kemeny and Kurtz as well as several former students who returned as faculty: Stephen Garland, John McGeachie, and Robert Hargraves. It was given considerable time to mature, with a beta version running for three months during the summer of 1971, before it was finally released on 21 September 1971. As a result of this maturity, Kurtz described it as "probably the best-designed and most stable software system Dartmouth has ever written." One of the biggest changes was the replacement of the earlier CHAIN concept with the much better-defined CALL which operated in a fashion similar to GOSUB, but it referred to a function name rather than a line number. The functions were defined using SUB...SUBEND, and took arbitrary parameters in the call rather than using global variables via COMMON declarations. Another major change was to use file handles (numbers) created with the FILE command which is similar to OPEN which is found in most modern BASICs.PRINT USING provided formatted output in a fashion somewhat similar to FORTRAN, while accepted input with no interpretation, allowing commas, semicolons, and even BASIC code to be typed in. The Sixth Edition was essentially the last version of the original BASIC concept. It remained unchanged for many years. Later versions were significantly different languages.


SBASIC

In 1976, Stephen Garland collected a number of
structured programming Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection ( if/then/else) and repetition ( ...
additions to create Dartmouth Structured BASIC, or SBASIC. The primary goal was to replace the control structures based on IF...THEN and GOTO with a variety of block-oriented structures. It did this using a precompiler that took SBASIC source code, converted that to 6th Edition BASIC, and then compiled and ran that as normal. SBASIC also added a number of graphics features, based on the PLOT command that had been added by other programmers. Block structures were terminated by matching statements as was the case in
ALGOL 68 ALGOL 68 (short for ''Algorithmic Language 1968'') is an imperative programming language that was conceived as a successor to the ALGOL 60 programming language, designed with the goal of a much wider scope of application and more rigorously d ...
, as opposed to the generic block structures found in languages like
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Frenc ...
or C. For instance, the DO WHILE... spanned multiple lines until it ended with a LOOP. The DO loop could also be bottom exited by removing the WHILE or UNTIL and placing the conditional at the bottom on the LOOP. Infinite loops were supported using DO FOREVER or LOOP FOREVER. "Original" Dartmouth BASIC did not allow statements after a THEN, only a line number to branch to. SBASIC allowed any statement, so for instance . This basic expansion to the IF...THEN, pioneered in 1972 with BASIC-PLUS, was already widely supported by most variety of BASICs by this point, including
microcomputer A microcomputer is a small, relatively inexpensive computer having a central processing unit (CPU) made out of a microprocessor. The computer also includes memory and input/output (I/O) circuitry together mounted on a printed circuit board (PC ...
versions that were being released at this time. On top of this, SBASIC added block-oriented IF by placing the THEN on a separate line and then ending the block with CONTINUE. On top of this, SBASIC added the SELECT CASE mechanism that survives to this day in Visual Basic .NET. SBASIC also added a number of graphics commands intended to be used with
plotter A plotter is a machine that produces vector graphics drawings. Plotters draw lines on paper using a pen, or in some applications, use a knife to cut a material like vinyl or leather. In the latter case, they are sometimes known as a cutting ...
s. This required the PLOTTER "plottername" to direct subsequent commands to a selected device, and the WINDOW... to set up its parameters. From then on, PLOT X,Y would produce dots on the selected plotter, while adding the semicolon at the end of the statement, as used in PRINT, would leave the pen on the paper and produce a line, for instance PLOT 10,10;20,20. SBASIC eventually formed the basis of the 1987 ANSI X3.113-1987 Standard for Full Basic, which extended the earlier 1978 ANSI ANSI X3.60-1978 Standard for Minimal Basic. The long delay in producing that standard, along with the lack of regard among computer scientists for unstructured Basic, led the College Board committee developing the Advanced Placement Course in Computer Science, which Garland chaired, to opt for requiring Pascal and not allowing Basic as the language for the course. Garland used SBASIC to teach the introductory course in computer science at Dartmouth, but rewrote his textbook for the course in Pascal so that it could be used to teach the AP course.


Seventh Edition

Garland's SBASIC was a pre-compiler written in SBASIC source code itself. The system would read SBASIC source, write the corresponding 6th Edition code, and then compile that output. The Seventh Edition, released in 1980, was a version of SBASIC that was a stand-alone compiler of its own. It added a number of additions of its own. Most of the changes were further elaborations on the system for calling external programs and "overlays" that could be used to break up a program into parts. In this version, SUBs sharing a single file effectively shared data between them. This provided a modicum of data hiding within the group of routines. This separation would today be known as a module. In addition, this edition added structured error handling and arbitrary matrix math in LET statements, so one could LET A = M*4 where M was a matrix variable, and the statement would output another matrix into A with all the elements in M scaled by 4. Finally, another major update was the use of activation records for subroutines which made
recursion Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematic ...
possible.


ANSI BASIC, Eighth Edition

By the early 1970s, the number of BASIC implementations had grown to dozens, all of which had their own changes to the basic concept introduced in the original version. Most of these were based on the Fifth Edition, although they often lacked the MAT instructions and the ability to indent code. GE was one of these companies; they released their Mark II systems with the 5th edition rather than waiting for the 6th to arrive a few months later. BASIC-PLUS on the DEC platform was perhaps the closest implementation, including the MAT commands for instance, but then added a number of changes that were not backward-compatible. After the release of the 6th edition, Kurtz became involved in an effort to define a standard BASIC. An
American National Standards Institute The American National Standards Institute (ANSI ) is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The orga ...
(ANSI) working group, X3J2, formed in January 1974, and a corresponding European Computer Manufacturers Association (ECMA) group, TC21, that September. The goal at that time was to produce two related standards. Minimal BASIC would be similar to the Second Edition, but adding strings, a standard to which practically every BASIC would already be able to conform. Standard BASIC would add more functionality to produce something more in keeping with the real BASIC varieties seen in the market. The process was slow, and the first draft of Minimal BASIC was not published until January 1976, leading to it being officially adopted in December 1977 by ECMA, and 1979 by ANSI as X3.60-1978. Minimal BASIC was similar to the 3rd edition, including string variables, while lacking MAT and other advanced features. In contrast, Standard BASIC had many new features that did not exist in other BASICs, and many of these were poorly considered and the subject of some criticism. For instance, the standard included a line-continuation character, but chose the ampersand, , which was also used for string concatenation. Using these in a single line could lead to very confusing code. By this time, the release of the first
microcomputer A microcomputer is a small, relatively inexpensive computer having a central processing unit (CPU) made out of a microprocessor. The computer also includes memory and input/output (I/O) circuitry together mounted on a printed circuit board (PC ...
systems in 1975 had quickly led to the introduction of Altair BASIC, the first version of what would soon be known as
Microsoft BASIC Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first ...
. MS BASIC was patterned on BASIC-PLUS, and thus ultimately the Fifth Edition, but lacked indenting, MAT, and other features. It also added the LEFT$ and RIGHT$ functions, breaking the three-letter convention. As the number of microcomputers grew, and turned into the home computer market in the late 1970s, MS BASIC became the ''de facto'' standard. With this rapid change in the market, the Standard BASIC effort slowed further and was not formally ratified until 1987 as X3.113-1987. By this time, there was no real purpose to the standards; not only was MS BASIC everywhere, but by the mid-1980s the use of BASIC was declining as shrinkwrap software took over from type-in programs. Both standards were eventually withdrawn. In spite of the eventual failure of the ANSI efforts, the draft of Standard BASIC was implemented at Dartmouth as the Eighth Edition in 1982.


DTSS interface

DTSS implemented an early
integrated development environment An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools ...
(IDE): an interactive
command line interface A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
. This provided a number of user and job control commands. For instance, an idle terminal could be connected to a user account by typing HELLO, and logged out again with BYE. 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 the use of
teleprinter A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
s as the terminal units. Each user account could have any number of BASIC programs stored offline, while administrator accounts could also leave programs in permanent storage. Any one of these was active at a given time for a given user account, and if no program had been loaded, a new program was assumed. Stored programs were accessed using commands that are today better known as parts of the BASIC language itself; for instance, the LIST command instructed DTSS to print out the currently active program.


List of commands

; HELLO : log in to DTSS ; BYE : log out of 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 ; RUN : execute the current program ; STOP : interrupt the currently running program ; TEST : use an instructor-provided program to test the current program ; LINK : execute the current program in a multiple-terminal mode ; JOIN : join a program being executed in multiple-terminal mode ; SAVE : save the current program in permanent storage ; UNSAVE : clear the current program from permanent storage ; REPLACE : save the current program using a name already in use for another file ; 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 ; FRI : enable Friden mode for teletypes with mechanical linefeeds ; NFR : disable Friden mode ; EXP : explain (help) EXP EXP for list of commands that can be explained by the system 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.


TEACH/Test System

Some 80% of all Dartmouth students in the late 1960s took two mathematics courses and learned Basic in the second course, either in calculus or in finite mathematics. They received two one-hour lectures on Basic near the beginning of these courses and then had to write four programs in Basic, ranging from programs for approximating π or finding a root of a quintic polynomial to programs for solving a differential equation or finding (by simulation) the limiting probability in a Markov chain. The TEACH/Test system helped students complete these assignments. When they thought they had a working program, they typed the command TEST, and an instructor-written program either approved what they had written or provided a hint about where they might have gone wrong. Students were required to hand in a listing of each program, a sample RUN, and an approval from the TEACH/Test system. The system did not grade assignments or keep a record of how many times a student typed TEST; it simply assisted students and their instructors.


BASIC language

The first release implemented the following statement types, taking some of its operators and keywords from FORTRAN II and some from
ALGOL 60 ALGOL 60 (short for ''Algorithmic Language 1960'') is a member of the ALGOL family of computer programming languages. It followed on from ALGOL 58 which had introduced code blocks and the begin and end pairs for delimiting them, representing a ...
. Overall, the language more closely follows the FORTRAN model, in that it generally has one statement per line of code, lacks ALGOL's "blocks" to group code (these
structured programming Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making extensive use of the structured control flow constructs of selection ( if/then/else) and repetition ( ...
constructs were a primary reason for ALGOLs development) and the use of GOTO to control program flow. From ALGOL it took the FOR...TO...STEP style loops that replaced FORTRAN's unwieldy DO...CONTINUE statements. BASIC also simplified the IF...THEN construct to allow simple comparisons like , as opposed to FORTRAN's IF (X-5) 20,20,30. FORTRAN's style "computed IF" was reintroduced with the ON...GOTO command in later versions. 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. FORTRAN's odd system for setting up the variables I through N as integers and the rest as floating point was removed, and all variables were assumed to be floating point and dimensioned with up to 10 elements. The DIM command was only required if the array held more than ten elements. Array names were restricted to A to Z only.


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 / TO / STEP : define loops ; NEXT : mark the end of loops ; GOSUB : transfer control to simple subroutines ;
RETURN Return may refer to: In business, economics, and finance * Return on investment (ROI), the financial gain after an expense. * Rate of return, the financial term for the profit or loss derived from an investment * Tax return, a blank document or t ...
: return control from simple subroutines ;
GOTO GoTo (goto, GOTO, GO TO or other case combinations, depending on the programming language) is a statement found in many computer programming languages. It performs a one-way transfer of control to another line of code; in contrast a function c ...
: 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 ("REMark") It also implemented floating-point numeric variables and arithmetic.


List of operators


List of functions

; ABS : Absolute value ; ATN : Arctangent value (result in
radian The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. The unit was formerly an SI supplementary unit (before that ...
s) ; COS : Cosine value (argument in
radian The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. The unit was formerly an SI supplementary unit (before that ...
s) ; EXP : Exponential value ; INT : Integer value ; LOG : Natural Logarithmic value ; RND : Random value ; SIN : Sine value (argument in
radian The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. The unit was formerly an SI supplementary unit (before that ...
s) ; SQR : Square root value ; TAN : Tangent value (argument in
radian The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. The unit was formerly an SI supplementary unit (before that ...
s)


Examples

Early versions of BASIC did not have the ability to read and write external files. To represent lists of data that would normally be read from a file, BASIC included the DATA keyword, which could be followed by an arbitrarily long list of elements, ending only at the limit of the line length. The DATA was non-executable and was skipped if encountered. READ commands would consume the data one by one, keeping track of its location within the complete collection of DATA elements in an internal pointer. In version 3, a RESTORE command was added to reset the pointer to the first DATA command in a program. In this example, "the first three data values are read into X, Y, and Z respectively. The value -1 is read into N. The next 11 values, .1 through .3, are read into the 11 elements of array B." 15 READ X, Y, Z 20 READ N 24 FOR I=0 TO 10 25 READ B(I) 26 NEXT I 40 DATA 4.2, 7.5, 25.1, -1, .1, .01, .001, .0001 45 DATA .2, .02, .002, .0002, .015, .025, .3, .03, .003 Unlike most subsequent BASICs, Dartmouth BASIC, from the Third Edition onwards, had a matrix keyword, MAT, which could prefix a number of other commands to operate on entire arrays of data with a single command. In this example, from the 1968 manual,BASIC, 4th Edition, 1968
page 53
MAT INPUT V is used to input a series of variables. When the user enters nothing on a line, this process ends and the total number of elements is accessed in the NUM pseudovariable. The code then adds up all of the individual elements in the matrix and calculates the average. The Third Edition also added indentation, which is used here to clarify the loop structure. 5 LET S = 0 10 MAT INPUT V 20 LET N = NUM 30 IF N = 0 THEN 99 40 FOR I = 1 TO N 45 LET S = S + V(I) 50 NEXT I 60 PRINT S/N 70 GO TO 5 99 END


Notes


References


Citations


Bibliography

* * * * * * * * * * *


External links


Listing of the source code for version 2 of the Dartmouth BASIC compiler circa 1965
(archived 2007)
Scans of original documentation and software.

Dartmouth BASIC Interpreter
RetroWiki.es {{DEFAULTSORT:BASIC, Dartmouth Dartmouth College history Programming languages created in 1964 Dartmouth BASIC Dartmouth BASIC Time-sharing BASIC programming language family 1964 software