From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.

BASIC, short for Beginners All-Purpose Symbolic Instruction Code, is a programming language that was created in 1964 to enable college and university students without a STEM background to write software. Early versions of BASIC were interpreted and ran on time-sharing mainframe systems. Code was often input on teletype systems — essentially fancy printers that both displayed terminal output and took input from the user. Eventually this gave way to small "glass teletypes," that is, early CRT monitors.


The first dialects of BASIC were imperative in nature but not structured. That is, they lacked support for subroutines with signatures and return values. Use of line numbers as GOTO jump targets resulted in difficult to follow "spaghetti code." Soon, on mainframe platforms at least, compiled dialects of BASIC became reasonably common. Some of these dialects retained the need for line-numbers, others used line labels on an as-needed basis to allow the programmer to specify a jump target with a human readable name. This soon gave way to more structured ways of writing BASIC code.

From the late 1970's, at the dawn of the microcomputer revolution, early home-based computers with mere kilobytes of RAM often came with primitive versions of BASIC built into the system ROM. (A rare few preferred Forth instead.) Most of these interpreters were extremely spartan, owing to extreme memory and processing limitations of the day. Some versions of BASIC supported only integer math, while others fully supported floating point arithmetic. Some systems even lacked support for lower-case letters. Nearly all had reverted to line-number only versions of BASIC that indirectly discouraged structured programming. Worse the proliferation of different, architecture specific disk formats made file sharing (in an era before ubiquitous computer networking) difficult at best.

Throughout the 1980's and 1990's BASIC began to evolve. Some versions of the language were embedded into larger applications, others were intended for business use and supported both structured programming and object oriented paradigms. By the dawn of the world wide web, BASIC had lost most of its market share except as an introductory language to teach novice programmers. Serious business application development had shifted from compiled BASIC to COBOL and then to Java. System administration and reporting tasks had shifted from interpreted dialects of BASIC to Perl and shell scripts.

By the mid 1990's, these pressures forced BASIC to evolve. BASIC was forced to become structured, which allowed libraries (modules) to be shared among serious BASIC enthusiasts. Eventually, structured BASIC gave way to object oriented dialects of the language.

Today, Python has dethroned BASIC as the preferred introductory programming language. While BASIC is rarely used in a business a large environment outside of being embedded in a larger application, it's still popular among some small business, hobbyists, novice programmers, and retrocomputing enthusiasts.

BASIC on Gentoo

Gentoo has a number of BASIC interpreters and compilers, each with its own strengths and weaknesses:

  • dev-lang/bas — Bas is an open source classic BASIC dialect very much in the mold of the 1980's microcomputer era.
  • dev-lang/mono-basic — Mono BASIC is an open source Visual Basic.NET compiler with full object oriented BASIC support that integrates well with other languages that use the Mono runtime.
  • dev-lang/fbc (GURU) — FreeBASIC is an open source BASIC compiler that started out as a reimplementation of Microsoft QuickBASIC; a classic-yet-structured BASIC dialect. This evolved into a compiler that supports three dialects of BASIC ranging from classic, to structured, to fully object oriented, in the same compiler.