FreeBASIC

FreeBASIC

Infobox programming language
name = FreeBASIC

paradigm = Procedural / Object Oriented
year = 2004
designer = Andre Victor
developer = The FreeBASIC Development Team
latest_release_version = 0.20.0 Beta
latest_release_date = release date|2008|08|10
typing = Static
implementations =
dialects =
influenced_by = QuickBASIC, C
operating_system = DOS, Linux, Microsoft Windows
license = GNU GPL, Standard libraries licensed under the GNU LGPL
website = http://www.freebasic.net

FreeBASIC is a free/open source (GPL), 32-bit BASIC compilercite web|url=http://freebies.about.com/od/computerfreebies/qt/freebasic.htm|title=FreeBASIC the Successor to QuickBASIC|date=|accessdate=2008-08-17|author=Lee Seats|publisher=About.com] for Microsoft Windows, protected-mode DOS (DOS extender), Linux, and Xbox.

FreeBASIC allows a high level of support for programs written for QBasic, by using the "QB" dialect. Many programs written for QBasic will compile and run in this mode without any changes needed. However, most substantial programs will need changes to be made before they can be compiled using the default dialect.

Features

FreeBASIC is a self-hosting compiler, being roughly 120,000 lines of code (compiler core only, not including libraries).

It makes use of the GNU binutils programming tools as backends and can produce console and graphical/GUI executables, besides dynamic and static libraries. FreeBASIC fully supports the use of C libraries and partial C++ library support. This lets programmers use and create libraries for C and many other languages.

FreeBASIC is not yet an optimizing compiler, but it has been rated close in speed with mainstream tools, such as GCC [cite web |title=The Computer Language Benchamarks Game FreeBASIC vs.gcc |url=http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=fbasic |accessdate=2008-04-28 |format= |work=]

yntax

FreeBASIC syntax attempts to stay as close to the BASIC syntax as possible, specifically that of QuickBASIC. Although the syntax attempts to stay compatible with its predecessor, FreeBASIC follows modern standards and coding practices. Standard procedural features, along with object oriented features such as types as objects, operator overloading, function overloading, namespaces, etc., have been added in FreeBASIC.

FreeBASIC's lines end when the end-of-line characters are found, or with a colon. Because of this, lines don't have to have a special character (such as the semicolon in C) to notify the compiler of the end of line. Multiple statements may be written on one line by separating each statement with a colon :.

FreeBASIC supports block commenting along with end of line remarks. Full line comments are made with an apostrophe ', while blocks of commented code begin with /' and end with '/.

Compatibility

FreeBASIC is a successor to the QuickBASIC programming language. Changes were made during development to keep FreeBASIC compatible with modern utilities, and facilitate advanced programming features. In order to keep the compiler moving forward, GCC compliant, and to also retain the ability to use a QuickBASIC compatible language, the "-lang" option set was created.

- When choosing Language Set FB ("-lang fb" as a command-line argument), all of the new features that FreeBASIC offers are available, and the "hackish" features from QuickBASIC (that were incompatible with modern programming practices) are disallowed.

- Language Set FB-Lite ("-lang fblite") provides access to most of the new, non-object-oriented features of FreeBASIC, but allows a coding style similar to that of older versions of BASIC. Syntax rules, such as allowing implicit variables, suffixes, GOSUB / RETURN, numeric labels, etc., are permitted in this "lang" option.

- Language Set QB ("-lang qb") is similar to "-lang fblite", but is more focussed on specifically replicating QBASIC-like behavior. "-lang qb" is designed to make it easier to run programs originally written for QBASIC, and is useful in cases where "-lang fblite" is not compatible enough.

Example Code

As in QBasic, a program to write a line of text to the screen can be done with a simple statement:print "Hello, World!"

Graphics library

FreeBASIC has a built-in 2D, software graphics library to be QuickBASIC compatible, which provides the user with simple graphics primitives (such as rectangles, lines, and circles), blitting, and additional features which weren't present in QuickBASIC's graphical library. The library itself is not OS dependent, so code is portable across platforms with the library.

Although the library is built-in, it is only included if one chooses to use it, which is done simply by including a call to the FBgfx "Screen" command. Common libraries such as OpenGL + Creating a Window with your API (Windows, Linux, Etc.) for hardware acceleration can be used without interfering with the FreeBASIC graphics library.

Future development

FreeBASIC continues to make development progress toward its goal of being a GCC front-end [cite web |title=FreeBASIC Todo List on Sourceforge |url=http://fbc.svn.sourceforge.net/viewvc/fbc/trunk/FreeBASIC/src/compiler/TODO.txt?view=markup |accessdate=2007-07-31 |format= |work=] , which would allow many features found in C++ and other object-oriented programming languages, portability to nearly any modern system, and advanced optimization techniques.

With the release of version 0.17 object oriented programming (OOP) was introduced adding classes, extending the basic type. Further implementations are expected.

References

External links

* [http://www.freebasic.net/ Official site]
* [http://www.freebasic.net/forum Official forum]
* [http://sourceforge.net/projects/fbc/ SourceForge homepage]
* [http://www.freebasic.net/wiki/ FreeBASIC Documentation in Wiki Format]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • FreeBASIC — Basisdaten Entwickler Quelloffen (Open Source) Aktuelle Version 0.23 (7. August 2011) …   Deutsch Wikipedia

  • FreeBasic — Basisdaten Entwickler: Quelloffen (Open Source) Aktuelle Version …   Deutsch Wikipedia

  • Freebasic — Basisdaten Entwickler: Quelloffen (Open Source) Aktuelle Version …   Deutsch Wikipedia

  • FreeBASIC — Семантика: мультипарадигменный: процедурное программирование Появился в: 2004 Автор(ы): The FreeBASIC Development Team Типизация данных …   Википедия

  • FreeBASIC — est un compilateur de langage BASIC pour les plateformes DOS, Linux et Windows. Il est placé sous licence publique générale GNU et permet de créer des exécutables 32 bits dans des modes graphiques haute résolution basés sur une bibliothèque… …   Wikipédia en Français

  • FreeBasic — est un compilateur de langage BASIC pour les plateformes DOS, Linux et Windows. Il est placé sous licence publique générale GNU et permet de créer des exécutables 32 bits dans des modes graphiques haute résolution basés sur une bibliothèque… …   Wikipédia en Français

  • FreeBASIC — Desarrollador(es) Equipo de desarrollo de FreeBASIC http://www.freebasic.net Información general Paradigma Procedural, orientado a objetos …   Wikipedia Español

  • FreeBASIC — es un compilador gratuito, de fuente abierta (licencia GPL), de 32 bits del lenguaje BASIC. Se diseñó para ser compatible en sintaxis con QuickBASIC, aportando nuevas capacidades . Puede compilarse para DOS, Microsoft Windows, Linux, y XBOX y… …   Enciclopedia Universal

  • FreeBasic — …   Википедия

  • FBRTL — FreeBASIC Basisdaten Entwickler: Quelloffen (Open Source) Aktuelle Version …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”