Coder Social home page Coder Social logo

clibasic's Introduction


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



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

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.
  • 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.
  • 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_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.

clibasic's People

Contributors

pqcraft avatar ico277 avatar

Stargazers

Qaziquza avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.