Basic

See also: BASIC

In Programming, BASIC is a Acronyme for B eginner' S has L-purpose S ymbolic I nstruction C ode. which designates a family of computer programming languages high level. The BASIC was conceived at the base in 1963 by John George Kemeny (1926 - 1993) and Thomas Eugene Kurtz (1928 -) with the “Dartmouth College” to allow the students not working in scientific sectors to use the computers. Indeed, at the time, the use of the computers required the use of a Computer programming language Assembleur dedicated, that of which only the specialists were able.

This acronym is dependant in the name of an article of Thomas Kurtz which was not published and does not have any relationship with the series entitled “English BASIC” of C.K. Ogden. The originators of the language wished that it be public domain, which supported its diffusion.

The BASIC is indissociable appearance, in the Années 1980, of the Micro-informatique general public. Indeed, the majority of the Micro-ordinateur S sold during this period were provided with a Interprète BASIC, and some programmable Calculatrice S was even equipped with it.

The eight principles of design of the BASIC were:

  1. To be easy to use for the beginners ( Beginner )

  2. To be a language general practitioner ( general-purpose )
  3. To authorize the addition of functionalities for the experts (while keeping the simple language for the beginners)
  4. To be interactive
  5. To provide clear and convivial error messages
  6. To have a weak response time for the little programs
  7. not to require the comprehension of the material of the computer
  8. To isolate ( shield ) the user from the Operating system

History

The BASIC is perhaps the the most known Computer programming language. The original form of the language is based on FORTRAN, with additions to make it interactive and able to use arithmetic tables. Although there were many produced interpreters BASIC, nothing prevents this language from being compiled, which is besides the case in the modern products. In spite of its standardization, several dialects appeared during the years, with the same base of the language and including improvements on the graphical interfaces and a structure of the type Orienté object.

The first version of the BASIC was developed on a Mainframe real-time called GE-256 (General Electric), which was a GE-235 with a GE DataNet-30. It was the first language especially conceived to be used on interactive systems. In spite of its popularity, the BASIC was scorned by the majority of the Informaticien S little time after the development of the first version.

In its original form, the language BASIC, with its loops in spaghetti and its execution line by line, was sometimes associated with the expression " A program runs on a ordinateur". But makes this expression of it is much older than the BASIC. It was thus used for languages such as the FORTRAN or the Algol which existed before the BASIC. I think that the verb " should simply be considered; tourner" like a translation of the English word " run" , with in connotation the idea that a computer program, whatever it is, has loops in general.

During the first times, there was no interpreted version. However, with the arrival of the first personal computers, the interpreted versions of the BASIC proliferated. The developers and manufacturers of the first personal computers with keyboard needed to include a tool making it possible to people to write software to be used on their computers. The BASIC was made for this purpose since it was conceived for the use on a Computer terminal , and an interpreted version could then adapt in the small space of Read-only memory (ROMANIAN) available. Many computer programming languages was too large to be installed on small spaces of ROMANIAN of the machines and did not have any Environnement of development integrated of defined, whereas the BASIC had of them an embryo with the orders old, new, list and some others already inside definite even of the language, conferring its interactive capacities to him.

Almost all the first personal computers had an interpreter BASIC in ROMANIAN (C64, TRS-80, APPLE II, etc).

In 1968, an article of Edsger Dijkstra considered that the computer programming languages using only Goto had a harmful incidence on the productivity of the programmer and the quality of the code resulting ( Communications from the ACM n°11, p. 147-148. 1968). This criticism applied then to the dialects of the BASIC. The dialects and versions which appeared ten to twenty years later took this criticism in account and it did not have any more a raison d'être for the BASIC. However, the popularity of the BASIC, computer programming language general public par excellence, made say to some that this language gave rise to more bad programs than any other language.

Borland published the Turbo BASIC 1.0 in 1985. The following versions are still sold under the name of PowerBasic by another company. There exists always a version MS-DOS.

The most widespread versions were designed by Microsoft. In 1977 Microsoft left the Altair BASIC for the Altair 8800 the manufacturer MITS. It was the first Logiciel developed and marketed by Microsoft. In 1979 Microsoft was in talks with IBM in order to hold a license of the interpreter BASIC of the futures IBM PC and PC compatible. This version was included in the ROMANIAN chip of the Bios of GCV, and was charged with starting. Later, Microsoft sold various versions of the BASIC for DOS, of which Basica, GW-BASIC, Quick BASIC and Visual BASIC for MS-DOS. Microsoft Windows 95 and Windows 98 included an interpreter QBasic to be installed starting from CD-ROM and Windows 98 included an interpreter VBScript. Visual BASIC for Applications was added in the products Microsoft Office in 1997.

