Looking for a good book on Fortran - 77 and/or 90/95. I'm coming from a C/C++ background, and while I'm solid there, I'd really like to have a text to get up to speed on Fortran conventions/style.(Yes, I know there's a plethora of stuff on the web; however, I like having a book - it's just how I work.)What have you got for me, Tech Talk?
4/17/2009 2:12:59 PM
I picked up a Fortan 77 book at a used book store for a quarter. You're welcome to it if you want it.
4/17/2009 2:25:58 PM
i use the older version (fortran 90/95) of this book:http://ecx.images-amazon.com/images/I/51fDCjBjuhL.jpg
4/17/2009 3:00:01 PM
^ I was actually looking at that one on Amazon - so it's pretty decent, I assume?
4/17/2009 7:52:46 PM
Unless you absolutely must learn FORTRAN, I would run for the hills. All the object-oriented stuff is shitty and fake and neither objects nor oriented.I used it for years and wrote non-trivial applications with it. C is just as flexible, powerful, portable, and fast as FORTRAN. Without the arbitrary and sometimes serious limitations.FORTRAN needs to die.
4/17/2009 9:46:42 PM
I prefer using C. Any given day.Unfortunately, a lot of codes I'll have to be using are written in Fortran. So it's kind of a necessity of life.
4/17/2009 10:32:22 PM
^^ I thought FORTRAN had the benefit of forcing the programmer to dot his I's and cross his T's... If so, that would definitely be a reason to use FORTRAN over C if it was a mission critical application.Maybe I'm getting it confused with another old-school language like COBOL though.
4/17/2009 10:54:27 PM
^ I don't know what you're talking about. No code is going to run in any language if you write it wrong. One of the major "strong points" associated with FORTRAN is that the code supposedly looks a lot like the equations it's solving... but the same can be said about any language.Some people say FORTRAN is good for rapid development. So are Legacy VB, [VB, C#, J#].NET or Java (both slower because they're interpreted languages). Say what you want about VB being a script kiddie language, but the syntax makes it really easy to troubleshoot.FORTRAN has a lot of built-in functions defined in the spec geared toward engineering applications. That's all well and good, but most compilers don't implement the built-in functions well. A classic example is MATMUL. The f95 implementation is more than 10,000 times slower than the one in g95 or Visual FORTRAN. So you'll end up including a library of engineering functions in FORTRAN just as you would any other language.FORTRAN was great before C and Basic were available and most programming languages were like MUMPS, JOSS or ALGOL. Attempts to modernize these archaic languages (see Cache ObjectScript and FORTRAN 95/2003) have failed miserably, the only good exception being Pascal (Delphi).The only reason anyone learns FORTRAN anymore is because of all the dinosaurs out there with a death grip on their FORTRAN sources who never bothered to keep up with modern programming. As a result there's tons of FORTRAN code out there that should have been ported to Pascal or C decades ago and now there are so few people in the world with genuine expertise in FORTRAN that it would be prohibitively difficult to port the source.As you can tell, I've had nightmarish experiences with FORTRAN and I think it needs to die (along with DCL for OpenVMS ).
4/18/2009 12:32:14 AM
as an engineer first and programmer second, fortran works well for my purposes. it's main function is to be able to get the job done and get it done quickly. it's been a while since i've used C extensively, but there is a way to inter-mix C and fortran in a given code with C preprocessors, so I see some of both. I really just think it's personal preference. as far as things like matmul, etc, unless you're running with NO optimizations, that won't be an issue.
4/18/2009 8:45:15 AM
Either FORTRAN or C can be compiled to a library and called from the other.
4/18/2009 12:33:48 PM
i mean obviously there is some truth to that. but that by itself doesn't make fortran a bad language for the purposes of crunching numbers. i've seen conflicting reports about what languages are faster for crunching numbers. and for the record, i've never used matmul in any actual research code. (i have a few times in quick codes i've made for classes and such). so i'm not really sure of its performance.
4/18/2009 1:14:46 PM
4/18/2009 1:45:18 PM
4/21/2009 10:16:40 AM
^^No your post I was responding to made no sense. I was talking about invalid syntax. What the fuck else would you mean by "dot his I's and cross his T's". Invalid syntax means it's not going to compile. Tell me what kind of error you're going to make in one language that FORTRAN is going to rescue you from and I'll tell you you're wrong.
4/24/2009 12:11:31 AM
FORTRAN is still used, from what I've heard, because it's one of the easiest ways to write code for relatively simple but massively parrallel tasks. For example, simulating a reactor core as a set of descrete elements defined by the same set of coupled partial differential equations. While we now have many more specialized tools for that, their particular propriatiary languages very strongly resemble FORTRAN and many of them are actually FORTRAN engines.Also, 2003 onward includes a lot of C interoperability. As far as performance goes, FORTRAN is disadvantaged by the huge numbers of bizzare defaults for optimizations in most free compilers. With the right optimizations its very efficient. [Edited on April 24, 2009 at 3:00 AM. Reason : ]
4/24/2009 2:53:44 AM