Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rebuttal to Treurich et al.

36 views
Skip to first unread message

Dan Nagle

unread,
Jun 18, 2001, 3:47:28 PM6/18/01
to
Hello,

Treurich, et al. wrote an article claiming an easy
conversion of their Fortran code to C++.

Toon Moene and I have written a rebuttal which is now
posted on my website, http://users.erols.com/dnagle
click on "Rebuttal to Treurich et al."

--
Cheers!

Dan Nagle
Purple Sage Computing Solutions, Inc.

--
Cheers!

Dan Nagle
Purple Sage Computing Solutions, Inc.

gib bogle

unread,
Jun 18, 2001, 5:49:50 PM6/18/01
to
Good stuff!


Jos Bergervoet

unread,
Jun 18, 2001, 5:53:53 PM6/18/01
to
Dan Nagle <dna...@erols.com> wrote:

> Treurich, et al. wrote an article claiming an easy
> conversion of their Fortran code to C++.
>
> Toon Moene and I have written a rebuttal which is now
> posted on my website, http://users.erols.com/dnagle

Will your text (or some derived version) also appear in "Computing
in Science & Engineering"?

And, by the way, where you write: " ... It is all too easy to find
situations where the restrict keyword is valid for most input datasets
but not unusual edge cases, ... "
^^^
I believe the word 'for' is missing.

This 'restrict stuff' is, AFAIK, the main difference. Aren't you
afraid that people might argue that the implicit presence of
'restrict' in Fortran is dangerous (thereby reversing your argument)?

-- Jos

Dan Nagle

unread,
Jun 18, 2001, 8:08:49 PM6/18/01
to
Hello,

On 18 Jun 2001 21:53:53 GMT, Jos Bergervoet <berg...@iaehv.iae.nl>
wrote:

<snip>

>This 'restrict stuff' is, AFAIK, the main difference. Aren't you
>afraid that people might argue that the implicit presence of
>'restrict' in Fortran is dangerous (thereby reversing your argument)?

It seems to me we've had this debate before, and here in c.l.f anyway,
the result is "you know the rules, play by them".

Besides, are you really going to let a C++ advocate say (with,
presumably, a straight face), "but that's dangerous!" ? ;-)

Jugoslav Dujic

unread,
Jun 18, 2001, 6:07:32 PM6/18/01
to
| This 'restrict stuff' is, AFAIK, the main difference. Aren't you
| afraid that people might argue that the implicit presence of
| 'restrict' in Fortran is dangerous (thereby reversing your argument)?
|
| -- Jos

Contrary, Jos, it's not dangerous -- it's restrictive (as the
word says). However, I remember my recent struggling in CLF
("Functions as argument" IIRC) in favor of (a better replacement of)
Cray pointers. My cries that standard should provide a means for
workarounding restrictivity for sake of flexibility weren't quite
supported :-).

Jugoslav

Michael Metcalf

unread,
Jun 19, 2001, 5:21:07 AM6/19/01
to
Dan,
Please note that CISE printed a letter from me on this topic
in the May/June issue. It is at

www.computer.org/cise/cs2001/pdf/c3002.pdf

embedded in the Editorial.

Regards,

Mike Metcalf

--

Jan Vorbrueggen

unread,
Jun 19, 2001, 8:32:56 AM6/19/01
to
Michael Metcalf <11354...@CompuServe.COM> writes:

> Please note that CISE printed a letter from me on this topic
> in the May/June issue. It is at
>
> www.computer.org/cise/cs2001/pdf/c3002.pdf
>
> embedded in the Editorial.

The original author's reply is also revealing. How they manage to read into
your letter that "Fortran 90 ... is inferior to C++" is almost beyond me.

Jan

Stanislaw Kozlowski

unread,
Jun 19, 2001, 9:10:05 AM6/19/01
to
In my opinion the whole thing (and the article) is not worth any
discussion.
Imagine a person who attempts to convince us to screw bolts
with a hammer. This is similar to make numerical computations
with C/C++ . Fortran is not ideal, much better for this type of
tasks would be Pascal but .... we do not
have these old, tested, ready to use libraries as in Fortran. So
taking everything into account, for numerics, majority of the programmers
use Fortran. On the other side for manipulating operating system internals
they use C/C++ and not Fortran because for this particular task
it would be too cumbersome.
S. Kozlowski
Poland
"Dan Nagle" <dna...@erols.com> wrote in message
news:1mmsitsagfbndel86...@4ax.com...

