HOME

TheInfoList



OR:

BASIC-PLUS is an extended dialect of the
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
that was developed by
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 until ...
(DEC) for use on its
RSTS/E RSTS () is a multi-user time-sharing operating system developed by Digital Equipment Corporation (DEC, now part of Hewlett-Packard) for the PDP-11 series of 16-bit minicomputers. The first version of RSTS (RSTS-11, #Versions, Version 1) was implem ...
time-sharing operating system for the
PDP-11 The PDP–11 is a series of 16-bit minicomputers originally sold by Digital Equipment Corporation (DEC) from 1970 into the late 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of a ...
series of 16-bit
minicomputer A minicomputer, or colloquially mini, is a type of general-purpose computer mostly developed from the mid-1960s, built significantly smaller and sold at a much lower price than mainframe computers . By 21st century-standards however, a mini is ...
s in the early 1970s through the 1980s. BASIC-PLUS was based on BASIC-8 for the TSS/8, itself based very closely on the original
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time-Sharing System (DTSS), it offered an interac ...
. BASIC-PLUS added a number of new structures, as well as features from
JOSS JOSS (acronym for JOHNNIAC Open Shop System) was one of the first interactive, time-sharing programming languages. It pioneered many features that would become common in languages from the 1960s into the 1980s, including use of line numbers as bo ...
concerning conditional statements and formatting. In turn, BASIC-PLUS was the version on which the original
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 v ...
was patterned. Notable among the additions made to BASIC-PLUS was the introduction of string functions like and , in addition to Dartmouth's original all-purpose command. In future versions of the language, notably Microsoft's, was removed and BASIC-PLUS's string functions became the only ways to perform these sorts of operations. Most BASICs to this day follow this convention. The language was later rewritten as a true
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
as BASIC-Plus-2, and was ported to the
VAX-11 The VAX-11 is a discontinued family of 32-bit superminicomputers, running the Virtual Address eXtension (VAX) instruction set architecture (ISA), developed and manufactured by Digital Equipment Corporation (DEC). Development began in 1976. In ...
platform as that machine's native BASIC implementation. This version survived several platform changes, and is today known as VSI BASIC for OpenVMS.


History

In the mid-1960s, DEC won a sale for a
PDP-6 The PDP-6, short for Programmed Data Processor model 6, is a computer developed by Digital Equipment Corporation (DEC) during 1963 and first delivered in the summer of 1964. It was an expansion of DEC's existing 18-bit systems to use a 36-bit da ...
mainframe computer A mainframe computer, informally called a mainframe or big iron, is a computer used primarily by large organizations for critical applications like bulk data processing for tasks such as censuses, industry and consumer statistics, enterprise ...
to the
RAND Corporation The RAND Corporation, doing business as RAND, is an American nonprofit global policy think tank, research institute, and public sector consulting firm. RAND engages in research and development (R&D) in several fields and industries. Since the ...
who were looking for a faster machine to run their interactive
JOSS JOSS (acronym for JOHNNIAC Open Shop System) was one of the first interactive, time-sharing programming languages. It pioneered many features that would become common in languages from the 1960s into the 1980s, including use of line numbers as bo ...
programming language. The next year, DEC introduced the much smaller
PDP-8 The PDP-8 is a family of 12-bit minicomputers that was produced by Digital Equipment Corporation (DEC). It was the first commercially successful minicomputer, with over 50,000 units sold during the model's lifetime. Its basic design follows the pi ...
, generally considered the first successful
minicomputer A minicomputer, or colloquially mini, is a type of general-purpose computer mostly developed from the mid-1960s, built significantly smaller and sold at a much lower price than mainframe computers . By 21st century-standards however, a mini is ...
. For this machine they developed a cut-down version of JOSS known as FOCAL, which became popular on the PDP-8, one of the best-selling computers of the era. The same year that RAND introduced JOSS, Dartmouth University introduced the first version of
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time-Sharing System (DTSS), it offered an interac ...
. This was soon ported to several other platforms, and by the late 1960s it was making major inroads to the computer industry as an interactive language intended to be used with timesharing systems. By the late 1960s, most vendors were introducing a BASIC for their platform, including
IBM International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
and the major online timesharing companies like Tymshare's SUPER BASIC. DEC continued to push FOCAL to their customers, as much for not invented here reasons as any technical advantage. By the late 1968s, DEC's educational department was finding it increasingly difficult to pitch FOCAL to prospective customers as BASIC began to take over. Management was uninterested, so in 1969 David H. Ahl took it upon himself to hire a programmer to write BASIC-8 for the PDP-8. It was an immediate success and became one of DEC's biggest software sellers. The same year, DEC began the design effort for a new computer that emerged as the
PDP-11 The PDP–11 is a series of 16-bit minicomputers originally sold by Digital Equipment Corporation (DEC) from 1970 into the late 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of a ...
. The first
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
for the platform was
DOS-11 BATCH-11/DOS-11, also known simply as DOS-11, is a discontinued operating system by Digital Equipment Corporation (DEC) of Maynard, Massachusetts, Maynard, Massachusetts. The first version of DOS-11 (V08-02) was released in 1970 and was the first ...
, a single user system later retargeted for
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 ...
. Timesharing was a major goal for the new machine, so a second system, MUM-1 for Multi-User Monitor, was developed based on DOS, along with a BASIC-11 that ran on top. The result was very slow. The company eventually concluded it needed an entirely new timesharing OS, and put Tom Barnett and Nathan Teicholtz in charge of developing it. They formed a new team to develop what was then known as IOX, Input Output eXecutive, on 11 June 1970. Teicholtz, the technical lead, was formerly part of the TSS-8 effort on the PDP-8. Among the many new concepts IOX was to include was the idea of using a programming language that could act as a
command shell An operating system shell is a computer program that provides relatively broad and direct access to the system on which it runs. The term ''shell'' refers to how it is a relatively thin layer around an operating system. A shell is generally a ...
programming system as well. An argument broke out in the company about what language it should be based on. Some suggested it be FOCAL, largely because DEC felt they should do their own thing. Others felt that not supporting BASIC would be a major problem for the machine's popularity. As there seemed to be no overwhelming argument either way on technical grounds, the decision was left to the marketing department, who chose BASIC. In the end, they decided to do both, and have a BASIC dialect that would add some features from FOCAL as well. As the OS side of the project grew, the engineering load took over all of the available programming time and there was no one working on the BASIC. At a chance meeting while buying an airplane, Tim Hart found the seller worked at DEC and they ended up talking about the problems DEC was having. Through this opening, Hart, along with two long-time friends Tom Evans and Tom Griffiths who had formed EGH Inc., received a tender from DEC on 25 August. Because they thought it would be a fun project, they put in a very low bid at $10,500 on 4 September. To their surprise they won the contract on 18 September, but DEC realized the price was too low and offered to make it up through a $3000 bonus clause. Previously, DEC had introduced several different BASIC dialects for their different platforms, and these were both different enough to require conversion when moving between machines, as well as generally underwhelming compared to other platforms. BASIC-PLUS introduced many new features that made it among the more complete dialects, including matrix math, file handing, and other features previously only see on the mainframe system. BASIC-PLUS would go on to be the basis for all future dialects from the company. The original concept was that EGH would write only the compiler and related utilities, while DEC would write the
runtime system In computer programming, a runtime system or runtime environment is a sub-system that exists in the computer where a program is created, as well as in the computers where the program is intended to be run. The name comes from the compile time ...
which would be separate. The idea was that systems with limited amounts of memory and
secondary storage Computer data storage or digital data storage is a technology consisting of computer components and Data storage, recording media that are used to retain digital data. It is a core function and fundamental component of computers. The cent ...
would be supplied only with the runtime and small size of the runtime and the
intermediate language An intermediate representation (IR) is the data structure or code used internally by a compiler or virtual machine to represent source code. An IR is designed to be conducive to further processing, such as optimization and translation. A "good" ...
(IL) code from the compiler would allow it to run. Development would require a machine with more resources, but simply running the resulting programs would work even on the smallest machines. EGH was initially supposed to write only the compiler, but over time they were put in charge of the entire system, which they delivered in January 1971. The idea of a runtime-only system was later dropped. IOX was eventually renamed RSTS-11, and shipped with BASIC-PLUS in 1971.


Operation

Users would sit at a terminal and type in programming language statements. The statements could either be entered into the system's command interpreter directly, or entered into a
text editor A text editor is a type of computer program that edits plain text. An example of such program is "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be used to c ...
, saved to a file, and loaded into the command interpreter from the file. Errors in source code were reported to the user immediately after the line was typed. As a smart terminal with cursor control could not be guaranteed, BASIC-PLUS used the common system of prefixing all source code with a line number. The code was edited by typing in the number and then changing the contents of the following code. A line of code could be removed by typing in its line number and nothing else, thereby setting it to an empty line. The virtual address space of an RSTS/E user was limited to a little less than 64KB of space. Using BASIC-PLUS, about half of this virtual address space was used by the combined command interpreter and run-time library (named the Run Time System on RSTS/E). This limited user programs to about 32 kB of memory. Large programs were broken into separate executable pieces by use of the statement, and programs could chain to specific line numbers in a secondary program to indicate that a program should begin execution at a different point from its first line. This feature of chaining to a certain line number allowed programs to signal to each other that they were being called from another program. The use of a shared memory section called core common also allowed programs to pass data to each other as needed. Disk files could also be used but were slower. To conserve memory, the system included a garbage collecting memory manager, used for both string data and byte-code. A running program could be interrupted, have variables examined and modified, and then be resumed.


Syntax and features

BASIC-PLUS is patterned closely on later versions of
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time-Sharing System (DTSS), it offered an interac ...
, including its powerful MAT commands. On top of this, DEC added a number of unique flow-control structures.


Editing

Line numbers were positive integers from 1 to 32767. Logical lines of code could be continued on multiple physical lines by using a
line feed A newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or ...
at the end of a line instead of the normal
carriage return A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character or mechanism used to reset a device's position to the beginning of a line of text. It is closely associated with the line feed ...
character. For ease of external editing of the source file, later versions of BASIC-PLUS also allowed the character as a line continuation character. Multiple statements could be placed on a single line using as the statement separator. The system allowed tabs to be used as inline whitespace, and was used to make loops more clear, as in modern languages. Comments used either the keyword or the character, as opposed to MS BASICs, which used and .


Standard statements

The command divided the screen into regions 14 spaces wide, and the comma was used to move between these locations; would output 1, 2 and 3 in a spaced-out fashion, while would leave a single space and produce "1 2 3". allowed a prompt string to be specified, but used the semicolon to separate it rather than the comma; Strings could be delimited by single or double quotes. In addition to the and functions that converted single characters to and from string format, BASIC-PLUS also supported Dartmouth's command. iterated the string and returned each character's ASCII value as a slot in a numeric array. For instance, would return an array with the five ASCII codes, 110, 105, 114, 114, 105, in elements 1 through 5, and the number 5, the length of the string, in element 0. One could reverse the operation as well, would read the individual numbers in the X array and convert it to a string.


Statement modifiers

BASIC-PLUS added the concept of "statement modifiers",
JOSS JOSS (acronym for JOHNNIAC Open Shop System) was one of the first interactive, time-sharing programming languages. It pioneered many features that would become common in languages from the 1960s into the 1980s, including use of line numbers as bo ...
-like conditions that could be applied to any statement. For instance, is the equivalent of The opposite was also provided, was the equivalent of . loops worked as in other versions of BASIC, and the command could not be used in an expression to exit early. Instead, the and keywords could be used to control early exits. For instance, continue looping until I=10, with the assumption that following code would set the value of I, meaning it might not exit after 10 iterations but as soon as the code set I to 10. Modifiers could also be used to build compact one-line loops, for instance, would loop until X was 100.


Variables, expressions and matrixes

Variable names in the early versions of BASIC-PLUS could be a single letter or a single letter followed by a single digit. With the inclusion of "Extend mode" in later versions, variable names could be up to 29 characters long, and dot (.) was added as a permitted character. Every variable name still had to begin with a letter. As in most versions of BASIC, the keyword, for variable assignment, was optional. It could set multiple variables to a single value, like . The language supported three data types; floating-point numbers, integers, and strings. Variables with no suffix were floating point (8 bytes, range 0.29 to 1.7, up to 16 digits of precision). Integer variables (16-bit, range −32768 to +32767) were indicated with a suffix, string variables (variable length) were indicated with a suffix. The list of mathematical and logical operators was typical of most BASICs, with some extensions. For math, , , , and were supported, along with as an alternate form of for
computer terminal A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. Most early computers only had a front panel to input or display ...
s that might not have that character. Standard logical comparisons were , , , , , and . One interesting addition was the operator, for "approximately equal". This would return true if the two numbers would be printed the same, that is, their six most significant digits were the same. Logical operators included the typical , and , along with , which return true if both A and B are true or both are false, and which is false if A is true and B is false and otherwise always true. The statement could allocate one-dimensional and two-dimensional arrays of any of the three data types. The range of subscripts always began with 0 (but statements did not set elements in row 0 or column 0). The language also included a number of commands to work with the entire array (or MATrix). The command would fill the matrix with values in a statement, would fill the array with user-typed values, and would print out the elements in a 1D or 2D format. could also be used to set default values in a matrix using associated keywords, for instance, would fill the A array with zeros. would transpose an entire matrix, and would invert it. Additionally, , , and could be used on matrixes, performing the associated matrix operation.


File processing

The "virtual DIM" statement could map "virtual data array(s)" or "virtual array(s)" to a disk file, which allowed arrays larger than the computer's available memory (or even its address space), and allowed use of array elements to read, write, and extend disk files (persistent storage). They called this arrangement "virtual data storage" and "virtual core", but it did not use the modern approach of allocating the arrays and a
memory-mapped file A memory-mapped file is a segment of virtual memory that has been assigned a direct byte-for-byte correlation with some portion of a file or file-like resource. This resource is typically a file that is physically present on disk, but can also b ...
. Instead, a single buffer was used to store 512 bytes of data at a time, and when an entry in the virtual array was accessed, the corresponding data was read, and old data written, as required. The statement caused the buffer to be written back (if necessary) before closing the file. Because no additional sectors were cached, accessing data in the "wrong" order could multiply the number of disk accesses. Additional rules were imposed on virtual arrays, such that one datum could never span a record boundary: Each data type was aligned to a multiple of its size. Virtual strings were stored as fixed-length ASCIIZ data, with sizes restricted to 2, 4, 8, 16, 32, 64, 128, 256, or 512 bytes, and were accessed using and .


Virtual machine

BASIC-PLUS was not an interpreter but a compile and go system: each line of BASIC was translated into "PPCODE" (Push-Pop Code) as it was entered, for subsequent fast execution on its virtual machine. These translations did not tokenize the BASIC lines but rewrote them for use on a stack machine; you could not translate these representations back to BASIC statements. This avoided the need to repeatedly decode the keywords as strings: once converted to PPCODE the keywords were numbers that pointed to routines to run that function. BASIC-PLUS included a command, but this was not a true compiler; this simply saved the program's PPCODE representation so that it did not have to be recompiled when the BASIC program was next loaded into memory. The system stored a user's program in two formats. One was the editable source code in text format, created using the command and normally placed in a .BAS file. The other was the PPCODE version of the program created by the command and saved to a .BAC file; .BAC files were smaller and loaded and ran faster, but could not be edited.


BASIC Plus 2

A related product called Basic Plus 2 ("BP2" or BASIC-Plus-2), was later developed by DEC to add additional features and increased performance. It used true compilation into threaded code and wrote its output to object files compatible with the machine code object files produced by the assembler and other language systems. These object files could be kept in libraries. A linker (the TKB, also known as the taskbuilder) then created executable files from object files and the libraries. TKB also supported overlays; this allowed individual routines to be swapped into the virtual address space as needed, overlaying routines not currently being used. Additionally, BP2 programs ran under the RSX Run Time System; this RTS only occupied 8KB of the user's virtual address space, leaving 56KB for the user's program. (RSTS/E version 9 introduced separate Instruction and Data space, and the "disappearing" RSX Run Time System, permitting up to 64KB of each of instruction code and data.) These two factors allowed individual BP2 programs to be much larger than BASIC-PLUS programs, often reducing the need for CHAINing among multiple programs. Unlike BASIC-PLUS (which was only available on RSTS/E), BP2 was also available for the
RSX-11 RSX-11 is a discontinued family of multi-user real-time operating systems for PDP-11 computers created by Digital Equipment Corporation. In widespread use through the late 1970s and early 1980s, RSX-11 was influential in the development of later ...
operating system. BP2 programs were also more compatible with the later VAX BASIC.


Comparison to MS BASIC

Microsoft BASIC was patterned very closely on BASIC-PLUS. Earlier versions of MS BASIC, the 1.x series, lacked integer variables, but these were added in the 2.x series that was found on many machines, including the later models of the Commodore PET and
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit computing, 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in ...
. The ability to place logical and loop commands in-line, like was not copied over and does not appear on any common version of microcomputer BASIC. MS BASIC also lacked the matrix commands.


See also

* Comparison of command shells


Notes


References


Citations


Bibliography

* * * * {{DEFAULTSORT:Basic-Plus BASIC interpreters BASIC programming language family Command shells