The primary objective of porting an application is to reconstruct an application on a target platform with minimal or no source code changes and to have the reconstructed application's behaviour identical to that of the original implementation.
Application portability requires more than source code transfer. It also requires that:
The remainder of this chapter details how SPIRIT has addressed requirements 1. and 2. above.
SPIRIT Issue 3.0 contains profiles for the following languages:
These SPIRIT language profiles were created to enhance portability of programs written in them. Portability of the C run-time library is also addressed in Part 6, Languages.
Additionally, SPIRIT specifies the STDL language for transaction
processing applications.
The description of the STDL environment places additional constraints
on the use of the other languages, again for the purpose of
application portability.
Collectively, these are referred to as the SPIRIT
portability-enhanced languages, or simply the SPIRIT languages.
The individual language profiles are complemented by the
inter-language calls profile, which deals with cross-language issues.
The inter-language calls profile is part of each language profile.
See
The SPIRIT languages provide sufficient functionality to support a range of applications and the profiles are of sufficient detail to enable those applications to be ported across different vendor platforms.
For the other general-purpose languages, such as FORTRAN, C++ and Pascal, SPIRIT Issue 3.0 only specifies the base standard. Since these languages do not have profiles in this issue of SPIRIT, the degree of portability of applications coded using them is not assured when compared to those coded exclusively in the SPIRIT languages.
Each set of language processors available on a given platform has
its own architectural limits, such as maximum length of a
The main objectives of defining the inter-language calls profile is to enhance application portability when applications are written in different languages. This requires the following capabilities:
A module written in one SPIRIT language must be able to call a module written in another language.
When an inter-language call is needed, the data types used in parameter declarations in each language must be defined.
The transfer of data between programs written in different languages must be achieved and also between programs written in the same languages on different vendor implementations.
An inter-language call is an invocation of a module written in one SPIRIT language by a module written in another language. SPIRIT, however, does not specify actual call methods, nor does it mandate particular call semantics such as passing data by reference or passing data by value. Additional constraints are defined for transaction processing.
Implementations shall provide the capability of inter-language calls, and the passed data shall conform to the specifications defined here.
This section defines the possible combinations for calling program modules written in different languages.
An application program written in C must be able to call a program written in COBOL, and an application program written in COBOL must be able to call an application program written in C.
STDL programs must be able to call programs written in C and COBOL, subject to environmental restrictions. See LANG/TXN-1 for details.
Inter-language calls between SQL and C and between SQL and COBOL are defined in the SPIRIT SQL specifications. See Part 6, Languages.
The kinds of data types relating to data transfer and the interfaces relating to the representation formats are defined. The strict definitions of each data type shall conform to the definitions of respective language specifications.
When a module written in one language calls a module written in
another language, the data types used in parameter declarations
in each language must be defined according to the correspondence
defined in
Each program must be able to declare and use the following types
when transferring data according to the correspondence defined in
In this definition, for "n", "m", "a" and "b", an appropriate decimal digit is designated.
A string of n fixed-length characters which can represent
the characters of the alphanumeric character set defined in
The integer value represented by the radix of 2. The accuracy is more than or equal to decimal four digits.
The positive integer represented by the radix of 2. The accuracy is more than or equal to decimal four digits.
The integer value represented by the radix of 2. The accuracy is more than or equal to decimal nine digits.
Positive integer represented by the radix of 2. The accuracy is more than or equal to decimal nine digits.
The real number represented by fixed scaling, having the accuracy of decimal a digits and scaling of b digits. Accuracy ranging to decimal 15 digits or more and the scale from 0 to the accuracy.
Bit string represented by 8 bits.
A string of n fixed-length Kanji characters which can
represent the Kanji character set defined in
A string of n fixed-length characters which can represent the
characters of the alphanumeric character set and the characters of
the Katakana character set defined in
A string of n fixed characters which can represent the
characters of the ISO Latin-1 character set defined in
A string of n fixed characters which can represent the
characters of the ISO Latin-2 character set defined in
Repetition of any same data type <type>, having dimensions in accordance with the number of repetition structures.
Repetition of any same data type <type>. The number of repetitions is variable.
Combination of any data types.
This section specifies the mapping between data types defined in
different languages so that the transfer of data between modules
written in different languages will be the same on different platform
implementations.
Mapping is based on the data types defined in
For data types defined in
This part does not specify how data is transferred between languages, nor does it specify call semantics for transferring data between languages.
This part specifies data type mappings across C, COBOL and STDL. Data type mappings between SQL and C and between SQL and COBOL are defined in the SPIRIT SQL specifications. See Part 6, Languages for details.
The data types to which data is possibly transferred and the data types mapping in respective languages are as follows:
In this definition, "-" indicates that the type cannot be handled in this language. For n, m, a and b, an appropriate decimal digit is designated, and for id, number, rec and rec0, an appropriate name is designated. An M indicates an integer which depends on the implementation for representing its data type.
The data transferred can be used directly as a character string of the alphanumeric character set.
The data transferred can be used directly as an integer of the short binary integer type.
The data transferred can be used directly as an integer of the unsigned short binary integer type.
This data type must satisfy the requirement 1. Base type, d. of
The data transferred can be used directly as an integer of the
long binary integer type.
This data type must satisfy the requirement 1. Base type, e. of
The data transferred can be used directly as an integer of the unsigned long binary integer type.
Excluding C, the data transferred can be used directly as a real number of the fixed decimal number type.
In C, the data transferred is a character string in EXFOR-5
Representing methods for n characters (including the size of storage area) may differ in accordance with the type of languages. For that reason, an application program should convert the representation.
Representing methods for n characters (including the size of storage area) may differ in accordance with the type of languages. For that reason, an application program should convert the representation.
<One dimension>
<Two dimensions>
Also, arrays of three dimensions or more are mapped as above.
The number which indicates the number of repetitions is mapped as follows including the same record as an array:
Data type mapping between C and COBOL shall not be permitted.
Data type mapping between C and COBOL shall not be permitted.
The following pairs of character sets of STDL and SQL mutually correspond to transfer text data encoded in the character sets:
The following SQL named character sets have no corresponding character set in STDL:
Source programs are written using characters supported in SPIRIT-defined character sets. For every source program, at least one of the following three character sets is supported:
Language COBOL (LANG-2) and Human User Interface (HUI-1) are required to handle any character sets supported by SPIRIT; however, implementations may not allow use of multiple character sets at the same time.
In the case of Japanese, Simple-latin (I18N-2), Katakana (I18N-4) and Kanji (I18N-3) must be usable at the same time.
Contents | Next section | Index |