Language Down-Typing

From dis-Emi-A

Jump to: navigation, search


Contents

Entry Selection

The first phase of down-typing is to choose the entry point to the system -- in the case on a library this would be a number of entry points.

From each entry point the system chooses a matching scenario and completes all types downward from that point -- that is, it fills in all partial scenarios with complete scenarios and generates a list of all scenarios which are needed by the complete program.

As part of this scenario selection the typing needs to be completed (even in complete scenarios the types are still by far abstract). At this stage each type needs to have an OS specific constraint applied to it, along with any OS specific attributes in order to create a fully-typed scenario and detect any OS specific constraint violations.

To some extent the exact type selection will also be done by top-up typing based on the functions available for fundamental types. Though in general up-typing will apply to the abstract case and down-typing to the specific case.

Drivers to entry point

Entry points are of course useless unless they have some way to be combined with another programming language or environment. In this regards we consider that entry points are generated within the framework of a particular driver. The driver is responsible for exposing the entry point to the environment in a suitable fashion and performing all checks and conversions necessary to work within that environment. Each driver will have a well defined manner for doing this to ensure that users of the program have a consistent interface.

Some examples of drivers (the most likely candidates for the test compiler) are below. Note that is expected that the entry points will have significant restrictions on their signature depending on the driver being used (only the entry points have such restrictions however).

C Library

The entry points will be converted into suitable C calling convention functions. This will require mapping to the allowed data types and converting in cases where native constructs are not allowed. Down-typing will need to consider the exact OS requirements of the target system.

Command Line Program

This entry point (the one built for testing) uses the function signature to generate a suitable command-line program complete with parameter parsing and exception to error code mapping.

There is no traditional "main" entry point.

Personal tools