🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #6829

Re: Anyone want to design a language?

#6829
From: Herman Rubin
Date: Mon, 26 Feb 1990 14:14
38 lines
2700 bytes
In article <17349:05:24:18@stealth.acf.nyu.edu>, brnstnd@stealth.acf.nyu.edu writes:
> In article <111357@ti-csl.csc.ti.com> gateley@m2.csc.ti.com (John Gateley) writes:
> > >3. Ability to use existing C libraries and headers.
> > This is truly a difficult problem, because you have to say: "whats so
> > special about C, I want my <foo> libraries" where <foo> might be Ada,
> > Lisp, PDP-11 assembler, or whatever.
> 
> No. Under UNIX, for example, one can without any trickery load Fortran,
> Pascal, and C routines together. This is useful, though it does dictate
> that the stack be used in particular ways.
> 
> With N languages running around it's impossible to write N^2 translators.

It would only be necessary for each compiler to have the possibility of
using the calling sequence for the others.  This can come up even with one
language; the Fortran compilers on the CDC 6x00 could not call each other's
subroutines.  It is not likely to be the case that each compiler uses a 
different calling sequence, but each must be able to use the appropriate
sequences of the others it calls, or a linking module must be able to
change one into another.

With the systems I used before UNIX, this was the only problem.  But the
implementations of UNIX, and the compilers, I have seen change global names.
I do not know to what extent this is universal, but C (and I have been told
Pascal) prepends an underscore to every global name, and Fortran prepends
and postpends an underscore likewise.  I have not seen an object file
editor which can change names to ones of different length.

Now I have no problem in using these names to call Fortran from C and
vice versa.  But suppose one wishes to produce a subroutine to be called
from different languages?  If the names were unchanged, and calling
sequences could be supplied to the compilers, this would be easy.

I suggest we try to make it easy.
-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907
Phone: (317)494-6054
hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)
Technical Details
Message-ID: <1965@l.cc.purdue.edu>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!aplcen!haven!purdue!mentor.cc.purdue.edu!l.cc.purdue.edu!cik
References: <22569:05:10:24@stealth.acf.nyu.edu> <12507@mcdphx.phx.mcd.mot.com> <17349:05:24:18@stealth.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!aplcen!haven!purdue!mentor.cc.purdue.edu!l.cc.purdue.edu!cik
From: cik@l.cc.purdue.edu (Herman Rubin)
Newsgroups: comp.lang.misc
Subject: Re: Anyone want to design a language?
Summary: Linking between different products is not that hard if names are
  not changed by the processors
Message-ID: <1965@l.cc.purdue.edu>
Date: 26 Feb 90 14:14:04 GMT
References: <22569:05:10:24@stealth.acf.nyu.edu> <12507@mcdphx.phx.mcd.mot.com> <17349:05:24:18@stealth.acf.nyu.edu>
Organization: Purdue University Statistics Department
Lines: 38