Sujet : Re: Re: “Did nobody stop to think what might happen in an emergency in space?”
De : kludge (at) *nospam* panix.com (Scott Dorsey)
Groupes : rec.arts.sf.writtenDate : 02. Sep 2024, 15:42:21
Autres entêtes
Organisation : Former users of Netcom shell (1989-2000)
Message-ID : <vb4isd$3f7$1@panix2.panix.com>
References : 1 2 3 4
Michael F. Stemper <
michael.stemper@gmail.com> wrote:
I would guess that a straight translation of Fortran to C++ could be
automated. However, there doesn't seem to be any point in it unless
you're going to make use of the object-oriented capabilities of C++.
Then, of course, you're looking at a complete refactoring, which would,
indeed, be non-trivial.
Bell Labs wrote an f2c converter back in the eighties and it worked okay.
For years it was used as a front end to gcc in order to make the g77
compiler, which worked most of the time for clean fortran 77 code.
It was not wonderful and it was not optimal but it was functional.
The nice thing about fortran is that there's a lot less to go wrong than
with C++. Engineers should not be allowed to touch pointers. Nobody should
ever use null-terminated strings; that was just a bad idea initially. You
can still goober things up by writing past array bounds and passing
subroutine and function parameters improperly but at least we have some
tools to find these quickly and easily.
f90 has a lot of very cool matrix functions and operators which make
compilation on a vector machine (like a GPU) easier, and make for much
more readable matrix code too. I have trouble convincing people to use these
however.
--scott
-- "C'est un Nagra. C'est suisse, et tres, tres precis."