Linkage Declaration (was Re: Standardization (of FORTRAN, Ada, ect.))
Clay Phipps
phipps at garth.UUCP
Fri Dec 2 16:36:18 AEST 1988
In article <311 at csun1.UUCP> weyrich at csun1.UUCP (Orville Weyrich) writes:
>
>...a neglected aspect of programming
>language development and language standardization:
>defining standard and useful interfaces *between* languages,
>so that for example new code in modern languages
>can be smoothly integrated into old programs written in old languages
>without the need for massive rewrites.
>...
>It *must* be easier, faster, and more cost-effective
>to define linkage between say FORTRAN and Ada than it is
>to redefine FORTRAN to have most of the features of Ada...
There was an interesting source-level mechanism reported
from Carnegie-Mellon U.:
William A. Wulf:
"The Problem Of The Definition Of Subroutine Calling Conventions",
_SIGPLan Notices_, 1972 December, p. 3..8.
It was intended to allow definition of machine-level information
on routine invocation mechanisms from BLISS source code:
LinkDecl ::= "linkage" Id "=" LinkType "(" ParmSpecs ")"
LinkType ::= "BLISS" | "FORTRAN" | "interrupt" | ...
ParmSpecs::= ParmSpec | ParmSpec "," ParmSpec
ParmSpec ::= Id | "stack" | "register" "=" RegId
RegId ::= /* the paper provide only for a "number" */
They gave the example:
begin
own X;
linkage BrX = BLISS (register = 2, X, stack);
routine BrX R (A, B, C) =
begin
...
end;
...
R (3, 4, 5);
...
end;
in which
A will be found in register 2,
B will be found in the global variable "X",
C will be found on top of the stack.
I don't know whether it became a conventional part of BLISS.
Wulf attested to the high value of the scheme,
but regretted the lack of a more complete solution.
He concluded that he assumed that "the solution lies in getting
an adequate characterization of ... the (rather vague) notion
of `environment' explicitly into the language, together with
primitive operators for its manipulation".
Now if only the standards committees for languages like FORTRAN,
Pascal, C, &c. would translate something like this into
idioms that fit those languages. I can dream, can't I ?
As an alternative, each could define a "transmitter" feature
(a concept that originated in SL5, I believe).
One drawback is that you might need to write some of the transmitters
in assembler :-).
The widespread postings to language news-groups were to get everyone's
attention; follow-ups might best be limited to "comp.lang.misc".
--
[The foregoing may or may not represent the position, if any, of my employer]
Clay Phipps {ingr,pyramid,sri-unix!hplabs}!garth!phipps
More information about the Comp.lang.c
mailing list