g77 future / proposed extension

Grant Petty gpetty@precip.eas.purdue.edu
Wed Feb 2 13:51:00 GMT 2000


On Wed, 2 Feb 2000, Toon Moene wrote:

> Jamie Lokier wrote:
> 
> > Grant Petty wrote:
> 
> > > 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.
> 
> > Yes, it has been done in C++.  I implemented that sort of thing twice in
> > C++.  It's very nice to use.
> 
> > As a bonus, you can mess around with the representations for different
> > units, using the fastest and most compact integer representation when
> > you know your program doesn't need to deal with distances more
> > accurately than 1mm for example.

Jamie - 

Thanks for your earlier response.  What you describe is very interesting,
and I would love to see a simple example program in C++ if one is
available. 

Unfortunatly, even if C++ is perfectly suited to this problem without any
need to extend that language, I'm quite certain that most scientists
working on physical problems around the world are not going to begin
migrating to C++ any time soon, no matter how great the incentive (there
are certain important disincentives as well).  Therefore I still perceive
an urgent need to address this problem transparently (from the scientific
programmer's perspective) in Fortran.

> 
> In fact, I wouldn't be surprised if that wasn't already possible today
> with Fortran 90/95.  Unfortunately, I never thought about this problem
> so it might be useful to ask this question on comp.lang.fortran ...

Toon -

Thanks for your reply.  Although I have not used Fortran 90 much, it is my
impression that it does not contain any provisions for operator
overloading, which I believe to a be fairly important prerequisite.  If
I'm wrong about this, I would certainly be happy to learn this. 
I will post a question to c.l.f. and see if anyone knows of a way to do
what I described.

> 
> Extending g77 for this purpose certainly seems the wrong approach to me,
> though.

You may be correct, but I wonder if you would be willing to state, in one
or two sentences, why you believe this, since I am not sure I understand.
Is it because of an official policy of keeping g77 consistent with
'standard' Fortran?  If so, then I need to identify people who are
familiar with the inner workings of g77 but are not constrained by that
policy.

In any case, if a genuine language extension is needed (as opposed to the
mere addition of a layer of preprocessor macros), it seems to me (a
non-expert) that the only way to achieve this is by writing a compiler
that implements that extension.  That being the case, the choice seems to
be between a commercial (proprietary) compiler or an open-source community
compiler, the only example of which that I know of is g77.  I would much
prefer the latter approach, if available.

	thanks again for your time,

	regards,


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