Meanwhile, the need for teaching a computer programming language based on healthier bases, gave rise to the Langage PASCAL in 1972. This language, in particular thanks to the compiler Turbo Pascal of the company Borland, much faster than any Interpreter BASIC of the time, gained an enormous success during the Années 1980, and marked the beginning of the decline of the popularity of the BASIC in the general public.

Syntax

The really minimal syntax of the BASIC needs only LET (declaration of a variable), PRINT (screen display), IF-THEN-ELSE (conditional execution) and GOTO (jump towards a zone of the program). A Interprète which carries out programs with this minimal syntax does not need a pile. Number of the first implementations on Micro-ordinateur had only that, the programs were thus not structured. If a pile is added, the loop FOR-NEXT and orders it GOSUB (jump towards a subroutine) can be added. (The pile is necessary for the GOSUB, but not for the FOR.)

Interpreters with number of line

The first Interpreters BASIC were based on numbers of line, like FORTRAN. In general, the editor, in line of order, allowed to carry out an instruction. If one made precede the instruction by a number, this was interpreted like a line of program; one could have one program at the same time in memory.

The practice was to number the lines of 10 into 10, in order to be able to insert lines if need be additional. One could put several orders on the same line, separated by a colon. However, It was not possible of regouper a number of orders being carried out together, such as for example after a condition IF-THEN; it was thus necessary necessarily to resort to jumps of line GOTO.

Modern interpreters

The modern dialects BASIC do not employ any more the numbers of lines and have a richness of orders and a construction of the declarations of data identical to other languages like the Langage PASCAL or the Modula 2.

Recent alternatives as the Visual BASIC introduced a orientation object with management of the implementation of interfaces and, in Visual BASIC .NET the heritage (simple). However the management of the errors generally requires the use of GOTO, which breaks the structuring of the programs. Visual BASIC .NET allows the use of blocks Try/Catch, but preserves nevertheless the possibility of using of One GoTo Error, to preserve a certain compatibility with the traditional versions of Visual BASIC.

The richness of the alternatives is synonymous with not-standardization. That shows as this language is “organic” and as it is rather a subculture which treats the programming of computer like fixed whole of rules of syntax. But the same thing applies as much to the other “old men” computer programming languages like the Cobol and FORTRAN. However the movement of BASIC is most important by far.

Procedures

The BASIC (except Visual BASIC or the Visual BASIC .NET) does not have a library external standard like other languages, the Langage C for example. Instead of that, the Interpreter or the compiler contains a wide integrated library of intrinsic procedures. These procedures include more tools than that which the programmer needs to learn the programming and to write simple applications, of which mathematical functions, functions of treatment of the character strings, of input-output Console, graphics and handling of files. The Quick-BASIC makes it possible to include libraries written in this language (QLB) or in other languages (LIB).

Certain dialects BASIC do not make it possible to the programmers to write their own procedures. Because of that, the programmers are obliged to write their programs with an important use of goto and gosub. With the result that it is very difficult to follow such a source code, usually called a “code spaghetti”. Many versions of the BASIC as the Microsoft Quick BASIC added a support of the sub-routines and functions (with support of the recursivity). It makes the distinction between a procedure which never turns over value (called sub-routine or sub ) and a procedure which return from there (called function). Certain languages do not make this distinction and just like consider a function of which some return an “empty” value.

The BASIC is well-known for its functions of handling of character strings. The first dialects had already a whole of basic functions (left$, mid$, right$) to treat them simply. As they are often used in the applications of the every day, that is a considerable advantage.

Types of data

Each dialect basic BASIC manages the data of the whole type and character string. Normally, they do not need to declare them like such, but the modern dialects have the option to force the type (typically by using a directive called “Explicit Option”). The modern types of data supported by the BASIC include: Boolean, whole signed on 16 bits, entireties signed on 32 bits, character strings, decimal numbers. Certain dialects as Visual BASIC have more intrinsic types of data. Moreover, certain dialects make it possible the user to define his own types, called standard defined by the user , and which are currently Structure S, i.e. a simple variable containing several fields.

Availability and alternatives of dialect

