g77 future / proposed extension

Grant Petty gpetty@precip.eas.purdue.edu
Tue Feb 1 14:20:00 GMT 2000


CC: GNU/GCC project

Dear Craig,

I am a latecomer to the g77 scene and just went looking on the web for
info on the status of g77.  I did not know (before now) that its future
development was in doubt. While I completely understand the dilemma faced
by people involved in the support and improvement of g77, the reason I
went looking in the first place, and why I am writing you now, is to
suggest a new opportunity and rationale for g77 development that may have
been previously overlooked.  I know you have taken yourself off the g77
project, so please forward this message to someone else if appropriate,
and thanks for your past efforts!

I am an academic scientist who has long perceived a GLARING deficiency in
"standard" computer languages with respect to scientific computing.  In
contrast to system programming and consumer application programming,
scientific programming (e.g., data analysis, modeling, etc.) almost
invariably involves quantities with physical dimensions (length, force,
temperature, mass, etc.) rather than mere numbers. The universal
deficiency I perceive lies in (1) the assumption that numerical values in
mathematical expressions are physically dimensionless (unitless)
quantities, and (2) the requirement that the programmer bear the burden of
hand-coding unit conversions and of verifying dimension and unit
consistency in all calculations and in the passing of arguments between
functions.  To give a simple example, a calling program might use
millimeters to describe the diameter of a raindrop, whereas a called
subroutine obtained from another source might expect meters or cm.  And
far more complex examples exist.

It has been my experience that the most tedious part of scientific
programming, and one of the aspects most prone to error, is item 2, above.
Surprisingly, it has also been my experience that virtually no one in the
scientific community has ever stopped to consider whether this is a
desirable or necessary state of affairs!

I concluded that some surprisingly simple and (to my mind) technically
straightforward extensions to a language like Fortran could accommodate
physical units in a very natural and intuitive way, eliminate an important
source of errors and paving the way to a more robust style of scientific
programming.

Clearly, other languages could benefit from this as well, and some (such
as C++) might even be able to accommodate my ideas without actually
extending the language itself.  But I single out Fortran because it
remains the language of choice for most scientific programmers today and
because there is a huge body of legacy code "out there" that could be
modified in relatively simple ways to take advantage of the proposed
extensions.

The logical place, in my opinion, to implement and demonstrate a Fortran
extension of potentially great importance to scientists and engineers
would would be in an established community compiler like g77.  A
successful demonstration of the ideas I'm describing would, just maybe,
put g77 on the leading edge of a long-overdue overhaul of scientific
computing.

The essence of the proposed changes is simple:

1) Define a small number of new data types in addition to the standard
ones of REAL, INTEGER, and CHARACTER.  An example would be something I
call PREAL, which would be identical to REAL except for a few additional
bits for storing physical dimensions. 

2) Extend the standard mathematical operators and functions (and possibly
I/O functions) to do the correct thing with the new data types and to do
some simple run-time error checking.

Conceptually, at least, I think I have the details pretty much worked out
(see http://meso.eas.purdue.edu/~gpetty/fortran_proposal.txt ). But I am
not a compiler person, nor even a professional programmer, and could not
possibly hope to implement the proposed extensions in a working compiler.  
My question is therefore simple: is the GNU/gcc/g77 project the right
place to turn for help in demonstrating the concept?  If not, can you
suggest alternative avenues?

If I can show that people who know how to modify fortran compilers are
interested in participating, I would be willing to take the lead in
approaching the National Science Foundation for a modest amount of
funding.

	thanks for your time, and best regards,

	Grant Petty



Grant W. Petty                  |Assoc. Prof.,  Atmospheric Science
Earth & Atmospheric Sciences    |Voice:  (765)-494-2544
Purdue University, 1397 CIVL    |Fax:    (765)-496-1210
West Lafayette, IN 47907-1397   |Email: gpetty@purdue.edu



More information about the Gcc mailing list