Basic4GL
Encyclopedia
Basic4GL is an interpreted
Interpreted language
Interpreted language is a programming language in which programs are 'indirectly' executed by an interpreter program. This can be contrasted with a compiled language which is converted into machine code and then 'directly' executed by the host CPU...

, open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 version of the BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 which features support for 3D computer graphics
3D computer graphics
3D computer graphics are graphics that use a three-dimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images...

 using OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

. While being interpreted, it is also able to compile
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 programs on top of the virtual machine
Virtual machine
A virtual machine is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software emulation or hardware virtualization or both together.-VM Definitions:A virtual machine is a software...

 to produce standalone executable
Executable
In computing, an executable file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a data file that must be parsed by a program to be meaningful. These instructions are traditionally machine code instructions for a physical CPU...

 programs.

It uses a syntax
Syntax of programming languages
In computer science, the syntax of a programming language is the set of rules that define the combinations of symbols that are considered to be correctly structured programs in that language. The syntax of a language defines its surface form...

 similar to traditional dialects of BASIC and features an IDE
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

 and a very thorough and comprehensive debugger
Debugger
A debugger or debugging tool is a computer program that is used to test and debug other programs . The code to be examined might alternatively be running on an instruction set simulator , a technique that allows great power in its ability to halt when specific conditions are encountered but which...

.

Basic4GL is not designed to compete with programming languages such as C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

; it was intended to replace older languages such as QBasic
QBasic
QBasic is an IDE and interpreter for a variant of the BASIC programming language which is based on QuickBASIC. Code entered into the IDE is compiled to an intermediate form, and this intermediate form is immediately interpreted on demand within the IDE. It can run under nearly all versions of DOS...

 or GFA BASIC
GFA BASIC
GFA BASIC is a dialect of the BASIC programming language, by Frank Ostrowski. The first version was finished in 1986. In the mid and late 80s, it became very popular for the Atari ST homecomputer range . Later, ports for the Commodore Amiga, DOS and Windows were marketed...

.

Basic4GL features the usual commands that you would expect to find in a version of BASIC such as...
  • PRINT
  • INPUT
  • GOSUB
    GOSUB
    GOSUB is a command in many versions of the BASIC computer programming language. A GOSUB statement jumps to a line elsewhere in the program. That line and the following lines up to a RETURN are used as a simple kind of a subroutine without parameters or local variables.The GOSUB command may be used...



It also includes a few features that C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 programmers will be familiar with, such as support for pointers, struct
Struct
struct is a computer science term for a record that is used to store more than one value.struct is used in the following programming languages:* struct * struct vs. C++ classes...

ures and most importantly the entire OpenGL v1.1 API.

History

Tom Mulgrew created Basic4GL from a desire to be able to run OpenGL functions easily and quickly, without all of the setup normally required in a language such as c++ and be more stable. He built a virtual machine similar to one used at his workplace. It started simply, with few OpenGL functions and minimal other functionality. The first version was relatively popular.

The first version was named GLBasic
GLBasic
GLBasic is a commercial BASIC programming language, that can compile to various platforms, including Windows, Linux, Mac OS X as well as Handhelds like Apple iPhone, Apple iPad and iPod Touch, HP WebOS devices like Palm Pre and HP TouchPad. It also supports some geek devices like Pocket PC, GP2X,...

, which also happens to be a commercial programming language. The issue was civilly resolved, and Mulgrew's project renamed Basic4GL.

Mulgrew set himself the goal to expand Basic4GL to the point that it could load and display and MD2
MD2 (file format)
MD2 is a model format used by id Software's id Tech 2 engine and is thus used by Quake II as well as many other games, most of them using this engine, including SiN and Soldier of Fortune. The format is primarily used for animated player models although it can also be used for static models...

 model.

Versions

2.3.0 - Added networking capability

2.3.5 - Support for code compilation at runtime

2.4.2 - Changed sound system from OpenAL to Audiere

2.4.3 - Support for Plugin DLLs added

2.5.0 - Support for functions added

2.5.8 - Support for hexadecimal numbers

Platform

Basic4GL was designed to run on the Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

, but versions are being developed for Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 and Mac OS
Mac OS
Mac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...

.

Basic4GL for Linux

