Bs (programming language)

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

bs is a programming language and a compiler/interpreter for modest-sized programs on UNIX systems. The bs command can be invoked either for interactive programming or with a file containing a program, optionally taking arguments, via a Unix shell, e.g., using a Shebang (Unix) #!/usr/bin/bs . An early man page states, "[ bs ] is a remote descendant of Basic [sic] and SNOBOL4, with a little C thrown in."

bs is a programming language and a compiler/interpreter for modest-sized programs on UNIX systems. The bs command can be invoked either for interactive programming or with a file containing a program, optionally taking arguments, via a Unix shell, e.g., using a Shebang (Unix) #!/usr/bin/bs . An early man page states, "[ bs ] is a remote descendant of Basic [sic] and SNOBOL4, with a little C thrown in." 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.

Text derived from https://en.wikipedia.org/w/index.php?oldid=1298405542 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot enwiki-001298405542 · captured 1751437227.0 · version history

Cite this page as: encyclopegia.org, “Bs (programming language)”, snapshot enwiki-001298405542. https://encyclopegia.org/a/bs-programming-language

Sources cited in this revision

12 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.