Xref: utzoo comp.lang.misc:2285 comp.lang.fortran:1590 comp.lang.c:14527 comp.lang.pascal:1249 comp.lang.c++:2188 comp.lang.modula2:1156
Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!mailrus!cornell!uw-beaver!teknowledge-vaxc!sri-unix!garth!phipps
From: phipps@garth.UUCP (Clay Phipps)
Newsgroups: comp.lang.misc,comp.lang.fortran,comp.lang.c,comp.lang.pascal,comp.lang.c++,comp.lang.modula2
Subject: Linkage Declaration (was Re: Standardization (of FORTRAN, Ada, ect.))
Keywords: linkage,BLISS
Message-ID: <2086@garth.UUCP>
Date: 2 Dec 88 06:36:18 GMT
References:  <395@ubbpc.UUCP> <311@csun1.UUCP>
Reply-To: phipps@garth.UUCP (Clay Phipps)
Organization: INTERGRAPH (APD) -- Palo Alto, CA
Lines: 73

In article <311@csun1.UUCP> weyrich@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