Version 1.1 of ais/ai-00134.txt

Unformatted version of ais/ai-00134.txt version 1.1
Other versions for file ais/ai-00134.txt

!standard 02.01 (18)          96-07-23 AI95-00134/01
!class confirmation 96-05-07
!status WG9 approved 96-12-07
!status ARG approved 7-0-1 96-06-17
!status work item 96-05-08
!status received 96-05-07
!priority Medium
!difficulty Easy
!subject Source Representation
!summary 96-05-08
The language does not specify the source representation of programs.
!question 96-05-08
The NOTE in RM95-2.1(18) says "The language does not specify the source representation of programs." Is this intended to allow arbitrary preprocessing of what would otherwise be considered "source files", with the preprocessor integrated into the compiler, and with no need for a switch to disable such preprocessing?
If so, there seems to be no limit to allowable language extensions, so long as such extensions can be described using a transformation to an allowable sequence of characters.
!response 96-05-08
AARM-2.1(18.a) clarifies the intent:
18.a Discussion: Any source representation is valid so long as the
implementer can produce an (information-preserving) algorithm for translating both directions between the representation and the standard character set. (For example, every character in the standard character set has to be representable, even if the output devices attached to a given computer cannot print all of those characters properly.) From a practical point of view, every implementer will have to provide some way to process the ACVC. It is the intent to allow source representations, such as parse trees, that are not even linear sequences of characters. It is also the intent to allow different fonts: reserved words might be in bold face, and that should be irrelevant to the semantics.
Thus, source representation does not represent a gaping loophole.
!appendix

!section 2.1(18)
!subject allowable preprocessing
!reference RM95-2.1(18)
!from Dan Eilers 96-04-24
!reference 96-5512.a Dan Eilers  96-4-24>>
!discussion

The note in RM95-2.1(18) says "The language does not specify the
source representation of programs."  Is this intended to allow
arbitrary preprocessing of what would otherwise be considered
"source files", with the preprocessor integrated into the compiler,
and with no need for a switch to disable such preprocessing?

If so, there seems to be no limit to allowable language extensions,
so long as such extensions can be described using a transformation
to an allowable sequence of characters.

        -- Dan Eilers

****************************************************************

!section 2.1(18)
!subject allowable preprocessing
!reference RM95-2.1(18)
!reference as: 96-5512.a Dan Eilers  96-4-24
!from Bob Duff
!reference 96-5525.a Robert A Duff 96-4-29>>
!discussion

> The note in RM95-2.1(18) says "The language does not specify the
> source representation of programs."  Is this intended to allow
> arbitrary preprocessing of what would otherwise be considered
> "source files", with the preprocessor integrated into the compiler,
> and with no need for a switch to disable such preprocessing?
> 
> If so, there seems to be no limit to allowable language extensions,
> so long as such extensions can be described using a transformation
> to an allowable sequence of characters.

Dan,

Why do you ask such esoteric questions?  Yes, there's all kinds of weird
things implementations *could* do.  IMHO, if an implementation supports
some weird representation of source programs, then it has to define an
algorithm for translating that representation into a "normal"
representation.  Whether the RM actually *requires* that, I don't know,
and I don't think I need to care.  If an implementation chooses to
represent Ada programs as Fortran source code, then it's going to have
to define a mapping from Fortran to Ada (which might be kind of
difficult;-)).

- Bob

****************************************************************

Questions? Ask the ACAA Technical Agent