[comp.lang.fortran] C to Fortran conversion

kahn@batcomputer.tn.cornell.edu (Shahin Kahn) (04/11/89)

How about C to Fortran translation?  Does anyone know of such a tool?

lfoard@wpi.wpi.edu (Lawrence C Foard) (04/12/89)

In article <7713@batcomputer.tn.cornell.edu> kahn@tcgould.tn.cornell.edu (Shahin Kahn) writes:
>How about C to Fortran translation?  Does anyone know of such a tool?

This would be virtually impossible unless you used Fortran to simulate a
processor. It would also consume huge amounts of memory since Fortran has no
dynamic memory allocation, you would have to make an array that would be the
biggest memory size possible. Of course you would also have to simulate a
stack since Fortran doesn't support recursion....

Goes to show C is simply better than Fortran ;)

-- 
Disclaimer: My school does not share my views about FORTRAN.
            FORTRAN does not share my views about my school.

dillon@uhccux.uhcc.hawaii.edu (Ian Dillon) (04/12/89)

In article <1860@wpi.wpi.edu> lfoard@wpi.wpi.edu (Lawrence C Foard) writes:
>>How about C to Fortran translation?  Does anyone know of such a tool?
>
>.... It would also consume huge amounts of memory since Fortran has no
>dynamic memory allocation, you would have to make an array that would be the
>biggest memory size possible. 

We use dynamic memory allocation in all of our Fortran programs.  If we didn't,
we'd be very limited in our applications.  Truth is, dynamic allocation is not
that hard, and does not require a Fortran guru to pull it off.
 
>
>Goes to show C is simply better than Fortran ;)
>

This is soooo tempting but I'll keep my flames to myself on this one.  
Personally, I like them both, as each language has its moment in the sun.

	Ian
 

jlg@lanl.gov (Jim Giles) (04/13/89)

From article <1860@wpi.wpi.edu>, by lfoard@wpi.wpi.edu (Lawrence C Foard):
> In article <7713@batcomputer.tn.cornell.edu> kahn@tcgould.tn.cornell.edu (Shahin Kahn) writes:
> [...]      It would also consume huge amounts of memory since Fortran has no
> dynamic memory allocation, you would have to make an array that would be the
> biggest memory size possible. Of course you would also have to simulate a
> stack since Fortran doesn't support recursion....
> 
> Goes to show C is simply better than Fortran ;)

Of course, Fortran would be better than C if it had dynamic memory and
recursion (like 8x does 8-).  But, for thing that don't need these features,
Fortran is already better than C.

.
.
.
.
.
.

thompson@batcomputer.tn.cornell.edu (Steve Thompson) (04/13/89)

In article <3738@uhccux.uhcc.hawaii.edu> dillon@uhccux.UUCP (Ian Dillon) writes:
>In article <1860@wpi.wpi.edu> lfoard@wpi.wpi.edu (Lawrence C Foard) writes:
>>Goes to show C is simply better than Fortran ;)
>
>This is soooo tempting but I'll keep my flames to myself on this one.  
>Personally, I like them both, as each language has its moment in the sun.
>

Never could resist temptation. I agree that C is nicer to work with on
many unix boxes, where the fortran is not so good (we have some SGI
300 series machines, can you say C-R-A-P). However, IMHO, fortran on
the VAX blows C completely out of the water, especially for text
manipulation (and I have written many thousands of lines of each).
Nearly all of my VMS fortran code (all of the bits without system calls)
ports easily from our VAX running VMS to our DECstation 3100's (I haven't
counted, but it's over 95%), which is more than I can say for C between
our various unix machines.

Steve

davis@galaxy.ee.rochester.edu (Al Davis) (04/14/89)

In article <11924@lanl.gov> jlg@lanl.gov (Jim Giles) writes:
>Of course, Fortran would be better than C if it had dynamic memory and
>recursion (like 8x does 8-).  But, for thing that don't need these features,
>Fortran is already better than C.      ^^^^^^

This is not a typo.  (I couldn't resist...)