This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: General compiler question.
John Vaul wrote:
Is it the case that if I was clever enough I could write a C program
that was as efficient as a Fortran program compiled
with any Fortran compiler?
The language used to implement a compiler does not necessarily determine
how efficient eh code output is. Fortran has certain features that allow
it to be optimized more effectively than C for certain kinds of
programs. C, on the other hand, is more effective at low-level, bit
oriented operations.
And if I was super clever I could just write
my whole code in assembly language and it would
be super fast?
Yes, with the proper knowledge and an appropriate expenditure of time.
Programming at the machine level requires considerable experience and
understanding of the architecture.
But I'm not clever, so I write in Fortran, save lots of time and rely on
the clever people who write the Fortran compiler.
Which is a very good way of doing things. :)
--
Scott Robert Ladd
site: http://www.coyotegulch.com
blog: http://chaoticcoyote.blogspot.com