#freesoftware
#freeculture

The Ollie Language

This document contains a description of the Ollie language Simplicity of human interpretation and consistency of semantics are the primary goals. Ollie may be suitable as a teaching language, or used for more general purposes.

I. Language Structure: ((act-upon) (this))

a. Tokenization

Ollie is based upon two abstract datatypes: the Symbol, and the Text-constant. These types are instantiated as “tokens” in readable form which can be displayed as text.

A token in Ollie is a series of one or more ASCII characters; interpretation of characters is case-sensitive.
Five special characters ( ) ; " have syntactic function in Ollie and cannot be redefined or used arbitrarily. Ollie special characters are Ollie-defined, self-delimited tokens which do not require any whitespace to separate them from other tokens, although the white space special character(s) may also be present.

All tokens other than the 5 special characters are delimited by whitespace characters or by the other special characters listed above. Tokens are displayed text and interpreted as “Symbols” by default. Symbols deliniated by white space always return a value, as described below.

A token composed entirely of unquoted numeric characters (potentially including the dot ".") is a Numeric Symbol, which always evaluates to the corresponding floating-point numeric value as represented internally by the machine where evaluated. A Numeric Symbol cannot be directly associated with anything other than itself. A token where the first character is the minus sign "-" and where the remaining characters are numeric characters is also a Numeric Symbol.

A token beginning with the double-quote character and ending with the double-quote character is of the semantic type termed "String". A String contains the "Text-constant" of the character or characters between the quotes. Whitespace is a valid character. If there are no characters between a pair of double quotes, the value provided by Ollie is “NUL”, the NUL ASCII character.

b. Grammar and Semantics

Ollie text is parsed and interpreted from left to right. When a string of characters begins with the special character open parenthesis, “(“, and ends with the close parenthesis “)”, the string is of the semantic type termed "Expression". The first token within the parenthesis, within a closed Expression, is interpreted to be evaluated as a Verb Symbol, i.e. as either an operator or function name, and any remaining token elements within the paired parentheses are evaluated as arguments to the Verb Symbol without symbolic evaluation. Upon evaluation, if a Symbol is not associated with a value, the value returned upon evaluation is NUL. If there are no tokens between the left and right parenthesies the value returned is NUL. If there are one or more paired parentheseis within an Expression, sub-expressions must be evaluated also, in stepwise fashion from left to right and inside-out so that the results may be passed to the enclosing expression(s). If one or more other Symbols follow the Verb Symbol within an Expression, those Symbols (symbol names) are passed as arguments.

Quoted strings are passed as text characters. Note that Ollie semantics give no special meaning to the back-quote, and it is given no special treatment in strings.

A terminating semicolon will define the end of executable text and/or the terminus of the environment tree.

The “###” symbol begins a Comment, which is ordinarily followed by text, and may span multiple lines. A Comment is terminated by a single “#”, yielding a sum of four ascii pound-signs per Comment. The “###” symbol cannot be redefined. Comments are not evaluated internally, however improperly formed Comments or other arrangements may generate an error as they are parsed.

When an Expression is interpreted and evaluated by Ollie, an internal run-time “Value-object” is generated. That Value is returned to the enclosing Expression.

Obviously, there is only a single name-space for Symbol → Value within a given environment of execution.

Pre-defined Symbols, as enclosed within pared parentheses, are termed "Special Forms"; these Special Forms can potentially require their own special syntactical structure within the enclosing parentheses, though any syntactical structure deviating from that of Ollie proper will be stridently avoided to the greatest extent possible.

There are no comments yet.