YaBasic
YaBasic is an open-source BASIC interpreter for Linux / Unix and Windows. It is characterized by its compactness (packed size of about 140 kB ) and a flexible syntax: For the color selection, for example, both the command color and color possible, and also for if ... then ... else ... endif constructs, there are a number of different syntax variants, etc.
History
YaBasic was developed from 1995 by Marc -Oliver Him. The version of 2763 was described by him in 2005 as "final " because he wanted to devote now other software projects. In 2008, the development of YaBasic by Pedro Sá and Thomas Larsen was taken. They develop patches for the version 2763 and are currently working on YaBasic 3 In December 2010, the first beta version of YaBasic 3 was released. Since then, it is to make this project become quiet. An official version 3 is so far ( end of 2012) did not appear.
Properties
YaBasic distinguished from other BASIC interpreters by the following properties:
- No line numbers
- Structured programming with control structures ( do ... loop, etc.), procedures, and modules / libraries with their own namespaces
- Self-modifying code ( for an example, see below)
- Way of generating executable executables by binding of the interpreter to the BASIC program
- Planned for Version 3: User-defined data types ( UDTs)
Examples
Hello world program
The ubiquitous Hello world program needed in YaBasic only one line:
Print " Hello world!" graphic
The following code outputs two red circles:
Open window 200,200 color 250,0,0 circle 50, 100, 80 / / simple version new curve / / somewhat more challenging for phi = 0 to 2 * pi step 0.1 to line 100 90 * sin (phi ), 100 90 * cos (phi) next phi close curve Self-modifying code
Strings can be translated by the interpreter at run time to executable code, which allows a program to modify itself.
The code section
X $ = "sub printme ( ): print \ " Hello World \ ": end sub " compile ( x $ ) generated, for example, a new procedure,
Sub printme () print " Hello world!" end sub while the program is running. From now on, the procedure may simply
Printme () or the slightly more complex command
Y $ = " printme ()" execute ( $ y ) be called.
More versions
Version 3 is since December 2009 at the beta stage.
Sony delivers YaBasic for the Playstation 2 free with the demo DVD of the PAL version.
YaBasic is available under the GPL and the Artistic License.