- Yabasic
Infobox_Software
name = Yabasic
caption = Yabasic running an implementation ofSameGame .
developer =Marc-Oliver Ihm
latest_release_version = 2.763 - Final
latest_release_date = August, 2007
operating_system = Windows,Unix
genre =Programming
license =GNU General Public License ,Artistic License
website = [http://www.yabasic.de/ http://www.yabasic.de/]Yabasic (Yet Another BASIC) is a free and
open source BASIC interpreter for Windows andUnix platforms. [" [http://www.yabasic.de Yabasic] ", the official website of Yabasic. 20 January] Yabasic was developed by Marc-Oliver Ihm. The Yabasic interpreter is relatively small in file size at about 250kilobyte s.History
Yabasic started as a very simple interpreter around May 1995. Although it was released as version 1.0 it lacked many features like
arrays and loops. A year later Yabasic was ported to theWin32 platform, creating version 2.0. Another big improvement was the addition ofsubroutines andlibraries in version 2.57, allowing anyone to add their own functions to the language. ["Yabasic". Official website of Yabasic. Thursday 25 January http://www.yabasic.de.]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. [ [http://www.basicprogramming.org/wiki/index.php?title=Yabasic::Dev_Article_Future_of_Yabasic Yabasic::Dev Article Future of Yabasic - Basicprogramming.org ] ] The aim is to completely rewrite the interpreter before expanding functionality.
Features
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, namedsubroutines 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 agraphical user interface based on theGTK library. Passing of arguments is always by value, except forarray s, 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.
Another useful feature is the "bind" instruction, allowing the creation of standalone
executable s by linking the interpreter to thesource code into a single file.Execution speed of the interpreter is reasonably high.who
A version of Yabasic is available for
Sony 'sPlayStation 2 . It comes free with the console inEurope andAustralasia . The demo disc containing the Yabasic interpreter is aPAL disc and is not intended for theUnited States orJapan ese PlayStation 2 markets. It is recommended to have an additionalUSB -compatible keyboard for the PlayStation version of Yabasic because programming with agamepad is rather impractical. Yabasic programs created on a PlayStation can be stored onmemory cards for later retrieval or swapping with friends.Examples
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 n=2 do for i=2 to sqrt(n) if (frac(n/i)=0) then notprime=1 break endif next i if notprime<>1 then print n endif notprime=0 n=n+1 if n>limit break loop
Adding code during execution
String variables can be "compiled" into program code at
runtime .For example, the sequence
x$= "sub printme() print "Hello world!" end sub" compile(x$)
would create a new procedure,
sub printme() print "Hello world!" end sub
This procedure can then be invoked from this point on in either the 'traditional' way,
printme()
or via the slightly more clever:
y$= "printme()" execute(y$)
Modifications
Because Yabasic is
open source anddual-licensed under both theGPL andArtistic 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 theFltk toolkit. While "Flyab" only runs onBeOS at present, ports for Windows,Mac OS X , andLinux are planned. Flyab adds the ability to Yabasic to create native graphical user interfaces on all supported platforms. ["team maui". Official website of flyab, 30 January http://team-maui.org/.]Sony also packaged a version of Yabasic for the PlayStation 2 with all PS2 consoles in PAL territories. It is widely rumoredattribution needed that this was in order to try and class the games console as a home computer in order to save money on import tax.
References
External links
* [http://www.yabasic.de/ Official Yabasic website] - downloads and documentation for Yabasic.
Wikimedia Foundation. 2010.