Related articles |
---|
Stack-based IR vs. Register-based IR evan@top.cis.syr.edu (Evan Cheng) (1996-07-20) |
Appropriate methods for argument checking clodius@nis.lanl.gov (William Clodius) (1996-07-22) |
Re: Appropriate methods for argument checking grout@polestar.csrd.uiuc.edu (1996-07-23) |
Re: Appropriate methods for argument checking chase@centerline.com (1996-07-26) |
Re: Appropriate methods for argument checking jgllgher@maths.tcd.ie (Dara Gallagher) (1996-07-31) |
From: | William Clodius <clodius@nis.lanl.gov> |
Newsgroups: | comp.compilers |
Date: | 22 Jul 1996 10:49:03 -0400 |
Organization: | Compilers Central |
References: | 96-07-137 |
Keywords: | Fortran, design, debug, comment |
There has been a discussion this week in comp.lang.fortran about the
appropriate method for checking whether the a function is being called with
the appropriate argument types. Some of the older programmers are not happy
with F90's modules and claim that at least this capability "should" be
implemented by having type consistency checks in the loader. One of the
former members of X3J3, who actually helped design Fortran's modules has
confined his comments to simply noting that there had been Burrough's
compilers that did this. (He should know since the F90 standard lists him
as representing Unisys during the creation of the standard.)
I have been skeptical of this because I have heard that Bertand Meyer has
had great difficulty implementing compile time checking for Eiffel to deal
with its covariance requirements, and because properly defining and
conveying the appropriate type information to a loader that has to deal with
multiple source languages looked more complicated and less robust to me than
to the old timers. Note that because Eiffel is an object oriented language.
and may be the only one that uses covariant typing of procedures, its
problems are not immediately pertinent to Fortran, but there is talk of
making Fortran Object Oriented and I do like Eiffel's covariance (although
matching is possibly an acceptable substitute.)
Also as long as I am on the subject of checking the arguments to Fortran's
procedures, one not unknown problem with Fortran's semantics is a failure of
some programmers to be aware of all of the no modifiable alias requirements
for its arguments. Checking that the code satisfied this requirement did
not appear to be practical under F77. Is it practical in F90 if modules are
used to provide an explicit interface, and the INTENT of all arguments are
indicated. If it remains impractical, is it practical to identify the most
common cases where the procedure does not satisfy Fortran's semantics, or a
near minimal subset of all cases where the procedure call might not satisfy
that condition. Further if this requirement cannot be clearly identified as
being satisfied, would flagging the obviously erroneous code make the users
complacent and less able to identify undetectable cases, and would flagging
any possibly erroneous code overwhelm the users and make the enabling of
warning conditions that much less likely.
[I believe that perfect alias checking is equivalent to the insoluble halting
problem, but there should be some useful heuristics. Fortran doesn't make it
easy, since the aliasing rule is applied element by element, not array by
array. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.