Cubix
Copyright (C) 2000 Ariya Hidayat (ariya@tf.itb.ac.id)

========================================================================

Cubix (Cubix is Basic eXecutive) is a free, open-sourced, cross-platform
Basic interpreter engine. Its goal is to add simple scripting support for
any applications easily.

Currently Cubix is under HEAVY development so in short time there won't be
any stable releases. This also means that if you use Cubix, you'll likely
experience tons of bugs.

Latest version of Cubix is 0.1.5 as of Feb 21, 2000. This version compiles
only in Linux.

How to Build

Requirement: egcs 2.91-66, make 3.77, glibc 2.1.1, flex 2.5.4 and bison
1.28

Just decompress and untar the package, the run the Makefile

Features

   * Statements are separated using CRLF or colon(:)
   * Keyword is case-insensitive
   * Variable is case-insensitive, can be of any length.
   * Numerical variable holds floating-point value.
   * String variable must be ended in $ such as name$.
   * String variabel can hold string of any length.
   * String constant is between quotes ("), such as "Phantom of the Opera".
   * Comments: using REM or #. (Therefore it's possible to create Cubix
     script in Unix)
   * Arithmetic operators are +(addition), -(subtraction),
     *(multiplication), /(division) and ^(power)
   * Trigonometric functions are sin(), asin(), cos(), acos(), tan(), and
     atan(). Argument is given in radian.
   * Square root is calculated using sqrt(). Argument must be positive.
   * Exponentiation functions are exp() and log().
   * Numeric manipulation functions are int() and frac(). Int(4.57) results
     4 and Frac(4.57) results .57.
   * String functions are len(), left$(), right$(), mid$(), chr$(), asc().
   * Case conversion could be performed using lower$() and upper$()
   * Conditional: using IF (comparison) THEN (statement) ELSE(statement)
     ENDIF. Note that ELSE(statement) is optional. The keyword ENDIF uses
     no whitespace between END and IF.
   * Supported conditional operators are =(equal), <>(not equal), < (less
     than), <= (less than or equal), > (greater than) and >= (greater than
     or equal).
   * Loop: using FOR/STEP/NEXT. Negative value is possible for step value.
     Note that no need to specify loop variable after NEXT
   * Callback functions are available for error reporting and external
     variable setter/getter
   * User defined function (via SUB/ENDSUB)

Unsupported things so far...

   * BASIC-style line numbering
   * unconditional jump using GOTO and GOSUB
   * many more (soon to come!)

Things To Do

There're so many things in my mind. Here are some:

  1. Fix many nasty bugs
  2. Clean-up the code for readibility
  3. Switch to autoconf and automake
  4. Fix the code for cross-platform support
     (recently I was able to build Cubix using DJGPP, Borland C++ 5.0 and
     Turbo C++ 3.0, but somehow everything's broke)
  5. Write some docs
  6. Put Cubix in SourceForge (?)

Documentation

Documentation is not available yet.

Disclaimer

Cubix is free software; you can redistribute it and/or modify it under the
terms of the Artistic License (see the file LICENSE in the distribution
package)

A Brief History of Cubix...

In my latest software project to be used for a research, I need some kind
of simple scripting language. At that time, no scripting language is either
simple to incoporated to my software and easy to use. After couple of days
looking for such a kind of things in Internet, finally I decided to create
one.

There's nothing wrong with many script languages out there, such as Perl,
Python, Tcl, etc. I develop Cubix because I need a scripting system that is
REALLY EASY to be learnt by novice and non-geeks people. So I pick Basic as
a language and build the interpreter.

Mini F.A.Q

Can I create Unix shell script in Cubix ?

Yes, of course. Since Cubix supports Unix-style comment using #, you can
create a regular script file to be executed by Cubix. Remember to put
executable Cubix in your path.

How fast is Cubix ?

An interpreted script is of course slower than native code. However,
because Cubix compiles the script first into a sort of intermediate
pseudo-code (yes, just like Java bytecode) before starts executing, it runs
quite fast.