An ASC program consists of a number of entities which contain data.
Each entity has a representation, a type, and a name.
Representations determine the precision, physical size, and mutability of the data contained by an entity. Constant (non-mutable) entities are used to define the behavior of a program. Mutable entities are used to hold data as operations are performed on it by the program.
Types determine the set of possible data values that can be held by an entity and the operations that are available for that set. Types are used to verify that the behavior of the program is correct, or rejected as incorrect according to requirements established by type definitions.
Names determine the contexts within which an entity is accessible. Names are used during a program's execution to locate both the constant entities containing transformations that the program will perform, and the mutable entities which hold the data being transformed.
A number of primitive entities are provided by the ASC language for creating programs. They are...
Entities are instantiated in a program via declaration and definition.
An entity declaration establishes its name and type.
An entity definition establishes its representation and the initial data that it will contain when program execution begins.
An entity declaration is required before the definition of that entity occurrs.
The complete definition of an entity may be established by multiple separate expressions.
Program execution is facilitated by the evaluation of expressions which consist of operations performed on program entities.
Evaluation may produce some value or effect on the program entities.
Evaluation is composed of objects called continuations. A single operation provided with operands is the smallest form of a continuation.
There are three discrete stages in program execution which occurr in the order of, inspection, translation, then interpretation.
Each stage must be completed before the next can occurr.
No stage is required to be completed in a single event.
The execution process may be applied individually to parts of a program, or uniformly to an entire program. The granularity of execution is implementation dependent.
Program execution begins when an implementation is provided a program to execute through one or more streams containing source text.
A stream is an abstract data buffer containing traversable ASCII or Unicode encoded text.
Streams are only required to be traversable in a forward direction so that the source text may be read in the order it was written.
Streams may support random stream position seeking.
The contents of a stream are not required to be persistent beyond a single reading.
A stream may be derived from the contents of a source file containing ASCII or Unicode encoded source text.
Only one stream may be derived from a single source file and it must contain exactly the contents of that file.
If a stream is derived from a source file, the stream should be identified by the name of the file it was derived from.
The design of a stream that fulfills the require behavior is implementation dependent.
The inspection stage is responsible for reading source text from all streams provided to the implementation and verifying that a program is well-formed.
A well-formed program shall conform to all specified syntactic and semantic constraints.
The translation stage shall be responsible for translating the source text into an interpretable format.
Any number of translations to any interpretable format may take place at this stage.
The interpretable format produced by this stage is only required to preserve the information necessary to carry out all program behavior and effects specified by the source text.
The interpretable representation of a program or part of a program emitted by the translation stage may be stored and used at a later point. This stored representation is called a cached file.
Depending on which parts of the program are translated and stored together, a cached file may be reused in multiple programs.
The method with which a cached file is stored and possibly reused is implementation dependent.
The interpretation stage is responsible for allocating the computing resources required to carry out the program's behavior and effects and for initiating the execution of that program.
The interpretation stage must only produce the behavior and effects that are recorded in the interpretable representation of the program.
The means through which the behaivor and effects of a program are carried out are implementation dependent.