Prof. Richard E. Hawkins

unread,
Jun 19, 2001, 12:15:17 PM6/19/01
to
In article <y44rtc6...@mailhost.neuroinformatik.ruhr-uni-bochum.de>,

Jan Vorbrueggen <j...@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:
>Michael Metcalf <11354...@CompuServe.COM> writes:

>> Please note that CISE printed a letter from me on this topic
>> in the May/June issue. It is at

>The original author's reply is also revealing. How they manage to read into


>your letter that "Fortran 90 ... is inferior to C++" is almost beyond me.

I'm assuming that it's from noting that C++ went all of the way to OOP,
which, I suppose, is the source of All Goodness.

hawk

--
Prof. Richard E. Hawkins, Esq. /"\ ASCII ribbon campaign
doc...@psu.edu Smeal 178 (814) 375-4700 \ / against HTML mail
These opinions will not be those of X and postings
Penn State until it pays my retainer. / \

Jan Vorbrueggen

unread,
Jun 19, 2001, 12:34:50 PM6/19/01
to
ha...@fac13.ds.psu.edu (Prof. Richard E. Hawkins) writes:

> >The original author's reply is also revealing. How they manage to read into
> >your letter that "Fortran 90 ... is inferior to C++" is almost beyond me.
> I'm assuming that it's from noting that C++ went all of the way to OOP,
> which, I suppose, is the source of All Goodness.

That's why I put "almost" in there 8-)...

Jan

Toon Moene

unread,
Jun 19, 2001, 1:58:05 PM6/19/01
to
Michael Metcalf wrote:

> Dan,

> www.computer.org/cise/cs2001/pdf/c3002.pdf

It might not be that clear from Dan's web page, but he *did* offer the
article to CISE. They never replied to that offer, so we waited 3
months and then decided it could be published without restrictions, i.e.
on that great "freedom of the press" thingie - the World Wide Web.

--
Toon Moene - mailto:to...@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

Gib Bogle

unread,
Jun 19, 2001, 4:31:07 PM6/19/01
to
Toon Moene wrote:
>
> Michael Metcalf wrote:
>
> > Dan,
>
> > Please note that CISE printed a letter from me on this topic
> > in the May/June issue. It is at
>
> > www.computer.org/cise/cs2001/pdf/c3002.pdf
>
> > embedded in the Editorial.
> >
> > Regards,
> >
> > Mike Metcalf
>
> It might not be that clear from Dan's web page, but he *did* offer the
> article to CISE. They never replied to that offer, so we waited 3
> months and then decided it could be published without restrictions, i.e.
> on that great "freedom of the press" thingie - the World Wide Web.

Their failure to reply hints at a lack of impartiality, apart from crass
discourtesy.

Dan Nagle

unread,
Jun 19, 2001, 6:21:28 PM6/19/01
to
On Wed, 20 Jun 2001 08:31:07 +1200, Gib Bogle <bo...@ihug.co.nz>
wrote:

>Toon Moene wrote:
>>
<snip>

>> It might not be that clear from Dan's web page, but he *did* offer the
>> article to CISE. They never replied to that offer, so we waited 3
>> months and then decided it could be published without restrictions, i.e.
>> on that great "freedom of the press" thingie - the World Wide Web.
>
>Their failure to reply hints at a lack of impartiality, apart from crass
>discourtesy.

