The Bare Bone language is a programming language with a minimal set of operations that exhibits universal computation To put it another way, Bare Bone programming language is Turing complete. Its data manipulation rules can be used to simulate any Turing machine.
Click to expand!
In this implementation, a '#' character introduces a comment, which continues to the end of the source line.
The words in the following list are reserved, and may not be used as identifiers:
- clear
- copy
- decr
- do
- end
- incr
- not
- to
- while
Reserved words are case-insensitive.
Identifiers must begin with an alphabetic character, and may contain alphabetic, numeric, and underscore characters. Identifiers are case-insensitive, thus "FOO", "Foo", and "foo" are the same identifier. Reserved words my not be used as identifiers.
In Bare Bones, variables are named by an identifier and may contain any arbitrarily large non-negative integer values. This implementation is currently limited to the size of the host C compiler's uintmax_t type, which typically is 2^64-1.
Bare Bones does not provide any I/O facilities. Input may be accomplished by initializing variables before program execution using either command-line options or an initialization section, or by using the "clear" and "incr" statements in the program.
Output consists of the state of variables when the program halts. This implementation will print the variable names and contents to standard output.
statement | effect |
---|---|
clear <var>; | Set the variable to zero. |
incr <var>; | Increment the value of the variable. |
decr <var>; | Decrement the value of the variable, except that if the value was already zero, it remains zero. |
while <var> not 0 do; <statements> end; |
Loop while the variable's value is not zero. May contain one or more statements, including nested while loops. If the statements do not alter the value of the loop variable, the loop will never terminate. |
copy <var> to <var>; | Copy one variable to another, preserving value of original. |