CLIBASIC
CLIBASIC copied to clipboard
A BASIC interpreter for the terminal (or console), written in C

Command Line Interface Beginners All-purpose Symbolic Instruction Code
CLIBASIC is a version of BASIC designed to run in the command line or terminal
Links
Examples: https://github.com/PQCraft/clibasic-examples
Documentation: https://github.com/PQCraft/clibasic-docs
Extensions: https://github.com/PQCraft/clibasic-extensions
Windows Readline: https://github.com/PQCraft/clibasic-winrllib
Required Packages/Programs
Linux
Arch (pacman): base-devel, readline
Debian (apt): build-essential, libreadline-dev
Alpine (apk): build-base, readline-dev
Windows
NT - 10 (download): MinGW, Make for Windows
7 - 10 (choco): mingw, make
MacOS
Mojave - Big Sur (brew): gcc, make, readline
Recommended Packages/Programs
Linux
Arch (pacman): git
Debian (apt): git
Alpine (apk): git
Windows
NT - 10 (download): git
7 - 10 (choco): git
MacOS
Mojave - Big Sur (brew): git
Building and Running
Linux/MacOS
To build, use make build.
To run, use make run or ./clibasic.
To build then run, use make (same as make all).
Windows
Make sure you have downloaded the readline lib folder from here.
- Download the ZIP
- Go into the .zip file you downloaded
- Copy the
libfolder inclibasic-winrllib-master - Paste the folder into the directory with your CLIBASIC source code
Make sure the bin folders of MinGW and Make are in the %PATH%.
Type gcc --version into CMD and if you received a "Can't recognize" message, MinGW is not in your %PATH%.
Type make --version into CMD and if you received a "Can't recognize" message, Make is not in your %PATH%.
How to add MinGW and/or Make to the %PATH%:
- Navigate to where MinGW or Make is installed
- For MinGW, open the
mingw64folder - Open the
binfolder - Copy the location
- Add the location you copied to the %PATH% environment variable
- For Windows 7 and older
- Open the Start Menu
- Right-click on Computer and click Properties
- Click Advanced system settings
- Click the Advanced tab
- Click Environment Variables
- Under System variables, find Path and click Edit
- Add the copied location
- For Windows 8 and newer
- Open the Start Menu
- Search for and run 'Edit the system environment variables'
- Click Environment Variables
- Under System variables, find Path and click Edit
- Add the copied location
- For Windows 7 and older
To build, use make build.
To run, use make run or .\clibasic.exe.
To build then run, use make (same as make all).
To build CLIBASIC with support for VT escape codes, add vt before the rest of the rules.
Demo
Notes
- On Arch Linux, you can install CLIBASIC by installing either the
clibasicorclibasic-binAUR package. - On Windows, pressing CTRL+C will not display a new prompt line due to the Windows version of readline catching and ignoring the CTRL+C.
- Most terminals cannot handle input while processing a cursor position request and INKEY$() will not reflect keys that were pressed during that time. The effect is more noticeable on terminals that are slow to respond such as Alacritty, Gnome Terminal, and Termux. A terminal that is fast to respond such as Konsole is recommended.
- If the file
.clibasic_historyis present in the user's home directory CLIBASIC will automatically save history there. Run_AUTOCMDHIST,_SAVECMDHIST(without any arguments), or create the file.clibasic_historyin your home/user folder to enable this feature. Remove the file to disable this feature. - CLIBASIC will look for
~/.clibasicrc,~/autorun.bas, then~/.autorun.basin this order in the user's home directory and run the first file found. - The development scripts are
build.shwhich is for testing if CLIBASIC compiles correctly for Linux and Windows,package.shwhich creates the zip files for making a CLIBASIC release,commit.shwhich automates the build and push process, andrelease-text.shwhich generates the text for making a CLIBASIC release. - Include the
clibasic.hfile when making a clibasic extension. - There will most likely not be any more updates as CLIBASIC is a major architectural disaster.