I understand that they changed their address at about the time
I snail mailed the manuscript to them, it's always possible
the snails ate it (i.e., it's lost in the post). ;-)

Perhaps I should try again <sigh>.

I don't think, from reading CSE since the beginning,
that they've ever given Modern Fortran a fair appraisal.

Jos Bergervoet

unread,
Jun 19, 2001, 7:23:44 PM6/19/01
to
Prof. Richard E. Hawkins <ha...@fac13.ds.psu.edu> wrote:

>>The original author's reply is also revealing. How they manage to read into
>>your letter that "Fortran 90 ... is inferior to C++" is almost beyond me.

> I'm assuming that it's from noting that C++ went all of the way to OOP,
> which, I suppose, is the source of All Goodness.

But then of course, you have to be a fan of All Goodness.

Personally, I like the template classes in C++ (If Fortran had any
form of parametric polymorphism, that would probably be better, but
Fortran hasn't).

Also very nice (in C++) is the automatic memory management (for
function results of dynamic-size type, and similar things) that
Fortran still lacks until allocatable components are introduced,
which means: until f2k. (NB: although the newest version of F
already has it, actually, and some full Fortran compilers support
it as well).

-- Jos

PS: I know that people manage to write code with memory leaks in
C++, but I maintain that C++ has the mechanism to avoid them,
while Fortran (without allocatable components), simply lacks it.

Jos Bergervoet

unread,
Jun 19, 2001, 7:39:33 PM6/19/01
to
Dan Nagle <dna...@erols.com> wrote:

> I don't think, from reading CSE since the beginning,
> that they've ever given Modern Fortran a fair appraisal.

I think Fortran was mentioned in CISE a few times by Paul Dubois,
(still, it's very likely that there's a conspiracy, of course :-)

-- Jos

Arnaud Desitter

unread,
Jun 20, 2001, 5:38:09 AM6/20/01
to
Jos Bergervoet wrote:
>

> Also very nice (in C++) is the automatic memory management (for
> function results of dynamic-size type, and similar things) that
> Fortran still lacks until allocatable components are introduced,
> which means: until f2k. (NB: although the newest version of F
> already has it, actually, and some full Fortran compilers support
> it as well).
>

For record, I know of:
Lahey, NAG, NAsoftware

Hopefully, more compilers will support that extension in the near
future.

Some code related to code instrumentation is available at:
http://ftp.cac.psu.edu/pub/ger/fortran/test/results.txt

Cheers,
Arnaud

Jos Bergervoet

unread,
Jun 20, 2001, 3:07:33 PM6/20/01
to
Arnaud Desitter <arnaud....@nag.co.uk> wrote:
>> ..

>> Fortran still lacks until allocatable components are introduced,
>> which means: until f2k. (NB: although the newest version of F
>> already has it, actually, and some full Fortran compilers support
>> it as well).
>
> For record, I know of:
> Lahey, NAG, NAsoftware

Although NAG and F have a bug (they don't free the memory in
intent(out) dummies before a routine gives them a new value,
whereas the standard clearly requires this).

> Hopefully, more compilers will support that extension in the near
> future.

Yes. Because then we can show the C++ fans how simple good memory
management can be. In C++ you need to write a class with constructor,
destructor, copy constructor, explicit "deep copy" assignment, all
spelled out in detail. But in f2k, a derived type with allocatable
components automatically has all those things.

Then again, C++ works, and f2k doesn't exist (yet).

-- Jos

Arnaud Desitter

unread,
Jun 21, 2001, 4:00:34 AM6/21/01
to Jos Bergervoet
Jos Bergervoet wrote:
>
> Arnaud Desitter <arnaud....@nag.co.uk> wrote:
> >> ..
> >> Fortran still lacks until allocatable components are introduced,
> >> which means: until f2k. (NB: although the newest version of F
> >> already has it, actually, and some full Fortran compilers support
> >> it as well).
> >
> > For record, I know of:
> > Lahey, NAG, NAsoftware
>
> Although NAG and F have a bug (they don't free the memory in
> intent(out) dummies before a routine gives them a new value,
> whereas the standard clearly requires this).

I think you are refering of the behaviour exposed by ALLOC26.f in
http://ftp.cac.psu.edu/pub/ger/fortran/test/.
NAGWare f95 4.1, which supports the updated technical report, passes
that test (see http://www.nag.co.uk/nagware/NP/NP41_announcement.asp).

>
> > Hopefully, more compilers will support that extension in the near
> > future.
>
> Yes. Because then we can show the C++ fans how simple good memory
> management can be. In C++ you need to write a class with constructor,
> destructor, copy constructor, explicit "deep copy" assignment, all
> spelled out in detail. But in f2k, a derived type with allocatable
> components automatically has all those things.
>

I am not convinced that comparing C++ and Fortran is a very interesting
exercise. Anyway, the real improvement with ALLOCATABLE components
is the ability the optimize the code much more than with POINTER.

I posted a while ago some code that shows that there are still some
compilers
that generate systematically temporaries when POINTER arrays are passed
as
assumed size arguments. As allocatable arrays are contiguous, this
behaviour
won't happen.


> Then again, C++ works, and f2k doesn't exist (yet).

TR 15580 (http://www.nag.co.uk/nagware/NP/doc/TR.html) was published
two years ago.

Regards,
Arnaud

Jos Bergervoet

unread,
Jun 21, 2001, 6:10:24 PM6/21/01
to
Arnaud Desitter <arnaud....@nag.co.uk> wrote:
>> ...

>> Although NAG and F have a bug (they don't free the memory in
>> intent(out) dummies ...

>
> NAGWare f95 4.1, which supports the updated technical report, passes
> that test (see http://www.nag.co.uk/nagware/NP/NP41_announcement.asp).

Oops! I was not referring to the latest version (but to the version
on which the latest F is based, which is 4.0a). My fault, of course,
and comparable, albeit less excessive, to the "Treurich et al. style"
of comparing f77 with modern C++.

> I am not convinced that comparing C++ and Fortran is a very interesting
> exercise.

Maybe not, but that was the topic (in Treurichs article as well as in
the various rebuttals by Vivek Rao, Mike Metcalf, Moene & Nagle, and
maybe others as well).

> ... Anyway, the real improvement with ALLOCATABLE components


> is the ability the optimize the code much more than with POINTER.

I don't see why that should be the "real" improvement. I think the
possibilities for memory management are a big improvement. Think
about the ISO_varying_string module. It just CANNOT be implemented
in f95 without memory leaks! Some may see this as an indication that
the language (f95) is simple broken (by todays standards of what a
language should be capable of). Allocatable components nicely remedy
this embarrassing situation (and much more cleanly than the C++ way).

Of course we know that varying strings are not that important, but
similar problems (i.e. data blocks of varying size) often play a
role in the memory management in numerical codes.

I think allocatable components, together with the rules for fail-safe
automatic deallocation as required by TR 15580, are a much greater
invention than most people realize. (Actually, "most people" won't
even know what allocatable components are, but that proves my point :-)

-- Jos

Arnaud Desitter

unread,
Jun 22, 2001, 6:33:14 AM6/22/01
to Jos Bergervoet
Jos Bergervoet wrote: > Arnaud Desitter <arnaud....@nag.co.uk> wrote: > > ... Anyway, the real improvement with ALLOCATABLE components > > is the ability the optimize the code much more than with POINTER. > I don't see why that should be the "real" improvement. I think the Well, I worked on some production code which uses code idioms such as: TYPE MY_OBJ DOUBLE PRECISION,POINTER,DIMENSION(:)::R END TYPE MY_OBJ Passing the component to an assumed size dummy argument has the potential to be a real performance killer. As far as I know, some major compilers still generate systematically a temporary object regardless of the contiguity of pointed data. See the code I posted to this newsgroup in April 2001: http://groups.google.com/groups?as_q=BIEF_OBJ&as_ugroup=comp.lang.fortran By using: TYPE MY_OBJ DOUBLE PRECISION,ALLOCATABLE,DIMENSION(:)::R END TYPE MY_OBJ no copy is necessary. > possibilities for memory management are a big improvement. Think > about the ISO_varying_string module. It just CANNOT be implemented > in f95 without memory leaks! Some may see this as an indication that > the language (f95) is simple broken (by todays standards of what a > language should be capable of). Allocatable components nicely remedy > this embarrassing situation (and much more cleanly than the C++ way). > Of course we know that varying strings are not that important, but > similar problems (i.e. data blocks of varying size) often play a > role in the memory management in numerical codes. > I think allocatable components, together with the rules for fail-safe > automatic deallocation as required by TR 15580, are a much greater > invention than most people realize. (Actually, "most people" won't > even know what allocatable components are, but that proves my point :-) I agree with all your points. That's why it would be nice to have more implementations of TR 15580. Cheers, Arnaud
0 new messages