Jump to content

SmallBASIC

From Alfawiki
Adapted from the English Wikipedia article SmallBASIC, available under CC BY-SA 4.0Updated 8 August 2025
SmallBASIC
Company typeFree software
IndustrySoftware development
Area served
Cross-platform
ProductsBASIC interpreter, integrated development environment (IDE)
Websitesmallbasic.github.io

SmallBASIC is a BASIC language variant featuring interpreters distributed as free software under the GNU General Public License version 3, compatible with Microsoft Windows, Linux, and Android platforms.

Description

Identified by its creators as a second-generation BASIC dialect, SmallBASIC incorporates numerous elements reminiscent of QBasic. It offers trigonometric, matrix, and algebraic functions, an integrated development environment (IDE), libraries for string handling, system operations, audio, and graphics commands, along with support for structured programming constructs.

Intended application

The term "Small" originates from its initial development focus on the Palm handheld device, noted for its compact size. Emphasizing cross-platform compatibility, SmallBASIC is implemented in C using modular components customized to suit each supported operating system.

Functionally, SmallBASIC enables tasks comparable to those performed by GW-BASIC and QBasic on the IBM PC, such as rendering graphic primitives, generating sounds, manipulating strings, and presenting text in multiple fonts. It enhances Palm capabilities by introducing file management operations like "Save," "Save As," "Close," and "Open" on a platform originally lacking native filesystem support. Furthermore, it serves as a mathematical utility with built-in features for unit conversion, algebraic calculations, matrix operations, trigonometry, statistics, and graphing of two- and three-dimensional equations.

History

SmallBASIC was engineered to operate efficiently on limited hardware resources, particularly targeting Palm OS, where constraints included restricted memory, processing power, and display area. Its graphics subsystem utilized ASCII characters to enable functionality on text-only devices. Remarkably, SmallBASIC is compatible with Palm OS wristwatches manufactured by Fossil, Inc..

Platforms

The language runs on all POSIX-compliant environments such as Linux, BSD, and UNIX, as well as on DOS/DJGPP, Win32, FLTK, VTOS, the Franklin eBookMan, Cygwin/MingW, Helio/VT-OS, Android, the Nokia N770 Internet Tablet, and any platform supporting frameworks like SDL, FLTK, SVGALib, the Linux framebuffer, or the Windows graphical interface (GDI).

Syntax

SmallBASIC’s syntax bears strong resemblance to that of QBasic. The use of optional line numbers is supported, with statements terminated by newlines. Multiple commands can be placed on a single line when separated by a colon (:).

Example program displaying "Hello, World!":

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

Example demonstrating image loading and rendering:

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

Loadable modules

SmallBASIC allows extension through external modules developed in C. Since version 12.20, it includes modules for libraries such as Raylib, Nuklear, and WebSockets. Additionally, there is a dedicated module facilitating access to the GPIO pins on the Raspberry Pi.

Reception

  • According to *Tech Republic*, SmallBASIC is "an excellent tool to begin programming with."
  • *ASCII-World* describes it as "an excellent tool for mathematics"
  • David Mertz, Ph.D., together with Andrew Blais, Ph.D., from Gnosis Software commend SmallBASIC’s development environment as "one of the better [we have] reviewed."

See also

External links