Yabasic (Yet Another BASIC) is a free and open source BASIC interpreter for Windows and Unix platforms. Yabasic was developed by Marc-Oliver Ihm. The Yabasic interpreter is relatively small in file size at about 250 kilobytes.
Since then, Ihm has stated that "probably (he) will not develop Yabasic any further (beyond version 2.763) within the foreseeable future", due to a lack of time. Yet, there are efforts from other developers to pick up the project which have already resulted in minor bugfixes. The aim is to completely rewrite the interpreter before expanding functionality.
Yabasic can draw simple line graphics in colour as of version 2.760. As well as "conventional" features, Yabasic offers structured programming (various block structures, named subroutines with return values and code modules with separate namespaces). On the other hand, composite data structures are missing. Yabasic also offers the possibility to create a graphical user interface based on the GTK library. Passing of arguments is always by value, except for arrays, which are always by reference.
The interpreter is very lenient in syntactical matters - for example, both color and colour are legal variants for the same command. Likewise, there are a number of different versions for if and for constructs, giving the programmer freedom of choice in their design.
Yabasic programs can be self-modifying (see section below) by turning string variables into blocks of code through the compile command.
Execution speed of the interpreter is reasonably high.
A version of Yabasic is available for Sony's PlayStation 2. It comes free with the console in Europe and Australasia. The demo disc containing the Yabasic interpreter is a PAL disc and is not intended for the United States or Japanese PlayStation 2 markets. It is recommended to have an additional USB-compatible keyboard for the PlayStation version of Yabasic because programming with a gamepad is rather impractical. Yabasic programs created on a PlayStation can be stored on memory cards for later retrieval or swapping with friends.
The classic Hello World program looks like this in Yabasic,
print "Hello World"
The following example will calculate prime numbers,
print "This program will calculate the prime numbers below the limit"
input "limit: " limit
for i=2 to sqrt(n)
if (frac(n/i)=0) then
if notprime<>1 then
if n>limit break
For example, the sequence
x$= "sub printme() n print "Hello world!" n end sub"
would create a new procedure,
print "Hello world!"
This procedure can then be invoked from this point on in either the 'traditional' way,
or via the slightly more clever:
Because Yabasic is open source and dual-licensed under both the GPL and Artistic License, anyone can make their own versions and modifications of Yabasic. There is a version of Yabasic called "Flyab", which is a port of Yabasic to the Fltk toolkit. While "Flyab" only runs on BeOS at present, ports for Windows, Mac OS X, and Linux are planned. Flyab adds the ability to Yabasic to create native graphical user interfaces on all supported platforms.
Sony also packaged a version of Yabasic for the PlayStation 2 with all PS2 consoles in PAL territories. It is widely rumored that this was in order to try and class the games console as a home computer in order to save money on import tax.