No side effects, no surprises.

VLI Architecture

The VLI is the executable environment that reads the rulebook, evaluates resources, validates rules, and sends output to the console and the log file.

The VLI consists of seven stages: 1) a parser, 2) an object composer, 3) a dependency tree builder, 4) a resource evaluator, 5) a variable substitution processor, 6) a rule validator, and 7) a trip-point emitter.

The parser reads each line of a source code file, and builds an in-memory representation of the objects specified by the rulebook author. The parser is responsible for distinguishing between valid and invalid syntax. It should gracefully recover from syntax errors and continue parsing with the next valid statement.

The object composer is responsible for merging base objects with scoping objects. It is called by the VLI after all source code files have been individually parsed.

The dependency tree builder prepares the rulebook for future use by ordering the base objects according to any dependencies that the rulebook author specifies in the source code files.

The resource evaluator obtains snapshot data for all specified resource objects, as defined by the rulebook author using the V language. Snapshot data is stored in-memory, in the resource collection, for use in subsequent processing steps.

The variable substitution processor scans the collection of composed-and-evaluated objects looking for dollar-sign prefixed variables, replacing these variable names with the snapshot data obtained by the resource evaluator.

The rule validator scans all composed-evaluated-substituted objects, in dependency order, validating each object rule for compliance. If any rule does not comply, it trips the object and sends the object and the non-complying rule to the trip-point emitter.

The trip-point emitter determines what to do with objects that have failed validation. The emitter shunts the output to either the console's standard output or to the VLI log file. The emitter also gathers diagnostic information to include in the output message.

Collectively the seven components of the VLI runtime operate as a whole, and—under normal operation—only produce output via the trip-point emitter. Nevertheless, the VLI runtime can be instructed to operate in verbose mode to allow the rulebook author to selectively examine the in-memory structures of each component.

The advanced features

Four of these stages are considered to be advanced features — the object composer, dependency tree builder, resource evaluator, and variable substitution processor — and do not need to be used in all scenarios. The VLI runtime can be a powerful rulebook author tool even when without these advanced features. They are an integral part of the architecture and processing flow, and are introduced here to enable the reader to conceptually understand the full capabilities of the interpreter and language; nevertheless, a beginner's understanding of these advanced features can be deferred until later.