This article'slead sectionmay be too short to adequatelysummarize the key points. Please consider expanding the lead toprovide an accessible overview of all important aspects of the article.(February 2026) |
| SmallBASIC | |
|---|---|
| Stable release | |
| Implementation language | BASIC |
| License | GPL 3 |
| Filename extensions | .bas |
| Website | smallbasic.github.io |
SmallBASIC is aBASICprogramming languagedialect withinterpreters released asfree software under theGNU General Public License version 3 forWindows,Linux andAndroid.
The dialect is described by the authors as a second generation BASIC, and has a lot in common withQBasic. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a string library, system, sound, and graphic commands along with structured programming syntax.
The "Small" prefix in the name SmallBASIC reflects the project's original intention of being used with thePalm, a small hand-held device. SmallBASIC was designed for portability, and is written inC with separate modules containing any code that is unique to a particular platform.[2][3]
SmallBASIC is intended to support the same sorts of applications supported byGW-BASIC andQBasic on theIBM PC, with support for drawinggeometric primitives, playing 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 forUnit conversion,Algebra,Matrix math,Trigonometry,Statistics, and for two and three dimensionalEquation Graphing.[2][3]
SmallBASIC was designed to run on minimal hardware. One of the primary platforms supported wasPalm OS,[4] where memory, CPU cycles, and screen space were limited. The SmallBASIC graphics engine could use ASCII graphics (similar toASCII art) and therefore ran many programs on pure text devices. SmallBASIC runs even on Palm OS wristwatches made byFossil, Inc.
SmallBASIC is available for allPOSIX-Compliant operating systems (includingLinux,BSD, andUNIX),[5]MS-DOS/DJGPP,[6]Win32,[7]FLTK,[8] VTOS,[8]Franklin eBookMan,[9]Cygwin/MingW,[10] Helio/VT-OS,[11]Android,[12] theNokia N770 Internet Tablet.,[13] and on any system that supportsSDL,FLTK,SVGALib,Linux framebuffer, orWindows GUI.
The syntax of SmallBASIC has a lot in common withQBasic.Line numbers are not required, and statements are terminated bynewlines. Multiple statements may be written on a single line by separating each statement with acolon (:)
An example"Hello, World!" program is:
PRINT"Hello, World!"
An example of how SmallBASIC allows to load an image file and display the image:
I=IMAGE("image_name.png")'Loads a png fileI.SHOW(100,100)'shows the image on screen at the coordinates 100,100
External modules can be written inC to extend the functionality provided by SmallBASIC.[14] Since version 12.20 modules forRaylib,Nuklear andWebSockets are included in the release.[15] Additionally a loadable module to access theGPIO connector of theRaspberry Pi exists.[16]
SmallBASIC.