The bs The bs language, thus, is a hybrid
interpreter and
compiler and a divergence in
Unix programming from
Ancient Unix. The bs language shares some features and syntax with
BASIC,
SNOBOL, and
C, the two former presumably inspiring its name. Like BASIC, it can be used interactively, either executing statements immediately or collecting them into a program to be executed subsequently. Like in SNOBOL4, the assignment operator (=) is used for
I/O and bs can execute code in strings, using its
eval function. It also includes SNOBOL's interrogation operator (?) used to test whether an expression evaluation succeeds or not. The built-in format function, limited to one argument, supports a subset of C's printf format conversion specifiers, e.g., "%f". The language has some conspicuous elements. For instance, its program functions are defined using the fun
... nuf syntax and its functions can have local variables. Also, bs can operate in two modes, either interpreting (and executing) statements and programs or compiling them, and switching between the two using compile and stop. Otherwise, its functionality is unique only collectively (in one language), since individual features are redundant with those of coexisting tools, such as the
Unix Shell, e.g., file I/O and loops, and
AWK, e.g., associative arrays and
Regular expression matching. The bs language was meant for convenient development and debugging of small, modular programs. It has a collection of syntax and features from prior, popular languages but it is internally compiled, unlike a
Shell script. As such, in purpose, design, and function, bs is a largely unknown, modest predecessor of hybrid interpreted/compiled languages such as
Perl and
Python. == Syntax Examples ==