The BASIC is available for all the recent platforms. An interpreted version free which is in conformity with the standards and highly multi-punt-form is the ByWater BASIC. The Interpreter is written in Langage C and is under a license GNU. He does not make it possible to make user interfaces graphs (GUI).

A version free, similar to the Visual BASIC and turning under Windows and GNU/Linux, and thus making it possible to make graphic environments (GUI), exists and is called the Phoenix Object BASIC. There is another the more recent: Gamba.

Most known of the compiled versions is the Quick BASIC of Microsoft and the QBasic, a version which does not make it possible to generate autonomous programs. The last versions of Visual BASIC are also compiled, although Microsoft changed Visual BASIC into a compatible language in a minimal way with the first version of the Dartmouth BASIC.

Other versions, whose PowerBasic of PowerBasic , the True BASIC of True BASIC , are in conformity with official ultimate of the BASIC (True BASIC Inc. was rested by the original creators of the BASIC).

RealBasic is an alternative available for the Apple Macintosh which generates also the achievable ones for Microsoft Windows and GNU/Linux.

An alternative of a simple dialect BASIC for the virtual Machine Parrot watch how an Interpreter BASIC is applied in a language of the type assembler.

The PureBasic is an alternative with a simple syntax but with a fast production and small achievable files, for Windows, GNU/Linux, AmigaOS and Mac OS. It can also compile and contain instructions out of in line assembler.

The BlitzBasic and the DarkBasic are alternatives specialized in the creation of video games with an access simplified to the application program interface (API) multimedia such OpenGL and DirectX. The Compilateur is paying in both cases. This alternative is optimized. One can quickly have good performances for beginners.

Liberty BASIC is specialized in the easy development of graphical interface, it is recognized like the successor of QBASIC.

The SmallBasic is a dialect which functions on a great number of platforms (Win32, MS-DOS, GNU/Linux and Palm OS) and is placed under a license GNU.

The FreeBASIC developed by a dying QBasic community, is a compiler 32-bits distributed under license LPG. It is multi-punt-form and, although still in version béta, very promising. Its syntax is copied on that of QBasic from Microsoft but it supports from now on the pointers, the assembler in-line and soon a directed branch object should be built-in.

There exists also a version BASIC for OpenOffice, called OOoBasic (it is the same language used for StarOffice, even if its name, StarBasic, change).

The Ti-BASIC is the computer programming language used on certain computer Texas Instruments.

Examples

Example 1: original BASIC not structured (Applesoft BASIC)

10 INPUT " Which is your nom" ; NOM$ 20 PRINT " Hello " ; NOM$ 30 INPUT " How much stars you want " ; NUMBER 40 FOR I = 1 TO NUMBER 50 ETOILE$ = ETOILE$ + " *" 55 NEXT I 60 PRINT ETOILE$ 70 INPUT " You want more étoiles" ; ETOILE$ 80 IF LEN (ETOILE$) = 0 GOTO 70 90 ETOILE$ = LEFT$ (ETOILE$, 1) 100 IF (ETOILE$ = " O") HOWEVER (ETOILE$ = " o") THEN GOTO 30 110 PRINT " Goodbye " ; 120 FOR I = 1 TO 200 130 PRINT NOM$; " " ; 140 NEXT I 150 PRINT

Comments:

  • in general, the Interpreter is not sensitive to the breakage; by practice, the instructions were typed in capital letters;

  • a name of variable followed by a sign Dollar indicates that it is about a Character string (NOM$, ETOILE$, S$); a variable without sign dollar indicates an entirety or a decimal number (S, I);
  • INPUT allows the posting of a text and a seizure of the keyboard; PRINT allows a screen display;
  • the instruction LET is optional, thus, LET ETOILE$ = ETOILE$ + " *" is written simply ETOILE$ = ETOILE$ + " *" (the equal sign is used at the same time with the assignments of variables and the test as equality);
  • FOR-NEXT is a loop;
  • IF-THEN is a conditioned execution; OR is the logical Operator “Or”;
  • LEN is a function returning the length of has character string, LEFT$ (ETOILE$, N ) is a function returning a under-chain made up of N characters located on the left of the chain Q$; + is the operator of Concaténation (it is also the operator of the Addition).

Example 2: structured modern BASIC

