Liste des Groupes | Revenir à ras written |
Michael F. Stemper <michael.stemper@gmail.com> wrote:I have converted F2C into my own F2CPP with quite a few changes for code readability and semi automated usage of std::string. The fortran reads and writes are a complete disaster so I am rewriting these by hand. I have converted almost 100K lines of F77 to C++ so far, all working. 750K lines to go.I would guess that a straight translation of Fortran to C++ could beBell Labs wrote an f2c converter back in the eighties and it worked okay.
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.
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
Les messages affichés proviennent d'usenet.