Re: Current Usses for Fortran ??

From: Gordon Sande (g.sande_at_worldnet.att.net)
Date: 08/25/04


Date: Wed, 25 Aug 2004 13:17:10 -0300


>But, coming from C and C++, it seems to me that F77 is quite "ugly"
>language, i.e.: you need goto for loops, no dynamic memory allocation
>(so: no dynamic structures like lists, etc.).

Usually one uses DO for looping rather than GOTO, so it is not clear
what the basis of your comment is.

For the applications the ability to do major resizing parametrically
is more important than "dynamic". The parameter and include machinery
make this both understandable and doable. There are several standard
idioms for doing this smoothly. And F90 makes things even easier.

The literal use of the C dynamic allocation scheme may not always be
sensible. When the need for "dynamic structures" was present they were
more typically "allocated" out of large arrays by using subscripts
rather than pointers, just like good software engineering practice does
with C when industrial strength code is needed. Serious F90 will do
the same. Leaving only demonstration codes to use the native dynamic
allocation of either C or F90.

Some would suggest that you need to understand F77 "as it is spoke"
rather than just a quick, seemingly superficial, impression with a C++
accent.

>On the other side, looking on some F90/95 code, it seems a very cool
>language (e.g.: it has built-in matrix calculations, while in C++ you
>need external libs).
>
>So, my question is: why you use F77 and not a more modern Fortran??

One of the major reasons for using F77 was the "1980" calendar hanging
on the wall while the codes were being written. F90 or F95 postdate
many of the codes.

One might as well ask "Why didn't the first book on C describe C++ if it
is so much better?" If you go looking for the software engineering
literature on size and maintainability of codes you will find tha C++
looks pretty "ugly" compared to more disciplined languages.

>How can you manage large projects (as I think nuclear code projects are!)
>with F77?

At that scale the issue is rarely if ever the language. It is a bit hard
to find 35 year old projects that started in 1990 so you will find more
F77 than F90. But that is changing.



Relevant Pages

  • Re: About VS C++
    ... The Free Pascal version has no single memory allocation only static allocated structures and variables. ... I had only a quick look at this single example and I wouldn't call this a serious comparison, beside that the most performant commercial compilers available for Linux aren't in the lists of compared compilers. ... And the discussion here was about .NET on the Windows platform, don't know how performant Mono is compared to .NET. ... The spirit of .NET is>not yet< to replace all native applications and to compile faster code, but language interoperability and productivity - ...
    (borland.public.delphi.non-technical)
  • Re: new foo[42]
    ... > difference to the new allocation. ... are not part of the standard language. ... I recommend starting C++ with this book: ... see the book review section at www.accu.org for peer ...
    (comp.lang.cpp)
  • Re: Draft Secure C
    ... completely blind to the problems of the C language. ... A better mapping to functionality commonly available in hardware. ... Better heap functionality. ... That means memory allocation is something that you ...
    (comp.lang.c)
  • Re: Research on GC and non-GC languages: The Toll of Garbage Collection
    ... As another poster noted, this is a sampling of size 2, not thorough research. ... > memory allocation methods, tight allocation loop ... make code go slower and slower, and that, in any language. ... Did you take N programmers, have them produce the same kind of code ...
    (comp.lang.cpp)
  • Re: Allocatable dummy argument
    ... > Was ALLOCATABLE only introduced with F95? ... It was introduced in f90. ... undefined allocation status is not unallocated. ...
    (comp.lang.fortran)