INPUT " Which is your nom" ; UserName$ PRINT " Hello " ; UserName$ C INPUT " How much stars you want " ; NumStars Stars$ = " " Stars$ = REPEAT$ (" *" , NumStars) '<-ANSI BASIC 'Stars$ = STRING$ (NumStars, " *") '<-ms BASIC PRINT Stars$ C INPUT " You want more étoiles" ; Answer$ LOOP UNTIL Answer$ <> " " LOOP WHILE UCASE$ (LEFT$ (Answer$, 1)) = " O" PRINT " Goodbye " ; FOR HAS = 1 TO 200 PRINT UserName$; " " ; NEXT HAS PRINT

Dialects

Dialects functioning on several platforms

  • Antiryad Gx (MS-DOS, AmigaOS, Macintosh, Linux, Windows)

  • BASIC/Z (or ZBASIC) (CP/M, MDOS)
  • BBC BASIC (Acorn (Electron, BBC, Archimedes, RISC PC), MS-DOS, CP/M)
  • Blitz BASIC (AmigaOS, PC)
  • Bywater BASIC (aka bwBASIC) - BASIC To interpret for MS-DOS and POSIX. It is a little like GWBasic.
  • C-BASIC (CP/M, MS-DOS) - Successor of BASIC-E
  • FreeBasic (MS-DOS, Windows, GNU/Linux) - LPG
  • GfA BASIC (Atari ST, AmigaOS, MS-DOS, Windows)
  • HiSoft BASIC (Amiga, Atari ST, ZX Spectrum)
  • HotBasic (Win32, Linux)
  • Izibasic (Palm)
  • Microsoft BASIC (several platforms)
  • Omikron BASIC (Atari ST and Mac OS)
  • Phoenix Object BASIC (Windows, GNU/Linux)
  • PowerBasic (MS-DOS and Win32) - successor of Turbo BASIC
  • ProvideX (Windows, GNU/Linux, Mac OS)
  • PureBasic (Windows, GNU/Linux, AmigaOS and Mac OS)
  • RapidQ (Windows, Linux, Solaris/Sparc and HP/UX)
  • REALbasic (Macintosh, Windows, Win32)
  • SdlBasic
  • SmallBasic (Windows, GNU/Linux, and Palm OS) - GNU
  • True BASIC (MS-DOS, Windows, Macintosh)
  • UBasic (DOS and Windows) - Developed in Japan, near to GWBASIC but with functions more powerful mathematics, an english language version and Frenchwoman exist
  • WxBasic (Linux and Windows)
  • XBasic (Windows, Linux) - (GNU)
  • Yabasic (Windows and GNU/Linux) - LPG

Dialects which function on a single platform

Integrated BASIC/Languages of scripts based on BASIC

Others/unknown/not sorted

Documents defining the BASIC

  • ANSI Standard for Minimal BASIC (ANSI X3.60-1978 " MINIMAL FOR BASIC")

  • ISO Standard for Minimal BASIC (ISO/CEI 6373:1984 " PROCESSING DATED - PROGRAMMING LANGUAGES - MINIMAL BASIC")
  • Standard
  • ANSI for Full BASIC (ANSI X3.113-1987 " PROGRAMMING LANGUAGES FULL BASIC")
  • Standard ISO for Full BASIC (ISO/CEI 10279:1991 " INFORMATION TECHNOLOGY - PROGRAMMING LANGUAGES - FULL BASIC")
  • ANSI Addendum Defining Modules (X3.113 INTERPRETATIONS-1992 " BASIC TECHNICAL INFORMATION BULLETIN # 1 INTERPRETATIONS OFF ANSI 03.113-1987")
  • ISO Addendum Defining Modules (ISO/CEI 10279:1991/Amd 1:1994 " INDIVIDUAL MODULES AND CHARACTER ENHANCEMENT" INPUT;)

In the number of the popular models which used it appear:

  • the series CPC of Amstrad

  • the series MO and TO of the mark Thomson
  • models of the mark Commodore
  • DAI Imagination machine
  • the Apple I, II, III and alternatives
  • TI99-4 of Texas Instruments
  • to models of Thomson (undertaken French)
  • Certain computers Casio
  • impossible to circumvent ZX-81
  • the Tektronix 4051 (graphic BASIC on remanent screen)
  • the Olivetti P6060
  • the Olivetti M10 (computer having 24 KB or 32 KB of nonvolatile RAM with BASIC in ROMANIAN, and not of hard drive nor of diskettes)
  • the IBM PC and PC compatible whose first models had a BASIC in ROMANIAN

References

Random links:Jian' year | Delors-Scrivener plan | Kimio Eto | Yves Bréart de Boisanger | 24 hours of Mans 1930