Welcome to SmallBASIC

one more basic

SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system, sound, graphic commands and communication via serial or sockets along with structured programming syntax.

' Example for using functions in SmallBASIC

s = AddStrings("My", "String")
print s

func AddStrings(a, b)
    return a + b
end

Programming Made Easy for All

SmallBASIC is available for various operating systems, including Windows, Linux, and Android. You can even build it from source to run on many other POSIX-compliant systems, such as Raspberry Pi OS for the Raspberry Pi. With its built-in Integrated Development Environment (IDE), you can write programs on your Android-powered tablet or mobile phone and run them instantly. If you want to get started, you can download SmallBASIC from our (Downloads) page.

SmallBASIC makes it easy to bundle your program with all the necessary libraries, creating executable files for Windows (exe-files) or Linux (AppImage). For Android, you can create a signed package (pkg) and distribute it through platforms like Google Play. Learn more about distributing your program on our (Distribution) page.

If you prefer an online experience, you can start programming with the web-based version of SmallBASIC in your browser right now. Just click on Start online to begin coding.

Editors, IDE and SmallBASIC versions

SmallBASIC comes in three different flavors for the desktop. The SDL version offers a simple but efficient IDE and is perfect for working with graphics. The FLTK version has a great IDE. The console version doesn’t offer an IDE and is text-only but works perfect with plugins like raylib or nuklear (Downloads).

No matter which SmallBASIC version you prefer, external editors like Visual Studio Code, Geany, Sublime Text or KDE Kate can be setup for syntax highlighting or code execution (Setup external editors).

Instructions on how to use the editor in the SDL and Android version can be found in the article Android

Units

Units are sets of functions, procedures and constants bundled in a BASIC-library and can be imported in your program. Units use their own namespace and therefore are separated from your program.

' Example for importing the CSS color-name unit

Import crgb as c

Color c.Black, c.Tomato
Print " Standard CSS Tomato background color "
Color c.Black, c.LightSteelBlue
Print " Standard CSS LightSteelBlue background color "

rect 200, 200, 400, 400 COLOR c.DeepPink filled

Plugins

Plugins are libraries written in C which extent the functionality of SmallBASIC. SmallBASIC offers an API to write your own plugins. The following plugins are part of the release version of SmallBASIC: raylib (2D and 3D game development), nuklear (GUI programming), clipboard, gifencoder and WebSockets. You can also import a plugin for the Raspberry Pi to use the GPIO ports and some additional hardware like displays or temperature sensors.

' Example how to use raylib to open a window and print text.

import raylib as rl
import raylibc as c

const screenWidth = 800
const screenHeight = 450

rl.InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
rl.SetTargetFPS(60)

while (!rl.WindowShouldClose())
    rl.BeginDrawing()
        rl.ClearBackground(c.RAYWHITE)
        rl.DrawText("Congrats! You created your first window!", 190, 200, 20, c.LIGHTGRAY)
    rl.EndDrawing()
wend
rl.CloseWindow()

More information

Read more in the short user guide or in the SmallBASIC handbook. See the documentation of all SmallBASIC commands in the language reference or browse additional articles in the article section.

News

SmallBASIC version 12.26 has been released for Windows, Linux and web browser

March 26, 2023

For details see: Latest release. Please report any issues to either the forum, email or github issues page.

SmallBASIC version 12.24 has been released for Windows, Linux and web browser

June 20, 2022

For details see: Latest release. Please report any issues to either the forum, email or github issues page.

New article: “Language Support” provided by Joe7M

February 15, 2022

For details see: Language Support

SmallBASIC version 12.23 has been released

August 31, 2021

For details see: Latest release. Please report any issues to either the forum, email or github issues page.

SmallBASIC version 12.20 has been released

January 8, 2021

This release includes new loadable modules with support for RAYLIB, Nuklear and WebSockets. For details see: release notes. Please report any issues to either the forum, email or github issues page.

SmallBASIC version 12.19 has been released

July 16, 2020

For details see: release notes. Please report any issues to either the forum, email or github issues page.

New teaching resource: “Programming SmallBASIC” provided by Gerard Thomas Labèrnia

April 11, 2020

For details see: Articles

SmallBASIC version 0.12.18 has been released

March 16, 2020

For details see: release notes. Please report any issues to either the forum, email or github issues page.

SmallBASIC version 0.12.17 has been released

December 22, 2019

For details see: release notes. The windows package includes sbasici.exe which is a recreation of the previous FLTK version. Please report any issues to either the forum, email or github issues page.

New discussion forum

October 29, 2019

The Retrogamecoding and Basicprogramming Forum is scheduled for closure on 4th of November 2019. A new forum has been created at www.syntaxbomb.com. Click the Discuss link above and join the discussion!

Cool new sample program, news on progress

June 2, 2019

Read more

SmallBASIC version 0.12.14 has been released

November 22, 2018

Read more

SmallBASIC version 0.12.13 has been released

September 13, 2018

Read more

Samples

Web site updated

March 29, 2018

Read more

SmallBASIC version 0.12.10 has been released

December 24, 2017

Read more