m4k3r-org / CLIBASIC

A BASIC interpreter for the terminal (or console), written in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


image

Command Line Interface Beginners All-purpose Symbolic Instruction Code

CLIBASIC is a version of BASIC designed to run in the command line or terminal



Required Packages/Programs

Linux

Debian (apt): build-essential, libreadline-dev
Arch (pacman): base-devel, readline
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

Debian (apt): git
Arch (pacman): 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

  1. Download the ZIP
  2. Go into the .zip file you downloaded
  3. Copy the lib folder in clibasic-winrllib-master
  4. 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%:

  1. Navigate to where MinGW or Make is installed
  2. For MinGW, open the mingw64 folder
  3. Open the bin folder
  4. Copy the location
  5. Add the location you copied to the %PATH% environment variable
    • For Windows 7 and older
      1. Open the Start Menu
      2. Right-click on Computer and click Properties
      3. Click Advanced system settings
      4. Click the Advanced tab
      5. Click Environment Variables
      6. Under System variables, find Path and click Edit
      7. Add the copied location
    • For Windows 8 and newer
      1. Open the Start Menu
      2. Search for and run 'Edit the system environment variables'
      3. Click Environment Variables
      4. Under System variables, find Path and click Edit
      5. Add the copied location

To build, use make build.
To run, use make run or ./clibasic.
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.


Notes

  • On Arch Linux, you can install CLIBASIC by installing either the clibasic or clibasic-bin AUR package.
  • On unix-like OSs, if CLIBASIC is not run in a terminal it will attempt to open in XTerm unless GUI_CHECK is undefined.
  • Due to Windows not having proper fork() and exec*() functions, EXEC, EXEC(), and EXEC$() are passed through system() under Windows and one issue out of the many with this is a space parsing issue where running EXEC "test prog" will attempt to execute EXEC "test", "prog" if test prog cannot be found in the current directory or %PATH%.
  • 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.
  • If the file .clibasic_history is present in the user's home directory CLIBASIC will automatically save history there. Run _AUTOCMDHIST, _SAVECMDHIST (without any arguments), or create the file .clibasic_history in your home/user folder to enable this feature. Remove the file to disable this feature.
  • CLIBASIC will look for ~/.clibasicrc, ~/autorun.bas, then ~/.autorun.bas in this order in the user's home directory and run the first file found.
  • The development scripts are build.sh which is for testing if CLIBASIC compiles correctly for Linux and Windows, package.sh which creates the zip files for making a CLIBASIC release, commit.sh which automates the build and push process, and release-text.sh which generates the text for making a CLIBASIC release.
  • Include the clibasic.h file when making a clibasic extension.

About

A BASIC interpreter for the terminal (or console), written in C

License:GNU General Public License v3.0


Languages

Language:C 100.0%