Currently Basic4GL is being ported over to Linux. The major difference between Basic4GL for Windows and the new Linux version is that it uses the SDL
Simple DirectMedia Layer
Simple DirectMedia Layer is a cross-platform, free and open source multimedia library written in C that presents a simple interface to various platforms' graphics, sound, and input devices....

 library rather than Windows specific libraries to initialize an OpenGL enabled window. There is also a Linux based project to create an extended version of Basic4GL that wraps more closely to the SDL library known as Basic4SDL.

Basic4GL for Mac

A version for Mac OS is currently under development. No working versions have been released.

Example code

Dim A
For A = 0 To 4
Printr "Hello "; A
Next


When the above code is entered into Basic4GL and executed, the following is output to the monitor screen.

Hello 0
Hello 1
Hello 2
Hello 3
Hello 4

Support for sound and music

When Basic4GL was first released it could only play sounds but in 2006 support for music was added using the Open Al sound engine but later replaced with Audiere
Audiere
Audiere is a high-level audio API. It can play Ogg Vorbis, MP3, FLAC, uncompressed WAV, AIFF, MOD, S3M, XM, and IT files. For audio output, Audiere supports DirectSound or WinMM in Windows, OSS on Linux and Cygwin, and SGI AL on IRIX....

.

Functions and subroutines

When Basic4GL was first released it had no support for functions. That changed however when version 2.5.0 was released in January 2008. Now Basic4GL has full support for local variable
Local variable
In computer science, a local variable is a variable that is given local scope. Such a variable is accessible only from the function or block in which it is declared. In programming languages with only two levels of visibility, local variables are contrasted with global variables...

s, parameters
Parameter (computer science)
In computer programming, a parameter is a special kind of variable, used in a subroutine to refer to one of the pieces of data provided as input to the subroutine. These pieces of data are called arguments...

, forward declaration and recursion
Recursion (computer science)
Recursion in computer science is a method where the solution to a problem depends on solutions to smaller instances of the same problem. The approach can be applied to many types of problems, and is one of the central ideas of computer science....

.

Plugins

In August 2006 support for Plugin DLLs was added to Basic4GL. This means that you can write your own commands and include them in the Basic4GL programming language, all you need is a C++ Compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

. Plugins expand the capabilities of Basic4GL and many
exist, providing such things as physics engines, TrueType
TrueType
TrueType is an outline font standard originally developed by Apple Computer in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript...

 Fonts, collision detection etc.

SourceForge

Both Basic4GL for Windows and the new Linux version have been placed on SourceForge
SourceForge
SourceForge Enterprise Edition is a collaborative revision control and software development management system. It provides a front-end to a range of software development lifecycle services and integrates with a number of free software / open source software applications .While originally itself...

, this means that people are free to develop the languages and make improvements to them.

Basic4Games

A successor to Basic4GL is currently being developed dubbed "Basic4Games". Only one preview has been released.

See also

  • Brutus2D
    Brutus2D
    Brutus2D is a game programming language developed using Visual Basic, VBScript and DirectX.It is aimed at the amateur programmer who is interested in learning more about programming & game development....

  • Blitz Basic
    Blitz BASIC
    Blitz BASIC refers to the programming language dialect that was interpreted by the first Blitz compilers, devised by New Zealand-based developer Mark Sibly. Being derived from BASIC, Blitz syntax was designed to be easy to pick-up for beginners first learning to program...

  • Darkbasic
    DarkBASIC
    DarkBASIC is a commercial game creation programming language released by The Game Creators. The language is a structured form of BASIC and is similar to AMOS on the Amiga. The purpose of the language is game creation using Microsoft's DirectX from a BASIC programming language. It is faster and...

  • FreeBASIC
    FreeBASIC
    FreeBASIC is a free/open source , 32-bit BASIC compiler for Microsoft Windows, protected-mode DOS , Linux, FreeBSD and Xbox....

  • Game maker
    Game Maker
    GameMaker is a Windows and Mac IDE originally developed by Mark Overmars in the Delphi programming language. It is currently developed and published by YoYo Games, a software company in which Overmars is involved...

  • ThinBasic
    ThinBasic
    thinBasic is a BASIC-like computer programming language interpreter with a central core engine architecture surrounded by many specialized modules...

  • GLBasic
    GLBasic
    GLBasic is a commercial BASIC programming language, that can compile to various platforms, including Windows, Linux, Mac OS X as well as Handhelds like Apple iPhone, Apple iPad and iPod Touch, HP WebOS devices like Palm Pre and HP TouchPad. It also supports some geek devices like Pocket PC, GP2X,...

  • List of BASIC dialects
  • List of BASIC dialects by platform

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK