SmallBASIC

Revision as of 10:46, 9 May 2025 by imported>Ira Leviton (Fixed the image in the infobox. Please see Category:Pages using infoboxes with thumbnail images.)
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description Template:About Template:Infobox programming language

SmallBASIC is a BASIC programming language dialect with interpreters released as free software under the GNU General Public License version 3 for Microsoft Windows, Linux and Android.

DescriptionEdit

The dialect is described by the authors as a second generation BASIC, and has a lot in common with QBasic. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a string library, system, sound, and graphic commands along with structured programming syntax.

Intended applicationEdit

The "Small" prefix in the name SmallBASIC reflects the project's original intention of being used with the Palm, a small hand-held device. SmallBASIC was designed for portability, and is written in C with separate modules containing any code that is unique to a particular platform.<ref name="ascii-world">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref name="gnosis.cx">PalmOS Hosted Programming Languages: Using the Palm as a Development Environment</ref>

SmallBASIC is intended to support the same sorts of applications supported by GW-BASIC and QBasic on the IBM PC, with support for drawing Graphic Primitives to the screen, creating sounds, String Manipulation, and displaying text in various fonts. SmallBASIC also adds functions such as "File Save", "Save As", "Close File", and "Open File" to the Palm, a device with no native filesystem. SmallBASIC is also intended as a tool for mathematics, with built-in functions for Unit conversion, Algebra, Matrix math, Trigonometry, Statistics, and for two and three dimensional Equation Graphing.<ref name="ascii-world" /><ref name="gnosis.cx" />

HistoryEdit

SmallBASIC was designed to run on minimal hardware. One of the primary platforms supported was Palm OS,<ref name="freshmeat">Freshmeat.net: Editing text on PalmOS using SmallBASIC.</ref> where memory, CPU cycles, and screen space were limited. The SmallBASIC graphics engine could use ASCII graphics (similar to ASCII art) and therefore ran many programs on pure text devices. SmallBASIC runs even on Palm OS wristwatches made by Fossil, Inc.

PlatformsEdit

SmallBASIC is available for all POSIX-Compliant operating systems (including Linux, BSD, and UNIX),<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> DOS/DJGPP,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Win32,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> FLTK,<ref name="McComb">Template:Cite book</ref> VTOS,<ref name="McComb" /> Franklin eBookMan,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Cygwin/MingW,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Helio/VT-OS,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Android,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> the Nokia N770 Internet Tablet.,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> and on any system that supports SDL, FLTK, SVGALib, Linux framebuffer, or Windows GUI.

SyntaxEdit

The syntax of SmallBASIC has a lot in common with QBasic. Line numbers are not required, and statements are terminated by newlines. Multiple statements may be written on a single line by separating each statement with a colon (:)

An example "Hello, World!" program is:

<syntaxhighlight lang="qbasic"> PRINT "Hello, World!" </syntaxhighlight>

An example of how SmallBASIC allows to load an image file and display the image:

<syntaxhighlight lang="qbasic"> I = IMAGE("image_name.png") 'Loads a png file I.SHOW(100,100) 'shows the image on screen at the coordinates 100,100 </syntaxhighlight>

Loadable modulesEdit

External modules can be written in C to extend the functionality provided by SmallBASIC.<ref name="smallbasicmodules">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Since version 12.20 modules for Raylib, Nuklear and WebSockets are included in the release.<ref name="smallbasicgithub">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Additionally a loadable module to access the GPIO connector of the Raspberry Pi exists.<ref name="smallbasicpigpio">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

ReceptionEdit

  • Tech Republic calls it "an excellent tool to begin programming with."<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • ASCII-World says "SmallBASIC is an excellent tool for mathematics"<ref name="ascii-world" />
  • David Mertz, Ph.D. and Andrew Blais, Ph.D. of Gnosis Software say "SmallBASIC has one of the better development interfaces [we have] reviewed. "<ref name="gnosis.cx" />

See alsoEdit

ReferencesEdit

Template:Reflist

External linksEdit

Template:BASIC