Slashdot Mirror


Is FORTRAN Still Kicking?

Algorithm wrangler queries: "I'm beginning to wonder if I should invest the time in learning FORTRAN. Although it is, arcane it seems to be the best tool when it comes to demanding optimization tasks and heavy computations. C/C++ does not cut it for me - it is simply too easy to make mistakes and I find myself using half of my time hunting bugs unrelated to the problem at hand. Additionally, although tools like Matlab exist they don't provide the power that justify the huge price tag they carry. I find any script based language (Matlab, Numeric Python, Scilab) to be inadequate as soon as it is necessary to use loops to describe a problem and using such tools for recursive systems can be a real pain. As another data-point, the Netlib repository seems to be very FORTRAN oriented, and it is a true gold mine when it comes to free routines for solving almost any computing task. What bothers me though is that FORTRAN code is really ugly and the language lacks almost any modern day language feature (I know about Fortran 90 but it is not much nicer than F77, and no one seems to use it). Can it really be true that the best tool we have for heavy duty computing is a 25 year old language, or have you found anything better - free or non-free?"

685 comments

  1. Yes by mfos.org · · Score: 2, Informative

    FORTRAN is used in high performance scientific computing. The language allows for high parrelelization.

    1. Re:Yes by Chundra · · Score: 5, Informative

      "FORTRAN: "The infantile disorder", by now nearly twenty years old, is hopelessly inadequate for whatever computer application you have in mind today: it is now too clumsy, too risky, and too expensive to use." (1982).

      "In the good old days physicists repeated each others experiments, just to be sure. Today, they stick to FORTRAN, so that they can share each others programs. And bugs."

      --Edsger Dijkstra
      (Interestingly enough, Dijkstra died today.)

    2. Re:Yes by prefect42 · · Score: 5, Informative

      This shows absolutely no understanding of the language. Sit down if you're not in the field.

      I used to teach "Practical Parallel Programminh" at the Univesity of Leeds and this is just crap. Fortran is typically used with OpenMP / MPI to do parallel programming. Older freaks might use PVM. They're all available for C/C++.

      And it's not that I'm no longer in the field, I currently work on Grid/Globus applications.

      Fortran is no more safe or fast to program in I'd argue it's a less safe myself. The performance difference between an optimal fortran program and an optimal C program I'd argue is nearly nil. Show me different, and explain why. Go on, try it.

      jh

      --

      jh

    3. Re:Yes by Rasta+Prefect · · Score: 5, Interesting
      FORTRAN is used in high performance scientific computing. The language allows for high parrelelization.

      This is sort of true. Fortran isn't nessecarily all that much more inherently parallelizable than other languages, but because it is the language of scientific computing quite a bit of effort has been expended on compilers that automatically parallelize for vector computers. For non vector computers, it really doesn't matter what language you use - You'll be using MPI to do it anyway, so as long as you have a set of language bindings, you're ok. (Although as far as I can tell these only exist for C and Fortran...)

      The real reason that FORTRAN continues to persist in scientific computing is twofold - First, there is a huge Fortran code base. Both in terms of things like Numerical Recipies and completed code. For example, I spent my summer integrating a Weather Model with a fluid dynamics model. The Weather Model, MM5 decends from the early 1970's (Pre FORTRAN 77). It's in Fortran. It's large. It would take a hell of a lot of effort to rewrite it, and nobody is going to do it. Theres a quite a bit of this stuff around, and the effort to rewrite it would enourmous, and frankly not worth it.

      Second, most people programming in scientific computing are not CompSci's. They Computaional Chemists, and Electrical Engineers and Meteorologists and who knows what else - but not programmers. They learned FORTRAN and as long as they can get their stuff done in FORTRAN, they're not gonna learn C so they can track down a segfault when their pointers wander off an array. The new PhD's probably learned C and will use it if starting from scratch(After all, even in FORTRAN 90 Dynamic allocation and pointers are really, really limited, often requiring recompiles whne your problem size changes), but 40-50 year old computational chemists are not gonna learn C. Period. So FORTRAN continues to get upgraded. At least they got rid of the @#$% Hollerith-punch card column layout...

      --
      Why?
    4. Re:Yes by Anonymous Coward · · Score: 0

      I feel required to reply as a young computational chemist! I don't use C or FORTRAN very much, though I know both of them. The second reason has nothing to do with the use of FORTRAN. Despite what you think, most computational chemists are continually using new languages. Very little current development is done in FORTRAN, everyone is trying to move into Python and C, but is held back by point 1. FORTRAN sticks around because the common fast math libraries are all in fortran as in the first point.

    5. Re:Yes by Spock+the+Baptist · · Score: 1

      "The Weather Model, MM5 [descends] from the early 1970's (Pre FORTRAN 77)."

      Smells like FORTRAN IV.

      Now you've got me waxing nostalgic for my youth...

      Anybody remember FORTH?

      --
      "Oh drat these computers, they're so naughty and so complex, I could pinch them." --Marvin the Martian
    6. Re:Yes by BlowChunx · · Score: 1

      My understanding was that fortran compilers were better at optimizing the code you fed them. Why is this? I guess because fortran lacked pointers, and the compiler knew explicitly that there was only one way to reference it...

      Of course your mileage may vary.

    7. Re:Yes by egeorge · · Score: 1
      Second, most people programming in scientific computing are not ... programmers. They learned FORTRAN and as long as they can get their stuff done in FORTRAN, they're not gonna learn C ...

      I am not a scientist, but I know a few. My observations are that much new scientific programming is done in Perl. It seems to me that Perl has become popular among non-programming scientists for the same reason that FORTRAN became popular 30 years ago: It is easy to get stuff done. I don't think this trend has anything to do with computation speed or available libraries. It is strictly about the ease of use for "pragmatic" users.

      I don't want to endorse or dismiss either language, as I don't regularly use them. However, I have observed (anecdotally) a strong concentration of Perl users among scientists.

    8. Re:Yes by prefect42 · · Score: 1

      As I understood it more *money* went into fortran compilers. Since people were really concerned about speed, compilers could cost an arm and a leg and still get bought. If optimising fortran is so easy, why's gnu f77 such a pile of crap?

      jh

      --

      jh

    9. Re:Yes by joto · · Score: 4, Insightful
      Is there any language Dijkstra actually liked? I quote:

      PL/I, "the fatal disease", belongs more to the problem set than to the solution set.

      The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence.

      APL is a mistake, carried through to perfection. It is the language of the future for programming techniques of the past: it creates a new generation of coding bums.

      It is practically impossible to teach good programming style to students that have had prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

      Well, I think I might have heard somewhere that he actually said something nice about Algol, but I can't find a quote anywhere.

      Anyway, I wouldn't bother too much about what Dijkstra said 10-20 years ago about programming languages long dead. Both FORTRAN, COBOL and PL/1 has clearly proven themselves useful in numerous real-world applications. And contemporary Basic, like Visual Basic shares almost nothing but the name with the kind of BASIC Dijkstra was talking about.

      Of course, being a computer scientist, I certainly agree with him, but even I am not doing what I preach. C++ is certainly a large pile of shit, and C isn't much better. Java could almost make it, if it wasn't already so braindamaged by the C/C++ infection. Perl is certainly an offense to anyones aestethics (if people have that these days). Python could almost have made it if it weren't for the completely braindamaged scoping rules, and various other twarts.

      Well, guess what languages I use at my workplace? Do I violently disagree? No, because these are the languages that actually do the job, they have fine implementations you can trust, they have lots of available libraries for almost any task, and most people already know them, meaning anyone can pick up where the last person left.

      I am not a numeric analyst, so I've never had the use for Fortran, but if that was what I was mostly doing, I would certainly learn it. Learning to speak the lingua franca of numerical analysis will certainly be helpful if that's what you are going to do, even if you don't intend to use it yourself (but you will, trust me - I use C myself for the same reason). And I highly doubt that Fortran 9x is not much nicer than FORTRAN or Fortran 77, numerical people doesn't seem stupid to me, and certainly not as stupid that they would have invented it otherwise.

    10. Re:Yes by xmath · · Score: 0, Offtopic

      >Anybody remember FORTH?

      "Remember" forth? you make it sound like it's a deceased language. Forth is still very much in use actively, and used for new applications. It's mainly popular in embedded systems. (for example, every modern Mac has a complete Forth system inside: Open Firmware)

      May the Forth be with you! :-)

    11. Re:Yes by BlowChunx · · Score: 1

      I wasn't commenting so much on the difficulty/ease of writing compilers (which for me are complete black boxes) as I was on the allure of fortran for scientific computing.

      And some *really* good fortran compilers are free for academic/noncommercial use (see e.g. ifc).

    12. Re:Yes by RackinFrackin · · Score: 1

      I am not a scientist, but I know a few. My observations are that much new scientific programming is done in Perl.

      Perl and FORTRAN are both useful languages for scientists, but they are useful for different tasks. Scientists largely use Perl for the same things everyone else uses Perl for - manipulating text files. A lot of scientific equipment uses RS232 ports to dump data to a computer as an ascii file. They then use Perl to format the data. FORTRAN and the like are used for the heavy-duty number crunching.

    13. Re:Yes by onepoint · · Score: 1

      FORTH, come on that one I still here about, how about Prolog ( bordland or delphi made some compliers for is back in the late 80's or 90's

      Modula-2 or Ada or Logo I have not seen a wisper about in years. from what I recall Logo was to be the teaching lauguage of the future ( back in the mid 80's ), Ada was to be the next big thing is the 80's, and modula-2 was to replace C

      well I guess that never happened

      thank you for the memories

      ONEPOINT

      --
      if you see me, smile and say hello.
    14. Re:Yes by Nutello · · Score: 1
      Well, I think I might have heard somewhere that he actually said something nice about Algol, but I can't find a quote anywhere.
      Erm, he co-designed Algol 60 and wrote its first implementation. He also appreciated Hoare's ideas for Algol W and rejected (like Hoare and Wirth) the monster called Algol 68.
    15. Re:Yes by Carly+Fiorina · · Score: 0
      If optimising fortran is so easy, why's gnu f77 such a pile of crap?

      Because it converts it into RTL in between?

    16. Re:Yes by the+eric+conspiracy · · Score: 4, Informative

      Perl has become popular among non-programming scientists

      I'm a scientist who cut his teeth on FORTRAN, and still use it for a variety of reasons, including the richness an quality of the numeric code available for use with the language, and the most excellent optimizing compilers that can be used.

      Perl has none of that.

      Perl is fine for weeding through a lot of data that has been generated using automated D/A systems, but that is text processing which Perl is very strong at.

      But for computationally intensive tasks, Perl is just wrong.

    17. Re:Yes by Anonymous Coward · · Score: 0
      I'm beginning to wonder if I should invest the time in learning FORTRAN.

      My philosophy is that another language (programming or natural) is always of benefit. It allows one to think about problems in different directions.

      Although it is, arcane it seems to be the best tool when it comes to demanding optimization tasks and heavy computations. C/C++ does not cut it for me - it is simply too easy to make mistakes and I find myself using half of my time hunting bugs unrelated to the problem at hand.

      It is extremely popular for scientific applications. However, many scientific applications are not done by computer people, but chemists, mathematicians, or physicists.

      If you have frequent bugs in your program, that may be a sign of using the wrong tool for the job. It may also be assign of improperly using the correct tool. With such vague references, though, it is hard to determine.

      As to demanding optimization, several libraries are available to help with that. Some are C interfaces (with or without C++ wrappers), but many are heavily optimized. For example, Sun offers several optimized libraries for Fortran or C (http://docs.sun.com/source/806-3568/index.html) or the Performance Library (http://docs.sun.com/db/doc/816-2463). Commercial C++ libraries tend to make a matrix into a class and overload all the operators so that it is easy to work with a matrix in a manner akin to a primitive. Combine this with newer semantics like the restrict keyword and some optimization and significant optimization is possible.

      Additionally, although tools like Matlab exist they don't provide the power that justify the huge price tag they carry. I find any script based language (Matlab, Numeric Python, Scilab) to be inadequate as soon as it is necessary to use loops to describe a problem and using such tools for recursive systems can be a real pain.

      I hate to break this to you, but Fortran77 will not solve some of these problems either. Many Fortran77 compilers add extensions, like REPEAT or WHILE. However, raw Fortran77 has very little loop control, no GUI interfaces, and no real recursion capability. In other words, Matlab (which you claim is a pain) is far more capable of solving your problem than Fortran77 because it has these constructs. Unfortunately, Matlab is single threaded.

      Where Fortran77 wins is its internal matrix operations, relatively high performance numerical optimization capability, and wide number support (INTEGER*8 or the like).

    18. Re:Yes by IdleTime · · Score: 1

      PROLOG... ahhh yes.. Borland Prolog....
      I used to program AI in PROLOG and I loved the Borland compiler.
      Haven't touched PROLOG since early 90's though, thank god.... LOL

      Modula-2 (and 3) is still alive. I did program a debugger in Modula-2 back in the later part of the 80's. Hated it :) Pascal is better, even though it lacks a lot of the features in Modula. My all-time favourite is Turbo-Pascal, great stuff...

      Ada... RIP... Never had to touch any DoD work :)

      --
      If you mod me down, I *will* introduce you to my sister!
    19. Re:Yes by mjprobst · · Score: 3, Insightful

      Keep your eyes on the progression of Python. They haven't fixed all the braindead scoping rules, but there appears to be an underground movement to move them towards something remotely more sane. Lots of work being done on Python between 2.0 and 2.2 . . .

    20. Re:Yes by Rasta+Prefect · · Score: 2
      Anybody remember FORTH

      Actually, FORTH still finds usage in various firmware Applications. I believe(but could very easily be wrong) that its generally used in firmware of most PCI boards...

      --
      Why?
    21. Re:Yes by Anonymous Coward · · Score: 0

      The performance difference between an optimal fortran program and an optimal C program I'd argue is nearly nil. Show me different, and explain why.
      Sure. Check out www.gromacs.org for example. We use code generators for our inner loops, and they can produce exactly the same syntax in either C or Fortran. These are short for-loops, but extremely computationally intensive. Even when you use C99 features like the 'restricted' keyword, the fortran code performs 20-30% better on platforms like IBM Power, SGI, Alpha. g77 isn't any faster than gcc, but that's because people haven't invested mych in g77 development.

      This isn't any law of nature, of course, just as it isn't any law of nature that C is faster than java. The reason for the good Fortran77 performance is that the compilers have had 20 years to mature, and there has only been a single goal for the development: faster code. No good standard library, no fancy I/O stuff, etc. C is a
      much more advanced language, but that also means it is more difficult to optimize the code automatically (though not theoretically impossible).

    22. Re:Yes by Rasta+Prefect · · Score: 2
      I am not a scientist, but I know a few. My observations are that much new scientific programming is done in Perl. It seems to me that Perl has become popular among non-programming scientists for the same reason that FORTRAN became popular 30 years ago: It is easy to get stuff done. I don't think this trend has anything to do with computation speed or available libraries. It is strictly about the ease of use for "pragmatic" users.

      This if course depends on your definition of scientific computing. If you're just sorting data, Perl is an excellent choice - thats exactly what its designed to do. However, you wouldn't exactly want to write large scale flow solver in it...

      --
      Why?
    23. Re:Yes by Anonymous Coward · · Score: 1

      The performance difference between an optimal fortran program and an optimal C program I'd argue is nearly nil. Show me different, and explain why. Go on, try it.

      Pointer aliasing.

      The effort required to generate the "optimal" C/C++ program working with matrices or greater multidimensional arrays is nontrivially higher than the effort needed in FORTRAN.

      Look, I'm not pro-FORTRAN. But credit where credit's due, people. C/C++ compilers worry about things that FORTRAN compilers don't, mostly because of the semantics of multidimensional arrays in each language (one should say the lack of multidimensional array semantics in C/C++). Why do you think Blitz is such a hit? Why do you think so many compilers have all sorts of non-standard ways of letting the user indicate that there's no aliasing on a given pointer in memory (remember noalias? what about those ugly restrict and unlikely_alias hacks?)

      You can make your number-crunching C/C++ code as fast as the FORTRAN folks' code, but it typically requires knowing more about your language tools than the aforementioned FORTRAN programmer worries about.

      So, give them the nod on this one. You've got them beat on any number of other fronts.

    24. Re:Yes by PinkHeadedBug · · Score: 3, Insightful

      (My apologies for the repost... wasn't logged in... argh!)

      The performance difference between an optimal fortran program and an optimal C program I'd argue is nearly nil. Show me different, and explain why. Go on, try it.

      Pointer aliasing.

      The effort required to generate the "optimal" C/C++ program working with matrices or greater multidimensional arrays is nontrivially higher than the effort needed in FORTRAN.

      Look, I'm not pro-FORTRAN. But credit where credit's due, people. C/C++ compilers worry about things that FORTRAN compilers don't, mostly because of the semantics of multidimensional arrays in each language (one should say the lack of multidimensional array semantics in C/C++). Why do you think Blitz is such a hit? Why do you think so many compilers have all sorts of non-standard ways of letting the user indicate that there's no aliasing on a given pointer in memory (remember noalias? what about those ugly restrict and unlikely_alias hacks?)?

      You can make your number-crunching C/C++ code as fast as the FORTRAN folks' code, but it typically requires knowing more about your language tools than the aforementioned FORTRAN programmer worries about.

      So, give them the nod on this one. You've got them beat on any number of other fronts.

    25. Re:Yes by Chexsum · · Score: 1

      FORTH?

      Yeah I started learning that an an Amstrad CPC 464 (8bit). I cant comment about it being good or bad in any way but I definately started learning it. =)

      --
      Pixels keep you awake!
    26. Re:Yes by aebrain · · Score: 2
      Modula-2 or Ada or Logo I have not seen a wisper about in years. from what I recall Logo was to be the teaching language of the future ( back in the mid 80's ), Ada was to be the next big thing is the 80's, and modula-2 was to replace C

      The first language I programmed in was FORTRAN II back in the 60's, when I was under 10. The code had to be run at the Nuclear Research Establishment at Harwell in the UK. Remember, there weren't as many computers around back then, maybe 10 in the country. It made being a pre-teen 31337 haX0r difficult. :-)

      The last time I programmed in FORTRAN - FORTRAN 77 in fact - was for the communications facilities for the State Electricity Commission of Victoria, a system to help restore power in case of emergency. That was in 1987.

      I still use Ada - recently for the spaceflight avionics for a scientific research satellite, and will be teaching a course in it to some people doing the avionics for a helicopter in a couple of weeks. Though the use of Ada has shrunk, it's making a strong comeback in the field of avionics, where a crash in the program could mean the crash of an aircraft.

      My advice to the original poster - by all means learn FORTRAN as a fifth- or sixth- language. Even the 95% Godawful languages(VB..) can teach you something. There are times I use Java and think "why the HECK can't it have feature X of Ada-95?". There are times with Ada-95 that I say "Damn, feature Y is so clumsy compared with Java." FWIW Matlab seems to be the way of the future for non-software engineers to quickly do calculations and display the results graphically, it's a pretty good FORTRAN replacement. What EXCEL is to accountants, Matlab is to scientists.

      --
      Zoe Brain - Rocket Scientist
    27. Re:Yes by The+Grey+Mouser · · Score: 2, Informative
      I'm a scientist who cut his teeth on FORTRAN, and still use it for a variety of reasons, including the richness an quality of the numeric code available for use with the language, and the most excellent optimizing compilers that can be used.

      Perl has none of that.

      Perl is fine for weeding through a lot of data that has been generated using automated D/A systems, but that is text processing which Perl is very strong at.

      But for computationally intensive tasks, Perl is just wrong.

      This may be changing soon. Check out the Perl Data Language, which is designed to allow rapid calculations on large matrices using Perl syntax (and, of course, allowing use of Perl's text manipulation facilities directly). I don't imagine it's as fast as Fortran, most especially if you're using HPF or the like, but it's fast enough for a large array of applications. I'm an astronomer and use it fairly regularly for image analysis, statistical and visualisation tasks. Not yet as mature as IDL, but that seems to be where it's headed.

      Cheers,

      Michael

    28. Re:Yes by Inthewire · · Score: 1

      I believe the FreeBSD CVSup is written in Modula...further research (Link here shows that it is written in Modula-3. Nevermind.

      --


      Writers imply. Readers infer.
    29. Re:Yes by T5 · · Score: 1

      "The Weather Model, MM5 decends from the early 1970's (Pre FORTRAN 77). It's in Fortran. It's large. It would take a hell of a lot of effort to rewrite it, and nobody is going to do it."

      In fact, there is a massive effort underway to do essentially that. Since MM5 and RAMS are so archaic and lack certain critical features for the newer models, a newer model called WRF is being created as a potential replacement for these two older systems. And FORTRAN is the expected language of choice even for this newer atmospheric model.

    30. Re:Yes by Anonymous Coward · · Score: 0

      (Interestingly enough, Dijkstra dies today.)

      Coincidence? I think not! Mwahahahahahahahhhh!

    31. Re:Yes by Anonymous Coward · · Score: 0

      Ever taken a look at PDL, the Perl Data Language? Sorta like Num/SciPy. So if you don't dig Python, but want a scripting scicomp language, give it a look.

    32. Re:Yes by Anonymous Coward · · Score: 0

      Ahhh, yes. I remember taking a class in FORTRAN in college (in 1990, no less.)

      During the course, we learned about other 70's fads, like wide ties, bell bottoms, disco dancing, and snorting cocaine.
      At least when I took it, it was on a UNIX machine, and not the university mainframe that some poor bastards had to use!

    33. Re:Yes by Bush+Pig · · Score: 0

      I'm pretty sure that the reason that g77 isn't any faster than gcc is because g77 is a preprocessor for gcc.

      --
      What a long, strange trip it's been.
    34. Re:Yes by Rasta+Prefect · · Score: 2
      In fact, there is a massive effort underway to do essentially that. Since MM5 and RAMS are so archaic and lack certain critical features for the newer models, a newer model called WRF is being created as a potential replacement for these two older systems. And FORTRAN is the expected language of choice even for this newer atmospheric model.

      Hmmm...I wasn't aware of this. But let my take this opportunity to say thank god. Archaic just begins to cover it...Think they'll do something about the redundant bloody awful output format?

      --
      Why?
    35. Re:Yes by Anonymous Coward · · Score: 0

      > You'll be using MPI to do it anyway, so as long as you have a set of language bindings, you're ok. (Although as far as I can tell these only exist for C and Fortran...)

      I used MPI for Java about a year or two back. It was very much experimental at that point but I got it working on our cluster in less than a day. Just for kicks though since I only tried a few programs on it. Probably not surprisingly, almost identical to the C bindings but slightly simpler.

    36. Re:Yes by Anonymous Coward · · Score: 0

      You're partially right; actually, it's not quite that simple. All the gnu compilers first translate the source to an intermediary symbolic code which is then fed to the common backend. The problem is of course that this disables all the fancy optimizations you can do in Fortran; the IBM, DEC & SGI compilers are much better at going back to the source code to check what you really want a statement to do. I even think IBM offered to contribute some optimization technology to g77 at one point, but the frontend-backend separation made it impossible to implement.

    37. Re:Yes by OsamaBinLogin · · Score: 1

      > At least they got rid of the @#$% Hollerith-punch card column layout...

      oh god and remember those "hollerith constants"? Something like this - to make a sortof quoted string you did this:
      12HHello, World

      I would have put a ! at the end but we didn't have exclaimation points in our character set.

      --
      Marketing-driven companies end up over-marketing their products. Engineering-driven companies end up over-engineering
    38. Re:Yes by Anonymous Coward · · Score: 0

      Come on, how much work do you think goes into gnu f77 compared to gcc? Also, gcc itself, compared to other c compilers, is lousy at optimization. What it is good at is its unbelievable portability.

    39. Re:Yes by NeuroUk · · Score: 1
      >(Interestingly enough, Dijkstra died today.)

      Thats sad - only a cople of years ago (when i worked for BT) I was having a drink with our DBA and some of the other developers and some of our (industrial placements) interns.

      The DBA mentioned that he used to have Dijkstra as a boss at NPL. all the older developers where like "wow thats so cool" but the Ip didn't know who Dijkstra was which was sad.

    40. Re:Yes by the+gnat · · Score: 2

      Part of the point of F90 is that you can multiply arrays with a single command (or operator?). This is then parallelized by the compiler. It's a nifty shortcut, if you need to do this kind of thing a lot- not something that can be done with C/C++. Of course, Matlab can do this too, and for tasks that don't take lots of time it may be better. (I read on comp.lang.fortran that some of the modules for Matlab were equivalent to what you'd get writing optimized assembly. . . pretty cool. and expensive.)

      There may be a few reasons to use F77 for new software, but I'm not aware of any. The problem is that people hang on to it longer than they should. Far too much of the software I use is written in F77, and the flaws in this are exasperating. I hate having to use the same amount of memory whether I'm dealing with peptide fragments or large protein complexes. . . sure, it's fast, but it's a bitch to try to extend.

    41. Re:Yes by Anonymous Coward · · Score: 0

      "FORTRAN: "The infantile disorder", by now nearly twenty years old, is hopelessly inadequate for whatever computer application you have in mind today: it is now too clumsy, too risky, and too expensive to use." (1982).
      "In the good old days physicists repeated each others experiments, just to be sure. Today, they stick to FORTRAN, so that they can share each others programs. And bugs."
      --Edsger Dijkstra

      Fortran isn't a wonderful language, but the
      legacy code written in Fortran is essential in many fields. If you intend to do numerical computing you should learn Fortran if only to be able to compare legacy codes to your new codes based on new algorithms.

      BTW Dijkstra may be a respected computer scientist, but the above quote, if accurate, displays a phenomenal ignorance and arrogance with respect to science. Every scientific innovation must be benchmarked against standard techniques. Many of the Fortran legacy codes provide these standards.

      I suppose that Dijstra's quote is merely more evidence of the observation that any field which has to include the word "science" in its name really isn't a science.

    42. Re:Yes by jovlinger · · Score: 2

      Interesting.

      What's your take on the two level approach: things like NEPL or Python + NumPy?

      The idea being that you write the complicated bits in a high-level language that can be debugged and understood by mortals, and the really hairy parallel bits in a low-level language. The assumption being that the complicated bits tend to take relatively little CPU time, but alot of programmer time.

      The punchline is that the low level bits tend to always be matrix ops, so you just wrap BLAS or some other hyper-optimized code (heh! Fastest FF in the West perhaps) in a suitable foreign function interface and call that directly from the high-level language. So you don't need to write low level code ever...

      This always seemed to me to be the most appealing way to write numerical programs, but since I _never_ need numerical code, what do I know?

    43. Re:Yes by sbaker · · Score: 2

      > Is there any language Dijkstra actually liked?

      In the 1980's, he wrote a lot about a language called SAASL - which is a varient of Lambda Calculus...obscure stuff to be sure.

      He wrote his algorithms in a language of his own invention - for which a compiler did not exist and which is hard even to type because it uses a lot of non-ASCII characters.

      Dunno what he actually programmed in though.

      --
      www.sjbaker.org
    44. Re:Yes by PythonOrRuby · · Score: 2

      If you're interested in PDL, you shoud also be keeping an eye on Perl6 and Parrot, which frm what I've seen look to be incorporating PDL ideas into the base implementation.

  2. Use Fortran 90 by Lally+Singh · · Score: 5, Informative

    Fortran 90 has plenty of structured programming features to make maintainable code. Equally, if not more important, is that Fortran code can be much better optimized than C/C++ code for numerics. IBM did a good job on Fortran, and it's still a major player today.

    --
    Care about electronic freedom? Consider donating to the EFF!
    1. Re:Use Fortran 90 by manobes · · Score: 1

      I'll second that... Fortran 90 is really nice for scientific work, definatly worth learning.

    2. Re:Use Fortran 90 by Anonymous Coward · · Score: 0

      How about learning English 90? I hear it's definitely worth learning.

    3. Re:Use Fortran 90 by rsilva · · Score: 3, Informative

      Yes, I completely agree. I have already posted a message about this in Slashdot foruns where I described some of the Fortran 95 characteristics:

      http://slashdot.org/comments.pl?sid=3041&cid=145 39 90

      Something that changed from that time is that now we have a free compiler for non-commercial use (linux, i386):

      http://www.intel.com/software/products/compilers /f 60l/noncom.htm

    4. Re:Use Fortran 90 by Anonymous Coward · · Score: 0

      Indeed, however, DEC -- er I mean Compaq -- er I mean HP ... oh no actually I mean Intel also has possession of some pretty damn awesome Fortran compilers technology as well.

    5. Re:Use Fortran 90 by rsilva · · Score: 1

      The link for my former comment on fortran 95 is broken. The right link is:


      http://slashdot.org/comments.pl?sid=3041&cid=145 39 90

    6. Re:Use Fortran 90 by ttfkam · · Score: 1, Redundant

      Not true when compared against modern C++ (and its compilers). C's libraries may not be (and may never be due to compiler pointer aliasing issues), but C++'s are. One in particular is Blitz++.

      Not to take away from Fortran. Language in general means far less to performance than an experienced programmer and good algorithms. A good compiler helps too. After that, it's all ones and zeros -- not a language that most humans can understand.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    7. Re:Use Fortran 90 by L0C0loco · · Score: 5, Informative

      Here at NASA we still use fortran (F90) for our processing of satellite remote sensing data. For brute strength and optimized speed it is hard to beat. F90 makes the code easier to work with. I like to use the AbSoft F90 compiler on my linux cluster. There are only a few differences from the DEC (HP - Compaq - whatever) fortran for thier Unix and Digital Fortran for Windoze. Using some good F90 rules adherance tools to keep you from including propriatary extensions smooths the process of assuring portable code.

      If you need to develop number crunching code that has a limited lifetime (disposable code) you might consider RSI's Interactive Data Language. This IDL is wonderful for developing code fast and is very powerful with its built-in graphics. It is also vector/matrix oriented and few loops are really necessary once you get used to the language. Bad part about IDL is the cost unless you can qualify for the student version ($75 last time I checked). Best part is that is comes with an extensive library of high level functions.
      Check it out at http://www.rsinc.com/ .

      Enjoy! Z

      --
      -- Instant Karma's gonna get you! [320848 = 2*2*2*2*11*1823]
    8. Re:Use Fortran 90 by norwoodites · · Score: 2

      The only aliasing issues is because they do not use the allowed aliasing rules from ISO C90.

      In fact in gcc 3.0 and above, the aliasing rules work for c but the aliasing rules are turned off in the c++ front-end of gcc.

    9. Re:Use Fortran 90 by Milalwi · · Score: 2

      Fortran 90 has plenty of structured programming features to make maintainable code. Equally, if not more important, is that Fortran code can be much better optimized than C/C++ code for numerics.
      Agreed on both points.

      We have "ported" a number of programs from F77 to F90 and they are much more maintainable as F90 programs.

      There still are enormous Fortran code bases in the engineering and scientific fields. A vendor of a major (in my field anyway) application program started moving their code base from F77 to F90 a few years ago. That program suit is about 1.2M lines of code.

      Milalwi
    10. Re:Use Fortran 90 by silentbozo · · Score: 1, Troll

      IDL's graphics drawing routines are subpar, performance-wise. Don't use it if you need to optimize for speed...

      It's also has a weird and clunky GUI toolkit. It's great for slapping something together quickly for analyzing and manipulating stuff, but I have reservations about using it as a general purpose tool.

    11. Re:Use Fortran 90 by rower46 · · Score: 1

      This discussion reminds me of just how old I am. I remember when we thought we could do anything with FORTRAN 4.

      Computers also filled up an entire room.

      --
      Don't let what you cannot do interfere with what you can do. - John Robert Wooden
    12. Re:Use Fortran 90 by Audiophyle · · Score: 1

      I second the IDL idea. It has always been very effective, and I owe it to my University for requiring me to learn it, at it's an invaluable tool. It is VERY fast, and the graphics are quite nice.

    13. Re:Use Fortran 90 by the+eric+conspiracy · · Score: 3, Funny

      I remember when we thought we could do anything with FORTRAN 4.

      Well, it is Turing Complete.

    14. Re:Use Fortran 90 by Anonymous Coward · · Score: 0

      So is BrainF*ck

    15. Re:Use Fortran 90 by silentbozo · · Score: 2

      Any IDL programmer who has tried to eke out decent performance out of the TV routine would agree with me... And the fact that only the Windows version has a supported visual toolkit builder is really annoying.

      And what the hell is with drag events not being supported on Macs and PCs? Someone please explain that to me!

    16. Re:Use Fortran 90 by srslif16 · · Score: 2, Interesting

      Yes, use f90. It is much better than f77, and it has many good features, such as the possibility to require certain precision of variables. In a study of performance of f77, f90, C, and C++ on a CRAY T3E, a few years back, there was no performance difference between f77 and f90, C was 10% slower than f77/90, and C++ was 100% slower. Of course, the C++ compilers have become better, but so have the fortran compilers. For scientific computations, fortran is still alive, and prodding buttock galore.

    17. Re:Use Fortran 90 by vu2lid · · Score: 1

      Ture, FORTRAN has features suitable for use by scientific/engineering/mathematics community. There is a HUGE base of proven/reliable libraries, modules, packages, ...available as FORTRAN source (often free ...) Due to these often there is no reason at all for coding in something othern than FORTRAN for numerical/mathematical/engineering computation.

      There are examples of using FORTRAN for non-scientific use also.I have heard that the ticket reservation program used by Indian Railways (they have reservation terminals distributed all over india) was implenented using FORTRAN (may be during 1970s/early 80s) because it was the fastest option available at that time.

    18. Re:Use Fortran 90 by ebbe11 · · Score: 3, Funny
      there was no performance difference between f77 and f90, C was 10% slower than f77/90, and C++ was 100% slower.

      100% slower? That means it didn't run at all!

      What you probaly meant was that Fortran was 100% faster than C++.

      --

      My opinion? See above.
    19. Re:Use Fortran 90 by staplin · · Score: 1

      Even in 1996, I took a programming class in FORTRAN from a prof who believed that FORTRAN 77 was too "newfangled" to trust...

    20. Re:Use Fortran 90 by Van+Halen · · Score: 1

      Have you tried using IDL's Object Graphics? It uses OpenGL directly and the performance is excellent with any decent graphics hardware. We use it on SGIs, Suns, and PCs with mediocre to good graphics cards and all perform very well. We've built a very sophisticated satellite data analysis tool in IDL, complete with full GUI and all object graphics. With its ease of development and powerful analysis/display capabilities, I wouldn't dream of using anything else.

    21. Re:Use Fortran 90 by Anonymous Coward · · Score: 0
      Here at NASA

      What?!? You're spending my tax dollars reading and posting to slashdot?!?!?

      Get Back To Work!

    22. Re:Use Fortran 90 by Anonymous Coward · · Score: 0

      Digital Fortran for Windoze

      Dude, if you use "Windoze" instead of "Windows", you should get fired. I don't want a zealot to crash the shuttle on my house.

    23. Re:Use Fortran 90 by silentbozo · · Score: 2

      Hmmm... Right now all of our existing code uses Direct Graphics - most of it originated with IDL 4x. I've looked into using Object Graphics, but it's a whole new kettle of fish to learn and implement consistently alongside of the current code (there are a couple of guys who are still into using common blocks), so I was planning to put it off.

      However, if Object Graphics really is that slick, maybe I should look into recoding our display interfaces. Will OpenGL acceleration work for TVing bitmapped images? I had gotten the impression from the docs that it only sped stuff up if you had 3D data...

    24. Re:Use Fortran 90 by Van+Halen · · Score: 1
      (just saw your reply, hope you see this a few days later...)

      Will OpenGL acceleration work for TVing bitmapped images?

      Sure, I actually do this to display maps of satellite data. The 2D image can be texture-mapped to a flat rectangular polygon in 3D space. What I do is set_plot to the internal z buffer and tv the image to that. Then tvrd() it and send the resulting image to the contents of an IDLgrImage object. If you're not doing anything between the tv and the tvrd, you can probably skip those steps and just send the bitmap to the image object.

      The biggest problem with Object Graphics, especially if you're used to Direct Graphics, is the steep learning curve. It's very different and generally requires more "setup" in your code, but once you have a scene defined, you can take advantage of OpenGL performance to manipulate it They have builtin plot objects, contour objects, etc. And if you have something that can't be done with their builtin objects, you can always use the technique above to render Direct Graphics stuff internally and display it using Object Graphics.

      Anyway I hope that was helpful (if not completely offtopic to the story).

  3. NO by Anonymous Coward · · Score: 0

    IT IS NOT

  4. Too easy to make mistakes? by Tyball · · Score: 0, Flamebait

    Learn C/C++ better. Stupid mistakes are not an inherent property of C.

    1. Re:Too easy to make mistakes? by joeljkp · · Score: 1

      Although C/C++ is truly slower when it comes to heavy number-crunching. FORTRAN is a better option for number-crunching applications.

      --
      WeRelate.org - wiki-based genealogy
    2. Re:Too easy to make mistakes? by Anonymous Coward · · Score: 0

      > Learn C/C++ better. Stupid mistakes are not an
      > inherent property of C

      Yes, they are. C and C++ go out of their way to make memory leaks and buffer overruns easy.

    3. Re:Too easy to make mistakes? by Anonymous Coward · · Score: 0

      "Sarcasm" Look it up, you might learn something.

  5. FORTRAN lives by evilpenguin · · Score: 2

    Yes, FORTRAN is still alive, and many important scientific applications are still written in it and maintained in it.

    Alas, for the rest of the question, I'm not a mathematician/number cruncher. The only floating point numbers I deal with are currency...

    1. Re:FORTRAN lives by zer0vector · · Score: 1

      As an example, AIPS, a program many radio astronomers are intimately familiar with, was written ~1980 for reduction of interferometer data. It has been continually supported and maintained since then, and there appears to be no planned end to its use.

      --

      ----
      Striving to put right what once went wrong, and hoping each time that his next leap, will be the leap ho
    2. Re:FORTRAN lives by catfood · · Score: 2

      Mod parent +1 funny?

      You really, really don't want to use floating point for currency values. Eventually the logarithmic nature of floating point data formats will cause your calculations to be just a penny or two off.

      Much better to use a BCDish class or dedicated decimal type, depending on your programming language. Worst case, do all your calculations in the smallest unit possible, e.g. cents in the US.

    3. Re:FORTRAN lives by charon_on_acheron · · Score: 1

      If you are doing interest calculations, you have to use something a lot smaller than cents. My credit card multiplies my daily balance by ~0.032876% (approximation, don't have my statement handy), which is the 12% APR divided by the 365 days in a year.

      Maybe you could use a fixed decimal notation, but it has to have a lot of extra space for those thousandths of a cent that make up the interest.

    4. Re:FORTRAN lives by Anonymous Coward · · Score: 0

      Yes, I just finished my PhD in HE Physics 3 years ago and all of our work was in FORTRAN.

    5. Re:FORTRAN lives by evilpenguin · · Score: 1, Troll

      Just because I said "floating point" doesn't mean I use IEEE floating point formats. I'm using BCD. Not that it matters. You can most certainly keep all floting point noise below your precision, even when using IEEE floating point numbers. The problem comes up only when poor programmers who are unaware of rounding error perform iterative calculations without accomodating the imprecision. It is certainly NOT wrong to use floating point for financials. You just have to know what you are doing. In this sense, it is like all other programming. Ignorance makes errors.

      If you wish to use only those programming tools which do not permit the programmer to produce an error, you will never write a line of code. Guess what? You can get it wrong using only integers. Perhaps we should do all calculation on paper with pencils? Wait, do you mean you can have errors there too? I guess we should simply never do arithmetic. We should just use random numbers. That will at least produce errors that are statistically equal on either side of correct. Yes, based on your view, that would be the best solution.

      Grow up, get real (pun intended).

    6. Re:FORTRAN lives by catfood · · Score: 2

      You are cool, I don't care what everyone else says about you.

      But why not just use the best tool for the job? At least when you're not out to impress people?

      You can use floats and have to work around their limitations, or you could use BCDish math as it was intended to work.

      Or are we in violent agreement?

    7. Re:FORTRAN lives by TWR · · Score: 2
      You better use a fixed decimal notation for interest calculations, or you are going to end up with highly pissed off customers. Floating point math is too inaccurate to use for financial calculations.

      -jon

      --

      Remember Amalek.

    8. Re:FORTRAN lives by charon_on_acheron · · Score: 1

      Thanks.
      I don't write code personally, just dabbled a bit. It just seemed like floating point was made for interest calculations. But I will accept your word on it.

      Just, as I said, make sure there are enough places in the fixed decimal for thousandths of a cent, or smaller units.

    9. Re:FORTRAN lives by evilpenguin · · Score: 2

      I think we are in violent agreement. Except for your claim that it is "funny" to use floating point for currency. There's no reason (except speed) not to. You have to do it right. You also have to do it right if you use integers. BCD is my choice (read my earlier reply) because it strikes a nice balance between performance and convenience.

      Your original post seemed to assert that one would be foolish to use floating point. I think that was wrong. That said, I think you were absolutely right about what works better and why.

      Oh, and your also wrong about aomething else. Everyone else does think I'm cool. Overwieght 35 year olds who program for a living are the the stuff of all of next year's Hollywood thrillers... ;-)

    10. Re:FORTRAN lives by dvdeug · · Score: 2

      You can most certainly keep all floting point noise below your precision, even when using IEEE floating point numbers.

      Maybe. But if you're doing a job that by law _must_ be done to a certain precision, it's wiser to use tools that are designed to that precision, rather than one's that were designed to lose that precision for other concerns. If you use integers or BCD, that's one less source of error you have to worry about.

    11. Re:FORTRAN lives by TWR · · Score: 2
      This actually happened to a company I worked for. A wretched programmer built this application that calculated costs using floating point. Even though values were tiny, errors in the cents column started appearing. Our client heard about it from one of their customers (unhappy that they were being overcharged), and we heard about it from our unhappy client. Needless to say, crappy programmer guy had long since quit and the problem was left for someone else to fix.

      This was a Java program, back in the days when JDK 1.1 (with its BigDecimal class) were cutting edge and not entirely to be trusted, so we had to write our own fixed place class or licence one from someone else (I forget which we did).

      -jon

      --

      Remember Amalek.

    12. Re:FORTRAN lives by Anonymous Coward · · Score: 0
      You can most certainly keep all floting point noise below your precision, even when using IEEE floating point numbers.

      But it isn't noise, it's the fact that some numbers simply CANNOT be represented in a real. I'm sure that one can work around this by scaling, but if you really thought that was a good idea, you wouldn't be using BCD.

    13. Re:FORTRAN lives by Anonymous Coward · · Score: 0

      I just thought you were a tard, myself. Now I know you're a tard, fat, and middle aged! Thanks for the information, llama.

    14. Re:FORTRAN lives by evilpenguin · · Score: 2

      Those numbers also cannot be represented in BCD or in integers. By definition, any irrational number cannot be perfectly represented by a finite number of bits. BCD is great for currency because you are only interested in one more decimal place than you display, and this number of places is always the same. You don't get the rounding error you get with mantissa/exponent representations.

      I never ever claimed using floating point was the best idea, merely that it wasn't an inherently bad idea. Not sure how that makes me a troll (as my first response was modded).

      Depending on the processor and library, there can be distinct advantages to using floating point, like overflow and underflow exceptions, support for infinities and not-a-number values, and so on.

      I also specifically disclaimed special knowledge of this area in my original post, where I specifically stated that my work has me working mostly with OPM, not with scientific and engineering applications.

      The post that suggested my post whould be modded "+1, Funny" seemed to be asserting (and the link he offered also supported this) that it was unreasonable to use floating point in currency applications. It might not be the best design decision, but it is certainly not unreasonable. That was my sole and entire point.

    15. Re:FORTRAN lives by dvdeug · · Score: 3, Informative

      I never ever claimed using floating point was the best idea, merely that it wasn't an inherently bad idea.

      But it is an inherently bad idea. You're better off using strings, for crying out loud. You don't need the sin, sqrt, 1E-100 stuff that floating point offers you. You do need exactness to the cent, no matter how large the numbers are - something floating point doesn't offer you.

      Depending on the processor and library, there can be distinct advantages to using floating point, like overflow and underflow exceptions, support for infinities and not-a-number values, and so on.

      Which are worthless. You don't want infinity or not-a-number - you want it to raise an exception where you screwed up, which integer types in better languages do. You don't want an underflow exception - you want it silently round to zero. And you can get overflow exceptions on integers just as easy as on floats.

    16. Re:FORTRAN lives by evilpenguin · · Score: 2

      We are merely disagreeing by degrees. Can we move on?

    17. Re:FORTRAN lives by markmoss · · Score: 2

      You better use a fixed decimal notation for interest calculations, or you are going to end up with highly pissed off customers. The issue isn't accuracy - double-precision floating point is probably more accurate than the fixed-point decimal calculations most accountants use. But binary floating point results are going to be slightly _different_, and they'll probably even be different from machine to machine. Accountants generally feel that they have to account for even trivially tiny discrepancies - so whenever you throw away the lowest digits at all, it's important to be inaccurate in the exact same way every time.

  6. A beauty all its own by Yoda2 · · Score: 2
    FORTRAN was one of the first languages that I learned and although I don't use it much now it still has a special place in my heart. I always found its simplicity and structure sort of comforting.

    I'm a Java convert now thought.

    1. Re:A beauty all its own by Yoda2 · · Score: 1

      Damn you extra "t"! Damn you!!!!

    2. Re:A beauty all its own by Anonymous Coward · · Score: 1, Funny

      You know, it is truly insightful answers like the above that make "Ask Slashdot" the wonder that it truly is:

      Submitter: Slashdot, I am wondering - is it worth it to learn X?

      Poster: I used to use X, and I found it truly comforting. I'm a Y convert now, though!

      +5 Informative, baby!!!

    3. Re:A beauty all its own by jazman_777 · · Score: 3, Funny
      FORTRAN was one of the first languages that I learned and although I don't use it much now it still has a special place in my heart. I always found its simplicity and structure sort of comforting.

      I always liked how I could define variables on the fly anywhere in the code. Really catered to my total lack of organization and self-discipline. I can do that in Perl, now, too!

      --
      Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
    4. Re:A beauty all its own by xtremex · · Score: 1

      I always liked how I could define variables on the fly anywhere in the code. Really catered to my total lack of organization and self-discipline. I can do that in Perl, now, too!
      A man after my own heart! I'm ADD man, so the "forced" structure of Java makes me whacky :)

      --
      If you're not a Liberal in your 20's, then you have no heart.If you're still a Liberal in your 30's you have no brain.
  7. NOAA by OpenSourceRulez · · Score: 4, Insightful

    As a recent CS grad I had to help some of my friends in the Meteorology department with their programming course(of course not taught by a CS prof). To my surprise it was FOTRAN. It seems a lot of the stuff NOAA and other government agenicies program is in FORTRAN so it is compatible with the stuff they stil use from the 70's and 80's.

    --
    "Success is not the result of spontaneous combustion. You must first set yourself on fire." -- Fred Shero
    1. Re:NOAA by GuidoDEV · · Score: 5, Informative

      Speaking of meteorological programming, ALL the major atmospheric models are written in FORTRAN. The ETA, AVN, NGM, MM5, WRF, and scores of lesser-known models...all of them written in FORTRAN (most of them FORTRAN-90 now, but some of the older ones are FORTRAN-77). The MM5 & WRF may be found here and here. The source code to several others is readily available as well if you're so inclined, for instance the ETA and the ARPS. Anyone wanting to run them may do so fairly easily on a PC running Linux (any new PC will be able to run a fairly hi-res model real-time); I do so myself.

    2. Re:NOAA by Anonymous Coward · · Score: 0

      Every atmospheric model is written in FORTRAN. ETA NGM MRF run by NCEP all use FORTRAN even new models such as the WRF and updated MM5 are written it also. Most of the models were all written during the 60's & 70's and have all been kept in their native FORTRAN till this day. I haven't heard anything about a new language as good as FORTRAN in intensive mathematics as of yet but maybe someday, but why fix something that isn't broke.

    3. Re:NOAA by Jandar0 · · Score: 3, Informative

      Well, I can't speak for other agencies, but here at NASA Glenn Fortran is very much alive. A huge amount of the thermodynamic cycle/turbomachinery analysis that gets done around here is done using legacy Fortran code. Though they are no longer developing new codes in Fortran (at least in my office), it still lives. Rather than rewriting Fortran code, the effort (mine anyways) currently goes into writing generic GUIs for Windows to interface with those programs.

    4. Re:NOAA by GuidoDEV · · Score: 2, Interesting

      > Most of the models were all written during the 60's & 70's...

      Not true, most atmospheric models have been written since 1980, although some of them were an extension of earlier models written in the 60s/70s. The earliest models were written in the mid-60s, and development on them didn't really take off until the mid-late 70s and early 80s, when models began to be introduced in rapid succession. Even today many models are currently being developed anew (the WRF and ARPS, for instance, neither of which existed prior to the 90s--in fact, the 1.0 release of the WRF was in Fall 2000), and new ones are announced quite frequently. They are still all written in FORTRAN, however, as FORTRAN is the standard for large-scale scientific computing.

    5. Re:NOAA by dargaud · · Score: 1
      Yup, that's my job...

      And I hate debugging those long stretches of spaghetti code written 30 years ago by people without a clue about programming. And modified 25 times since. Without a single comment.

      Some time ago I found a big bug that when removed increased the rain in some satellite data by 30% ! Guess how it was handled ? "Put it back in !"

      "The evolution of languages: FORTRAN is a non-typed language. C is a weakly typed language. Ada is a strongly typed language. C++ is a strongly hyped language." - Ron Sercely.
      "You can tell how far we have to go, when FORTRAN is the language of supercomputers." - Steven Feiner.
      "FORTRAN was the language of choice for the same reason that three-legged races are popular." - Ken Thompson, "Reflections on Trusting Trust"
      "In the good old days physicists repeated each other's experiments, just to be sure. Today they stick to FORTRAN, so that they can share each other's programs, bugs included." - E.W. Dijkstra.
      "Consistently separating words by spaces became a general custom about the tenth century A.D., and lasted until about 1957, when FORTRAN abandoned the practice." - Sun FORTRAN Reference Manual .
      "FORTRAN is not a flower but a weed - it is hardy, occasionally blooms, and grows in every computer." - A.J. Perlis.
      --
      Non-Linux Penguins ?
    6. Re:NOAA by GuidoDEV · · Score: 1

      > Some time ago I found a big bug that when removed increased the rain in some satellite data by 30% ! Guess how it was handled ? "Put it back in !"

      Yeah, some of the older models especially are terribly maintained and full of all kind of cruft and crap. I could be wrong, but I imagine the reason you were told to put the 30% bug back in is because that's the way the model has been for eons, and the forecasters that use the model likely know its biases in a qualitative sense. Also, if they're attempting to do any sort of long-term statistical analyses using the model, altering it in such a way would render those analyses useless, whereas leaving the bug in means that the comparisons can still be made, since they are all biased one way or another. Thus removing the bug, though obviously the correct thing to do from a programming standpoint, might actually cause more trouble and confusion than it's worth, especially if the model is to be retired soon.

    7. Re:NOAA by Nehemiah+S. · · Score: 1

      Out of curiousity, what do you use for your generic GUI's? I'm doing an interface to a suite of old hypersonics codes written in Fortran IV and am looking for ideas.

      --
      ... and there is no doubt, that one day he will be
      where the eye of his telescope has already been
    8. Re:NOAA by Jandar0 · · Score: 1

      I am sure that an interface for a specific suite of codes could be more complex, but the GUI I am talking about it basically nothing more than a namelist editor. All of the codes that I'm refering to use namelist input, and a configuration file is written for each code, specifying variables, their type, max, min, default, and a description of the variable. The namelist editor (NLEdit) simply uses this configuration file to create a list of variables, including descriptions, along with other useful features. It tests the limits specified in the config file, has an array editor, and some basic plotting capabilities.

    9. Re:NOAA by sloveless · · Score: 1

      As a geology student at UMR in the early 90s, I was required to learn FORTRAN. As far as I know, it was a required course for all science students at the time. According to their current catalog, it's still a requirement. It was actually a very useful tool in my field at that time. I don't see why it wouldn't be useful today. And I can definitely understand it's application in weather sciences. I've changed fields since then, and haven't had a need for it in several years. Should a need develop, though, I wouldn't hesitate to put it to use again.

    10. Re:NOAA by Anonymous Coward · · Score: 0

      Now to blanket all of NOAA as to using Fortran for it's model analyisis is correct.... To say all off NOAA uses Fortran to use model data is different...

      I work for the weather service, and we get all of our model data, pre-processed in the form of GRIB data...

      So yes, to state that the computations used to calculate the models is done in fortran is true, but thats not where the processing stops...

      We then take that grib data, and in ANSI C code (or as close as we can) convert the data to netcdf so we can then display the data one variable at a time, overlaying it...

      Now this practice is on the way out with the new AWIPS system, there are still 'decoders' built in to all the weather service offices, that process many datatypes, GRIB, SHEF, METAR, etc, and most of these are written in C...

      We are making progress, just albeit slowly... Hey we are government workers, and to do it all in a couple years is alot to ask in between coffee breaks!

    11. Re:NOAA by Anonymous Coward · · Score: 0
      Well, I can't speak for other agencies, but here at NASA

      What is it with you NASA people and slashdot?!? You are the second employee I've seen here waisting my tax money on this pseudo-intellectual 'blog'!!!

      Get Back To Work!

    12. Re:NOAA by GuidoDEV · · Score: 1

      True, I was referring only to the models themselves. Post-processing, though CPU-intensive, pales in comparison to actually running the model. Thus the post-processing software is not written in fortran. BTW, any idea when they're going to finish porting AWIPS to Linux?

  8. Try Common Lisp by Javamonkey · · Score: 1

    I'm not a true lisp hacker but from lurking on comp.lang.lisp I believe that the lisp guys belive that a good Common Lisp implementation can get pretty kickin' numeric performance. Of course you have to put in various declarations to allow the compiler to generate efficient code. But if you do that, it's supposed to be pretty good. And the advantage is you can build up your program without the declarations, get it working and then optimize by adding them in. Or that's the theory. Also these things vary from implementation to implementation--some are more tuned toward numeric style computation than others.

    1. Re:Try Common Lisp by ultima · · Score: 3, Informative

      Common Lisp is a very high level language with a tremendous amount of expressiveness, and it is suited towards academia in that in general, functionality is not sacrificed for performance.

      Check out http://www.lisp.org, http://cmucl.cons.org/cmucl for a really good implementation (and there are even Debian packages of it).

      CL is not known for its parallelization abilities, but if you need a language that lets you describe mathematics, CL is useful.

      Lisp is actually based around something called the Lambda Calculus, which is a way of expressing concepts by transforming data into other data using data which is expressed as a "function". Because of this, Lisp has a lot of abilities that other languages lack, such as extremely simple and powerful function composition, even at run-time. CL also has a massive core library with OO facilities, basic mathematic primitives, good FFT suppot in most implementations, windowing system support, and good commercial vendors like Franz. Check it out; it's almost as old as Fortran, but has evolved in a much more elegant manner.

    2. Re:Try Common Lisp by bowronch · · Score: 2, Insightful

      I'm a big fan of Lisp... The ability to declare as much or as little as you want about your data types is very nice... And it has the greatest macros of any language I've ever used... Once you get used to the Lisp macro functionality, you will cry when the most you can do is a #define in C...

      When programming in Fortran or C its important to remember Greenspun's Tenth Rule of Programming: "Any sufficient complicated C or Fortran program contains an ad-hoc, informally specified, bug-ridden, slow implementation of half of Common Lisp"

      --
      My Stuff: pspChess and foobar2000 plugins
    3. Re:Try Common Lisp by Anonymous Coward · · Score: 0

      What about Scheme?

      You left out Scheme!

    4. Re:Try Common Lisp by badoingdoing · · Score: 1

      The problem with using CL for heavy computing tasks is that Lisp is a linklist-based language. Linklists are very elegant to the programmer, yet they are extremely time-inefficient. A FORTRAN compiler makes good use of the fact that, in integer_4 array foo, foo(bar) is exactly 4 bytes away from foo(bar+1).

      --
      sgi? gis? gsi? sig.
    5. Re:Try Common Lisp by ultima · · Score: 1

      The problem with using CL for heavy computing tasks is that Lisp is a linklist-based language. Linklists are very elegant to the programmer, yet they are extremely time-inefficient. A FORTRAN compiler makes good use of the fact that, in integer_4 array foo, foo(bar) is exactly 4 bytes away from foo(bar+1).

      Common Lisp code is list-based, and these lists are compiled into regular assembly code by any good compiler, much like C or Fortran. In addition, Lisp makes using linked lists as data structures very easy -- and modern compilers do an excellent job of optimizing them. However, Common Lisp also supports simple and complex arrays, data structures, and objects -- none of which are generally implemented using linked lists, and all of which tend to be rather efficient. In fact, any good Lisp textbook will tell you that code which relies on non-fix-lengthed lists (fix-lengthed lists can be implemented using arrays) is going to be inefficient, and is hopelessly unoptimal.

      Your argument might have been true 20+ years ago, but is no longer valid. Compiler technology has come very far. Note for example, that there exists floating-point example code for cmucl which is faster than equivalent C code, compiled with gcc.

    6. Re:Try Common Lisp by alispguru · · Score: 3, Informative
      The problem with using CL for heavy computing tasks is that Lisp is a linklist-based language.

      Just curious, does all your knowledge about programming languages date from 1975, or just your prejudices about Lisp? Lisp has had arrays since about then, those arrays have the same O(1) access time as anyone else's arrays, and the performance of code using them is tuneable to FORTRAN speed or better. Whoever taught your "survey of programming languages" course did you a real disservice - maybe you should get them brought up on educational malpractice charges.

      That said, FORTRAN can probabaly outrun Lisp on supercomputers, because of the effort put into parallel and vector optimizations on those platforms. I love Lisp, it's my preferred hacking environment, but I wouldn't propose it as the language of choice for big numerical applications unless there was a chance that hairy data structures might improve performance.
      --

      To a Lisp hacker, XML is S-expressions in drag.
    7. Re:Try Common Lisp by jaoswald · · Score: 5, Interesting

      A caveat about Common Lisp:

      it has a lot of good things that are similar to Fortran in the numerical world.

      * Integers are not a fixed width, but transparently go to multiple precision instead of wrapping around.

      * All of the intrinsics deal with complex numbers transparently.

      * True rational numbers: i.e. ratios of integers.

      * (Better than Fortran): STANDARDIZED parameters to describe the floating point parameters of the machine (e.g. machine epsilon). Also, built-in, portable access to the floating-point encoding in bit form. Very nice bit-bashing intrinsics (I like them better than C).

      * Very flexible arrays. Some nice intrinsics (row-major-aref ...) that allow you to write code to traverse arrays in very convenient ways.

      * Notation is pretty flexible: can add multiple numbers together using (+ a b c d e f g).

      * Lisp macros are amazing. The whole power of the Lisp language is available as a "preprocessor." You can relatively easily write programs that write programs that write programs. As an example, although Lisp has built-in, kick-ass OO (CLOS), you could write your own transparent object-oriented extension to Lisp (i.e., roughly equivalent to what cfront did for C) in about 200 lines of Lisp macros, and it works as well as if it were built-in.

      Some slight "disadvantages"

      * Prefix notation is the default. Add-on macro packages let you also write code that is infix

      (e.g. #I instead (+ (expt a 2) (expt b 2) (expt c 2)))

      but it is not a built-in standard.

      * The standard does not *mandate* the ability to specify extremely large arrays. Not necessarily a real problem unless you want > 1 GB arrays on a typical 32-bit implementation.

      * The notation is sort of verbose. Array references go like (aref array-variable i j k l). This is just notation, so the compiler should optimize this if you ask for it.

      * Variables are not typed. The way around this is declarations. Again, the notation is somewhat verbose. (the double-float (+ (the double-float x) (the double-float y)) or (declare (double-float x y) (+ x y)). Again, this is just notation, so you can "easily" write lisp macros to write either of these as something like (d+ x y)

      * Most high-performance computers have high-quality Fortran compilers. Fewer have high-quality architecture-specific Lisp compilers. Likewise for highly-multiprocessor machines.

      * Most importantly, the bias in the Lisp world has been to optimize things like OO method calls, function calls, recursive function calls, automatic garbage collection. Not much pressure to optimize number-cruching on large arrays. Fortran compiler writers for the last 40 years have been asked to do one thing: optimize number-crunching on large arrays.

      That said, for certain numerical codes, Lisp is a nicer tool than Fortran. For some other numerical codes, a good Lisp compiler (which might not be available for your architecture) given code with sufficient declarations could match a Fortran compiler for code speed, no more than 10% performance loss, sometimes performance gain. For some codes, Fortran is going to win big in execution time.

    8. Re:Try Common Lisp by badoingdoing · · Score: 1

      mea culpa.

      I actually like programming in Lisp--but some of what i "know" comes from old texts. Or perhaps I simply mistook the text's functional explanation for an explanation of implementation.

      --
      sgi? gis? gsi? sig.
    9. Re:Try Common Lisp by jaoswald · · Score: 1

      Oops, the infix example got eaten by Slashdot.

      Just imagine the #I followed by an equivalent infix expression; i.e., that looks like Fortran!

    10. Re:Try Common Lisp by kyras · · Score: 1

      Another disadvantage: It's parenthesis hell. CLISP gives me a headache if I ever try to read it for more than a few minutes.

      --
      Tastes like burning! - Ralph Wiggum
    11. Re:Try Common Lisp by alispguru · · Score: 2

      I apologize for my tone, but this kind of misinformation is understandably a sore point with Lisp people. Paul Graham's On Lisp is a great book for explaining modern Lisp style, as well as dispelling Lisp myths. The dead trees version is out-of-print, but the ps/pdf versions are available for download. Also check out his Articles page.

      --

      To a Lisp hacker, XML is S-expressions in drag.
    12. Re:Try Common Lisp by voodoo1man · · Score: 1

      Well, since the poster considered Matlab, Maxima is a Common Lisp, free-software (GPL) algebra system. It has a 2d and 3d graphing system, and is a descendant of DOE Macsyma, which, if my history is right, is the original codebase for the commercial Macsyma symbolic algebra system, which was the precursor to Mathematica and other symbolic math software.

      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

    13. Re:Try Common Lisp by Anonymous Coward · · Score: 0

      1) Emacs
      2) Expression Highlighting

      No more headache. :)

  9. of course it's still kicking by krog · · Score: 2

    my dad is a physicist. he, and every colleague of his who writes code, writes it in Fortran.

    part of it is that there's 40 years of perfectly good legacy code to keep using. but mostly it's that C's numerical libraries still, after all this time, aren't as fast as a good Fortran's.

    1. Re:of course it's still kicking by ttfkam · · Score: 3, Informative

      C's libraries may not be (and may never be due to compiler pointer aliasing issues), but C++'s are. One in particular is Blitz++.

      Not to take away from Fortran. Language in general means far less to performance than an experienced programmer and good algorithms.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    2. Re:of course it's still kicking by brer_rabbit · · Score: 2
      part of it is that there's 40 years of perfectly good legacy code to keep using. but mostly it's that C's numerical libraries still, after all this time, aren't as fast as a good Fortran's.

      I used to accept this as a good argument but I'm starting to question it. C has been around long enough that it's math libraries shouldn't be lacking. What's wrong? Why haven't the C libraries caught up to speed? Are you talking about proprietary libraries or the basic libm.so?

    3. Re:of course it's still kicking by dvdeug · · Score: 2

      C has been around long enough that it's math libraries shouldn't be lacking. What's wrong? Why haven't the C libraries caught up to speed? Are you talking about proprietary libraries or the basic libm.so?

      We're not talking about sin, cos and the other stuff from the C library. We're talking about vector calculations and the like. The reason why Fortran's libraries are better are several fold. First, Fortran's still older; the stable Fortran 77 standard predates the stable C89 standard by ten years. Secondly, all the physicists and engineers are trained only in Fortran, so that's what they use, and when people need to speed up numeric code, that's what they optimize.

      Lastly, the Fortran standard dictates that any two arrays passed to a function do not alias - if they do, it's a error in the program. Since C compilers can't make that assumption, there's points where a Fortran compiler can rearrange actions for greater speed that a C compiler can't.

    4. Re:of course it's still kicking by Anonymous Coward · · Score: 0

      My dad can outcode your dad!

    5. Re:of course it's still kicking by jaoswald · · Score: 3, Informative

      There are some fundamental weaknesses in the C language that make it less-than-optimal for writing numerical codes.

      1) C arrays are nothing more than pointers in drag. "Aliasing" of multiple pointers pointing into the same region of memory can cause optimizations to introduce bugs. Because all array accesses are done as if by pointer arithmetic, it is hard to deal with multi-dimensional arrays where more than one dimension can vary (think rectangular MxN matrices). There is a bias in the language toward manual pointer movement (*p++, etc.) to efficiently stride through arrays.

      2) C always "wants" to compute with doubles. (E.g. the usual trig libraries all return doubles, and the default function call rules cast float arguments to doubles.) Serious number crunching code may want to use single precision floats to conserve memory and, more importantly these days, cache and memory bandwidth.

      3) No built-in exponentiation operator. (Important so that the compiler can optimize small integer powers as combinations of multiplications.) No built-in, transparent complex number support. E.g. trig functions with complex arguments.

    6. Re:of course it's still kicking by L0C0loco · · Score: 1

      I do not think we are talking math libraries, but rather the extensive set of legacy code that exists in the sciences. I am certain that a lot of this is due to the way some of the sciences are taught at the graduate level and the fact that it is easy to build on the work of others if you do not have to recreate/test/validate algorithms that work but are just not implemented in your favorite language. Programs like 3-D GCMs take many years (decades) to develop and you can't just port them over to a new language without a serious investment in time. Usually that is the time of some student. They won't be there forever and are better off learning something new or making improvments to the project. As a result, things never get ported, students learn fortran, and jobs still exist for those with the right skills.

      Enjoy! Z

      --
      -- Instant Karma's gonna get you! [320848 = 2*2*2*2*11*1823]
    7. Re:of course it's still kicking by norwoodites · · Score: 2

      It is not because of c pointer aliasing issues, it is because nothing in c was allowed to be inline, this is all mute with C99. The keyword inline works in gcc 3.0 and above.

    8. Re:of course it's still kicking by Anonymous Coward · · Score: 0

      > First, Fortran's still older; the stable Fortran 77 standard predates the stable C89 standard by ten years.

      Did you calculate that in Fortran?

      I tried it in C and got 12.

      I guess Fortran is for "undiscerning dabblers in mathematics"?

    9. Re:of course it's still kicking by brer_rabbit · · Score: 2

      I can accept those as valid reasons. The original poster said C's numerical libraries weren't as fast as Fortrains. To me this implies the C libraries themselves could be coded better. But as you explain, it's language design / compiler constraints that differentiate the two.

    10. Re:of course it's still kicking by Alrescha · · Score: 1, Redundant

      "It is not because of c pointer aliasing issues, it is because nothing in c was allowed to be inline, this is all mute with C99."

      Umn, that would be 'moot', methinks.

      A.

      --
      ...bringing you cynical quips since 1998
    11. Re:of course it's still kicking by Old+Wolf · · Score: 1

      That's because doubles are the same size as ints, and CPUs process the fastest when using their int size.

      You could save memory as you say by casting them to floats as you go. Or if you were really serious about only using floats, you could write a new library for float arithmetic and then use that. Can you do that in FORTRAN?

    12. Re:of course it's still kicking by stux · · Score: 2

      that is soooo not true.

      Doubles are only the same size as ints when ints are the same size as doubles.

      (yes, seems obvious)

      but on most 32 bit architectures doubles are 64 bits and ints are 32 bits. (mind you, the 68k compilers generally used either 16 bit or 32 bit ints... depending)

      on 64 bit architectures, int might be equal to long equal to double.

      BUT YOU CAN NOT ASSUME THIS.

      you can't even assume that long long is 64 bits...

      --

      ---
      Live Long & Prosper \\//_
      CYA STUX =`B^) 'da Captain,
      Jedi & Last *-fytr
  10. WTF is this? by Anonymous Coward · · Score: 0

    I'm beginning to wonder if I should invest the time in learning FORTRAN.... [I]t seems to be the best tool when it comes to demanding optimization tasks and heavy computations.

    If you don't know the language, how can you state that? Hmm.. I wonder if I should invest the time in learning Pascal? It seems to be the best tool when it comes to parsing text files.

  11. Depends by Apocalypse111 · · Score: 1

    It depends on what you mean exactly by the "best tool". If you're looking for something easier, then I can't help you. If you're looking for something FASTER, then just use Assembly Language.

    --
    There is no mod option "-1: Disagree" for a reason. "Overrated" is not an acceptable substitute. Post something instead.
    1. Re:Depends by Anonymous Coward · · Score: 0

      Faster, if you know how to make it faster.

  12. Fortran 90 by Anonymous Coward · · Score: 0

    Active work is underway to provide a front-end
    for the GCC-system for Fortran 95.

    See: http://g95.sourceforge.net/

    Toon Moene (current g77 maintainer).

    1. Re:Fortran 90 by Anonymous Coward · · Score: 0

      you're the current g77 "maintainer"? pardon me while i kick you in the nuts, you lazy hack

  13. FORTRAN is easy by Philippe · · Score: 2, Informative

    You can become a passable FORTRAN programmer in a couple of hours if you already know another language, such as C or Pascal. There are a couple of gotchas (predeclared variables & COMMON statements IMHO).

    If you are going to touch any heavy simulation code (such as statistics, physics & biology) learn FORTRAN. It works very well for those problems. Yes, it is old, but that doesn't mean it's bad. It's not modern, but it works surprisingly well.

    I find myself teaching FORTRAN to budding scientists, and they are able to write complex stuff very quickly because they don't trip all over the language (e.g. '==' vs '=' in C).

  14. Welcome to Legacy Land by grendelkhan · · Score: 0, Offtopic

    Home of the VAX and land of Basic, FORTRAN, and COBOL!

    --
    Wu-Tang Name: Half-Cut Skeleton Get your own Wu-Na
    1. Re:Welcome to Legacy Land by Shalda · · Score: 1

      Actually, BASIC is alive and well. Really, if you want a nice freindly modern language, use VB.NET and find some good math libraries. I find VB to create far more readable code than any other language I've worked with. (Having at one point or another used BASIC, C, C++, C#, Pascal, Fortran, x86 assembly, 6502 assembly and 68k assembly.)

    2. Re:Welcome to Legacy Land by unicron · · Score: 2

      Because you haven't experienced danger until your run 100+ user production databases on legacy hardware. Suppose I'll go make it safe for another day:

      TAPE OPER RES MKC500
      INIT MKC500 TAP007
      TAPE OPER AVAIL MKC500

      *sob*....

      --
      Finally, math books without any of that base 6 crap in them.
    3. Re:Welcome to Legacy Land by grendelkhan · · Score: 2

      That was exactly my point. If you live in, or plan to ever live in Legacy Land, then by all means learn it. There are still plenty of positions and demand for people who know and can debug/edit commentless arcane legacy code. I don't know how many positions I ran across that were looking for MVS experience!

      --
      Wu-Tang Name: Half-Cut Skeleton Get your own Wu-Na
  15. It's still kicking... by drudd · · Score: 5, Insightful

    Fortran has several things going for it...

    1) it's been the standard scientific computing language for so long, that every platform has a compiler, and that compiler is likely to be very mature (i.e. stable, and produces fast code).

    2) since it's been a standard for so long, everyone has routines written in it which have been debugged and work, no sense rewriting them and introducing errors.

    3) the language itself lacks complicated constructs, so it is very simple to optimize. This, with (1) makes fortran still outperform c, thanks to the compilers.

    That said, I HATE fortran with a passion, mostly because it's ugly. 6 character variable names are impossible to deal with. Couple this with capitalization and indentation rules left over from the punch card era and you have code which is literally painful to read.

    Doug

    --
    Venn ist das nurnstuck git und Slotermeyer? Ya! Beigerhund das oder die Flipperwaldt gersput!
    1. Re:It's still kicking... by EvilBudMan · · Score: 1

      >>That said, I HATE fortran with a passion, mostly because it's ugly. 6 character variable names are impossible to deal with. Couple this with capitalization and indentation rules left over from the punch card era and you have code which is literally painful to read.

      Yea, I had FORTRAN 77 back in the day and it blows. We used terminals on a time sharing system. Rulz sux. It was almost as bad as punch cards. Plus we had to code on paper and get permission to run the program. If the prof. didn't understand it, you were fskd. He only had a semester of FORTAN himself. That class blew. That being said, it is very robust with math. Ugly, very ugly.

    2. Re:It's still kicking... by Ooblek · · Score: 1, Flamebait
      I believe that the GNU and at least a few commercial fortran compilers translate the code to C before it compiles. Kind of hard to outperform C when it is C.

      I suggest reading coding standards books on C/C++ so that you avoid these "unrelated" bugs by design. I can only assume unrelated means things like compiler/dev environment/linking/syntax/semantics problems. Programming was never meant to be easy, no matter what language you use. You can gain enough experience in a language to not have to deal with the type of issues that the poster was talking about.

    3. Re:It's still kicking... by Rasta+Prefect · · Score: 2
      3) the language itself lacks complicated constructs, so it is very simple to optimize. This, with (1) makes fortran still outperform c, thanks to the compilers.

      This really isn't true so much any more. Usually the performance difference comes from having a more mature compiler, which is becoming less and less an issue. In my experience they usually come out fairly similar. This said, you do sometimes have to watch just how you allocate and play with Arrays in C if you really want to squeeze the maximum performance out of it. Of course since dynamic allocation is so primitive in Fortran that you can't do multi dimensional arrays the "wrong" way....

      That said, I HATE fortran with a passion, mostly because it's ugly. 6 character variable names are impossible to deal with. Couple this with capitalization and indentation rules left over from the punch card era and you have code which is literally painful to read.

      You should give Fortran 90 a shot. The more grevious of FORTRAN's punch card related sins have been eliminated or made optional. Although last time I checked FORTRAN had no cap rules. At least _standard_ Fortran has no cap rules...Conventions, but not enforced rules.

      That said, I too, HATE fortran with a passion. Why does it do that stupid little thing when its writing binary data, tacking the extra integer on the beginning and the end? I hate that! Particularly when the specs for the output file don't mention it was written in that weird Fortran mode so you spend all @#$% day trying to figure out why your're getting floating exceptions and your parsing routines are off as you read through the file...

      --
      Why?
    4. Re:It's still kicking... by coats · · Score: 3, Informative
      Wrong about the GNU compiler.

      As a matter of fact, Craig Burley (original author of "g77") had quite a fight with RMS over optimizations that "gcc" did not provide but that are necessary for performance in a language where multi-dimensional arrays are first-class citizens.

      There are still a couple of "compilers" that translate into C (Gnu "fort" which is basically both obsolete and dead from a development point of view, and NAG "f90" that is free and is OK if you are only doing development work that doesn't involve real number crunching.

      Neither is used for serious computational work; having to live within the C aliasing rules doesn't permit the optimizations necessary for high performance computing problems.

      --
      "My opinions are my own, and I've got *lots* of them!"
    5. Re:It's still kicking... by jmv · · Score: 3, Interesting

      I believe that the GNU and at least a few commercial fortran compilers translate the code to C before it compiles.

      While this may be true (although I think both C and FORTRAN are translated to an intermediate form), I'd say that gcc doesn't qualify as a high performance FORTRAN compiler. On the other side, if you look at the compilers provided with super-computers, the FORTRAN compiler is usually much faster than the C compiler. I heard the main reason is because of the C pointers. In fortran, when a function receives two arrays as input, the compiler can assume (it's part of the language) that they are different arrays. In C, for the same function, you are allowed to send it the same array twice (it's called aliasing), so because of that, the compiler is restricted in the optimizations it can perform. This kind of ambiguities happen in other places too. That being said, I HATE FORTRAN and for me, C++ when carefully coded can be nearly as fast (Of course, I'm also using gcc which performance is adequate but not more...).

    6. Re:It's still kicking... by L0C0loco · · Score: 1

      Hmmm, You must be using something other than fortran to read those files. While I hate Fortran, I use it when required - just another tool to get the job done. If you have the fortran source code, you can avoid the 'extra integer' problem by using the proper parameters in the OPEN statement on most compilers. I believe that is a hold over from the old days when people used 9-track tapes. Sad thing is that people still use tapes exept they're now 8mm, DAT, QIC, ... .

      Enjoy! Z

      --
      -- Instant Karma's gonna get you! [320848 = 2*2*2*2*11*1823]
    7. Re:It's still kicking... by chess · · Score: 1

      Eons ago I had to program in Fortran.
      I don't know, if it was for the arcane machine, OS and compiler, but I suspect it was because
      of Fortran 77, that it sucked so badly.

      Of course, if You know the size of Your matrices in advance, and are able to simulate decent control structures with GOTOs, go ahead...

      But I'd rather recommend to spend a week learning decent dynamic memory allocation in C, than wasting one week with Fortran.
      Or googling around for math and simulation libs for C.

      One thing is for sure. There's nothing in Fortran, that You can't find in C.

      chess

    8. Re:It's still kicking... by astroboy · · Score: 3, Informative
      I don't think there is anything in the above post which is correct.

      The poster says:

      I believe that the GNU and at least a few commercial fortran compilers translate the code to C before it compiles.

      This isn't true, and I don't think has ever been true. Below is a quote from a g77 page:

      The g77 compiler is a combination of a front end that translates Fortran source programs and a back end that uses the results of the translation to make an object or executable file that performs the actions specified by the source programs when run. The back end is the same back end used by GNU C, C++, and Objective-C, which have their own front ends to translate their respective languages. Other front ends for Pascal and ADA are available or in progress. (Note: g77 does not translate Fortran to C code at any point. It is a native portable compiler, just like gcc. They share the same back end.)

      No commercial compiler I'm aware of does anything similar, either. Obviously, one should be wary of taking language advice from someone who is this ill-informed about compilers.

      As for unrelated bugs, this can be an issue. If all one wants to do is a fourier transform, or a singular-value decomposition, or something similar, on some data, it's clearly ridiculous to have to learn the C++ STL, or similar libraries in other languages, to just mess with some matricies. FORTRAN, for all its problems, Will Just Work as long as you're doing something simple.

      On the other hand, if you're just doing some small stuff and you don't want to deal with more complicated languages, the best bet is probably to use Matlab/IDL/Maple/Mathematica and not worry about computer programming at all. Even if you're planning on doing big calculations at this point, prototyping your algorithm and methods in these interpreted special-purpose tools can be a very good way to get your code up and running.

    9. Re:It's still kicking... by Slak · · Score: 2

      4) MSFT hasn't bastardized it (yet).

      Cheers,
      Slak

    10. Re:It's still kicking... by KenSeymour · · Score: 1

      There was, at one time, Microsoft Fortran for Windows.
      I once had a copy, but I never got around to using it.

      --
      "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
    11. Re:It's still kicking... by RexRuther · · Score: 1

      It became microsoft fortran powerstation then was sold to digital and rebranded visual fortran. digital was bought by compaq. So now it is compaq visual fortran.

      --
      -"The early bird catches the worm, but the late bird sleeps the most"
    12. Re:It's still kicking... by Ooblek · · Score: 2
      As for unrelated bugs, this can be an issue. If all one wants to do is a fourier transform, or a singular-value decomposition, or something similar, on some data, it's clearly ridiculous to have to learn the C++ STL, or similar libraries in other languages, to just mess with some matricies. FORTRAN, for all its problems, Will Just Work as long as you're doing something simple.

      But that problem falls into the realm of selecting the right tool for the job rather than trying to paint C++ as too difficult to use just for that reason.

      NAG, which you can buy, does translate the code into C. (I believe someone already replied and mentioned this fact.) I had to deal with its inability to transform strings from some Fortran code in a project I was involved with in college just because of this translation. That ill-informed comment was not neccessary.

      FORTRAN, for all its problems, Will Just Work as long as you're doing something simple

      Oh, well, there we go. The defacto standard in what we should all learn next is Fortran because it Will Just Work (well, unless you are doing something thats NOT simple). I can't really recall the last time I did something simple....oh, wait.....here is the last simple program I wrote:

      int main (int argc, char** argv) {
      printf ("Hello, World!\n");
      return 0;}

      Yeah, it was hard to compile an all, but I got it to work finally.

      On the other hand, if you're just doing some small stuff and you don't want to deal with more complicated languages, the best bet is probably to use Matlab/IDL/Maple/Mathematica and not worry about computer programming at all. Even if you're planning on doing big calculations at this point, prototyping your algorithm and methods in these interpreted special-purpose tools can be a very good way to get your code up and running.

      Did you not read the parent post? The poster specifically mentions some reasons why some of these packages don't work for what he is trying to do. It must be the karma.

    13. Re:It's still kicking... by velco · · Score: 1

      > > I believe that the GNU and at least a few
      > > commercial fortran compilers translate the code
      > > to C before it compiles.

      Not true for GCC.

      > the FORTRAN compiler is usually
      > much faster than the C compiler. I heard the
      > main reason is because of the C pointers. In
      > fortran, when a function receives two arrays as
      > input, the compiler can assume (it's part of the
      > language) that they are different arrays. In C,
      > for the same function, you are allowed to send
      > it the same array twice (it's called aliasing),
      > so because of that, the compiler is restricted
      > in the optimizations it can perform.

      Yes. Note however that ISO/IEC 9899:1999 standard
      introduces (a) type-based aliasing rules and (b)
      the `restrict' keyword. The `restrict' keyword
      alone is sufficient to provide the same (non-)
      aliasing guaranties as FORTRAN.

      > This kind
      > of ambiguities happen in other places too. That
      > being said, I HATE FORTRAN and for me, C++ when

      Of course, C++ has _exactly_ the same aliasing
      problems as C, and is missing (yet) `restrict'.

      > carefully coded can be nearly as fast (Of
      > course, I'm also using gcc which performance is
      > adequate but not more...).

      Fair enough. BTW, have you tried -mfpmath=sse
      (for IA32, of course) ?
      Makes _real_ difference.

      ~velco

    14. Re:It's still kicking... by KenSeymour · · Score: 1

      Or even better HP Compaq Digital Microsoft FORTAN for Windows (that lives in the house that Jack built).

      --
      "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
    15. Re:It's still kicking... by MisterBlister · · Score: 2

      [quote] Neither is used for serious computational work; having to live within the C aliasing rules doesn't permit the optimizations necessary for high performance computing problems. [/quote] Most modern C/C++ compilers have ways of limiting aliasing issues either at the file or even sub-file (using #pragmas) level. Surely these Fortran->C convertors could be modified to use them?

    16. Re:It's still kicking... by jc42 · · Score: 2, Troll

      Some years back, at a university that will remain unnamed (so you might think it's yours ;-), a bunch of us grad students decided to instrument the Fortran compiler that was used for most of the number crunching on the big department monster machine. The hardware handled integer overflows by setting a flag bit, which then had to be tested by a separate opcode, and the Fortran compiler didn't generate this test. (For floating point, there was an interrupt that couldn't be ignored.)

      The instrumentation added a test that recorded the overflow, let the computation continue, and wrote some results to an accounting file.

      What was found was that almost exactly half the Fortran runs produced at least one output number that was wrong due to an undetected overflow.

      When this was publicised, a survey of Fortran users was done. They were asked whether the compiler should test for overflow if such a test would take an extra opcode and slow the program down. around 90% of the users said that such tests should not be done if the program would run slower.

      This taught us an important lesson about the Fortran user community. And note that in the replies here, a lot is made of Fortran's optimizations. Now you know what that means.

      Around the same time, there was one of several analyses of the Fortran runtime libraries on IBM 370 mainframes, which are still in wide use for big number-crunching applications. The analysis showed that the double routines were accurate to only float precision over roughly half the range of their arguments. At the time, these routines had been in widespread use for maybe two decades.

      When a Fortran programmer uses double rather than float, it usually means that the computations needs the extra precision, and float doesn't have good enough precision to give correct output. For users to accept a Fortran that can't do doubles correctly half the time is another good sign of the nature of this user community.

      So in general, Fortran users seem to use it because they consider efficiency more important than correct results.

      I wonder if Enron's accountants use Fortran?

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    17. Re:It's still kicking... by jaoswald · · Score: 2

      If F2C converters could understand Fortran and the compiler-specific pragma rules well enough to do this reliably, then they'd have to be as good as a good Fortran compiler, targeted at a C implementation instead of a real machine. I.e., it would be as hard as just writing a Fortran compiler!

      Also, you'd have to depend on the C compiler not only respecting the pragmas but making FULL use of them. Again, just as hard as writing a Fortran optimizer.

      Any conversion step is going to make it difficult to pass on all the available semantic information present in the original source code to the next stage of compilation, and harder for the later stages to recognize the semantic information that would guide the optimization process.

    18. Re:It's still kicking... by khb · · Score: 1

      3) the language itself lacks complicated constructs, so it is very simple to optimize. This, with (1) makes fortran still outperform c,
      thanks to the compilers.
      -------------------
      The key thing which makes C (and it's family) difficult to optimize, and Fortran (modern dialects, modern spelling) or FORTRAN ('77 and before) has nothing to do with control constructs (simple or complicated).

      It's the fundamental semantics which make it difficult for a C compiler to prove that two entities aren't really the same (blessed or cursed be pointers, depending on context ;>) and in Fortran if things look different, the compiler is free to assume they are (oversimplification, but not much). Of course, programmers have long abused some constructs so that optimizers will sometimes break their code, years and many processors later.

      Fortran 95 is a much more complex language, but it's still optimizer friendly. In addition to the core optimizer friendly features, the FORALL statement was imported from HPF.

      Some C compilers have non-standard ways (pragmas, options, etc.) to assert that the semantics are closer to Fortran ... and clever optimizers can get close to the same performance when given that extra information.

    19. Re:It's still kicking... by jstott · · Score: 1
      That said, I HATE fortran with a passion, mostly because it's ugly. 6 character variable names are impossible to deal with. Couple this with capitalization and indentation rules left over from the punch card era and you have code which is literally painful to read.

      Aww, c'mon. Six-character variable names are ancient, any compiler less than 15 years old supports longer names, the 6-character limit is just if you're paranoid about backwards compatibility. The language doesn't HAVE any capitalization rules, so you can use whatever has the most visual appeal. As to the indentation, free-form source code became standard with F90.

      -JS

      --
      Vanity of vanities, all is vanity...
    20. Re:It's still kicking... by khb · · Score: 1

      If you are speaking of integer overflow, the langauge standard doesn't really support the notion. In addition, it's commonly used for (pseudo) random number generators.

      If you are speaking of floating point overflow, it can (and has been) added to the language (in an ISO Technical Report, and in the draft of the next rev of the standard). Many platforms have provided it for years as an option (e.g. IEEE machines often provide routines which check the hardware status).

      Many vendors do a significantly better job on their math libraries than the example you cite.

    21. Re:It's still kicking... by Rasta+Prefect · · Score: 2
      Hmmm, You must be using something other than fortran to read those files. While I hate Fortran, I use it when required - just another tool to get the job done. If you have the fortran source code, you can avoid the 'extra integer' problem by using the proper parameters in the OPEN statement on most compilers. I believe that is a hold over from the old days when people used 9-track tapes. Sad thing is that people still use tapes exept they're now 8mm, DAT, QIC, ...

      C in fact... I generally _do_ use Fortran to read files output by Fortran programs, because I'm usually hacking those programs...However in case I had already written a pretty decent amount of code before this annoyance came to light, and the nature of the task made writing the program with Fortrans very limited dynamic allocation abilities something I didn't really care to attempt. It's not really that big a deal once you know it's there, but when you don't...:)

      --
      Why?
    22. Re:It's still kicking... by randmairs · · Score: 1

      Several variant of Fortran allow for free formating where you can indent at will. It makes for cleaner code and easier interpretation.

      When I learned C, I also learned that it could over write the operating system. Whereas Fortran is a straight number cruncher. I don't have to worry about an indirect pointer reading data from who knows where or sending my data into some part of the OS. In other words, I'm comfortable that my Fortran program is not going to force me to do a reinstall!!

      In C/C++ the braces make reading the code harder than in Fortran. I find that I waste more paper because of the braces and have to go through more pages just to see if an algorithm flows properly.


    23. Re:It's still kicking... by russotto · · Score: 1

      When I learned C, I also learned that it could over write the operating system. Whereas Fortran is a straight number cruncher.

      <cough> EQUIVALENCE <cough>

      (ok, so unrestricted equivalence disappeared circa Fortran '77. But yes, there were people who played equivalence games to mess with the OS. Fortran hackers... a scary thought).

    24. Re:It's still kicking... by jmv · · Score: 2

      Fair enough. BTW, have you tried -mfpmath=sse
      (for IA32, of course) ?
      Makes _real_ difference.


      Tried it on two (FPU intensive) programs. On the first one, I got a ~5% performance gain and on the second one, I got NaN's so I'm not too impressed so far (that was gcc 3.1). I have however written some routines with SSE assembly and *that* provided a real gain (3x in the case I remember).

      AFAIK, -mfpmath=sse only makes use of the scalar fp instructions. Any idea when the vector ones will be supported? 3.2?

    25. Re:It's still kicking... by cburley · · Score: 1
      It became microsoft fortran powerstation then was sold to digital and rebranded visual fortran. digital was bought by compaq. So now it is compaq visual fortran.

      No, that's not true, but it was a common misconception back in the day.

      --
      Practice random senselessness and act kind of beautiful.
    26. Re:It's still kicking... by velco · · Score: 1

      AFAIK, -mfpmath=sse only makes use of the scalar fp instructions.

      Yep. However, the important thing is that it does not use the fp stack from the i387 days, but the xmm registers.

      Any idea when the vector ones will be supported? 3.2?

      Hard to tell. The machine description for 3.1.1 (3.2 will be almost identical to 3.1.1) contains patterns for vector operations, but I don't think the compiler has the necessary array access dependence analysis and parallelizing phases in order to actually emit such patterns. There's a large number of SSE builtins though.

      ~velco

  16. FORTRAN is great by SpanishInquisition · · Score: 0, Flamebait

    if you want to multiply two numbers a million time, for everything else C still rules.

    --
    Je t'aime Stéphanie
  17. Fortran is definitely still in use by MarvinMouse · · Score: 2

    I know of a lot of research and development facilities that still use fortran for mathematical modelling, and mathematical programming. Especially mathematical modelling of physical phenomena (ie. nuclear power plants, etc.)

    I didn't find it that hard of a language and I believe it would be worth learning for someone who needs to mathematics on a computer simply and easily without having all of the dongles and doo-dads. :-)

    --
    ~ kjrose
    1. Re:Fortran is definitely still in use by dubious9 · · Score: 1
      Especially mathematical modelling of physical phenomena (ie. nuclear power plants

      I can confirm this. I work for a very large nuclear services company and all of our base codes are still in FORTRAN. We use Java, C++, Perl, Xml nowadays, but only to encapsulate the numeric nuclear physics simulators that are written in FORTRAN.

      AFAIK We don't have any plans to change and esp. not to C/C++ because of its lack of a primitive imaginary type.

      --
      Why, o why must the sky fall when I've learned to fly?
    2. Re:Fortran is definitely still in use by dubious9 · · Score: 1
      Hate to reply to myself, but in summary:

      All our base are belong to FORTRAN :)

      --
      Why, o why must the sky fall when I've learned to fly?
  18. How can something be dying? by jsonmez · · Score: 0, Flamebait

    When it's already dead? Use C++. C++ can do everything fortran can do and more. If you are tracking bugs in C++, learn C++ better.

  19. Stupid question by Laplace · · Score: 1, Flamebait

    Yes: Fortran is still alive (the FORTRAN spelling has been depricated). There is a shitload of stuff for Fortran 77. Fortran 95 kicks some ass, and has a lot of features seen in modern languages.

    Shit, what a stupid question.

    --
    The middle mind speaks!
    1. Re:Stupid question by Laplace · · Score: 2

      Nope, being flamebait is saying that Slashdot is full of wusses who don't like being told that they're stupid.

      --
      The middle mind speaks!
    2. Re:Stupid question by Orre · · Score: 1

      Is FORTRAN 95 the latest standard FORTRAN

    3. Re:Stupid question by Anonymous Coward · · Score: 0

      Did you totally miss out on the part where he says "(the FORTRAN spelling has been depricated)"?

      Granted, it would've been better if it was spelled "deprecated" or missbiligt or whatever, but still, any intelligent person should've been able to understand it.

      To answer your question: Try this
      or this if you're really that fucking lazy. Then again, maybe this is more up your alley.

      Fuck you, asshole. Fucking latest standard FORTRAN dickmuncher. THERE ARE TERRORISTS IN OUR MIDSTS AND YOU'RE WORRIED ABOUT FUCKING FORTRAN 95?? Grow up flamer.

    4. Re:Stupid question by Orre · · Score: 1

      Thank you for your help. I think I understand now

  20. Just link your FORTRAN libs by mocm · · Score: 2, Informative

    to your C code. You just have to know how FORTRAN arrays are held in memory and how long the FORTRAN types are. Then you need to know what standard FORTRAN libs you need to link, so that your numerical libs will work. I did that for lots of my numerical work and it worked fine. You have to test it of course and it takes a while to work out the kinks.

    --
    ***Quis custodiet ipsos custodes***
    1. Re:Just link your FORTRAN libs by Anonymous Coward · · Score: 0

      Randy Bank's program PLTMG uses fortran for computations and C code for graphics. It works quite well.

  21. AHAHAHAHAHA by Anonymous Coward · · Score: 0

    you would hear shit like that on comp.lang.lisp. try actually writing the "efficient code" and benchmark it against Digital Fortran (or whatever the hell it's called these days), and find out why everyone but comp.lang.lisp posters have given up on it.

  22. What else do you want? by khendron · · Score: 2

    What are these modern language features you are looking for?

    FORTRAN is almost perfect for what it is used for: massive number crunching. Very little bells and whistles, which allows the programmer to concentrate on the numerics of the problem at hand and not the picky little programming details.

    --
    Life is like a web application. Sometime you need cookies just to get by.
    1. Re:What else do you want? by SIGFPE · · Score: 3, Insightful
      What features? How about things to make number crunching easier.

      In C++ I can extend the existing functions (such as sin(), exp(), operator+()) to support infinitesimals as well as ordinary floats or doubles. Using that I can automatically differentiate functions written in C++ making it trivial to code things like 2nd order optimisation routines. Try the same in FORTRAN. The nearest thing I can find anyone doing is using preprocessors that differentiate your source code line by line. (1) it's hideous and (2) well it's hardly still FORTRAN if you have to preprocess your code.

      Using C++ it becomes trivial to write code to compute second derivatives in applications where the textbooks say things like "traditionally we make do with first order approximations because evaluation of second order computations are complex to implement". Of course they're hard to evaluate if your ideas of how to program come from the 1960s.

      --
      -- SIGFPE
  23. ahhhhh FORTRAN by Anonymous Coward · · Score: 0

    I thought FORTRAN was more like 50 years old?

  24. Right Tool for the Job by lpp · · Score: 1

    First, an admission...I have used only a little FORTRAN in college, and that only to satisfy the requirements of a freshman level course. That said, although I find it hard to believe that other languages or libraries or toolsets are not up to snuff when it comes to the kind of number crunching you are doing. In any case, if it does seem that your application has serious number crunching needs, but you still feel compelled to use C,C++,Delphi,Perl,whatever, then perhaps you ought to wrap your number crunching code in a library, but written in FORTRAN. Then do your "other" code (infrastructure, UI, control) in the language of your choice, calling out to the FORTRAN code whenever necessary. If your application is as computationally intensive as you seem to imply, the additional runtime cost of a library load and callout should easily be offset by the savings in computation time due to the "better" language.

    Another way to look at this is that most languages are created because a problem domain exists which the language creator thought would be better served by this new language. FORTRAN has long been considered the best language/implementation for computationally intensive applications. Use the right tool for the job.

    G'luck.

    1. Re:Right Tool for the Job by anonymous_wombat · · Score: 2, Insightful

      You can use CORBA, or XML to communicate between your Fortran application, and any other code that you may write. That way, you can get the best of both worlds. I wouldn't give up so fast on C++/Java though. Investigate those languages more thoroughly before you decide to code in Fortran.

    2. Re:Right Tool for the Job by zrodney · · Score: 1

      I have never, ever, thought of fortran and xml at the same time. yikes!

      just think about trying to parse those angle
      brackets in fortran

    3. Re:Right Tool for the Job by GlobalEcho · · Score: 2

      I want to second the advice to parcel your project out into different languages. You would be a masochist to do your I/O routines in FORTRAN (file numbers, anyone?). But try, for example, finding decent optimization algorithms, linear algebra routines (Cholesky decomposition, etc.), and other serious code in C. [Num. Recipes, BTW, is not serious]

      Sure, there are CBLAS and CLAPACK -- both hideous automatic translations of the FORTRAN code!

      So in addition writing to your own code, you'll be able to scrounge *and adapt* useful routines from the literature.

    4. Re:Right Tool for the Job by Anonymous Coward · · Score: 0

      Oh yeah, CORBA and XML, those are some high-performance interfaces, NOT!

      If you are working with FORTRAN it is beacuse you need high performance, or you don't know any better. Both options are antithetical to the use of CORBA or XML.

    5. Re:Right Tool for the Job by anonymous_wombat · · Score: 2

      The poster wasn't concerned with speed as much as with having the right tools in which to program his application. He does not specify how long these mathematical operations take, but if we assume that they are complex and take at least 10 seconds, or maybe minutes or hours to complete, then the overhead of making a CORBA call isn't going to be a big deal. If his calculations take only a second or two, then the language that he uses is hardly going to matter for speed. He can just get a faster box.

  25. I used F77 for a while by IPFreely · · Score: 4, Insightful
    ... 20 years ago, (ye gads). It is OK, but not anything special. About the only special feature it has is the builtin COMPLEX type. Beyond that, you're in just another procedural language, and an old one at that.

    The problems you described in C/C++ are probably mostly inherant to C. C is not type strict, so it lets you shoot yourself in the foot (or head) a lot.

    What it sounds like you want is a strongly typed and type safe language. That would catch most of your problems, assuming your're just writing algorithms and not trying to interface to strange API or hardware.

    PASCAL/MODULA-2/-3, or ADA can probably do what you want, and have GCC frontends available. These languages usually have runtime checks for safety, but after debugging, you can usually optomize them out for a production release.

    So over all, go compiled, go type safe, go modern/OO if you can.

    --
    There is nothing so silly as other peoples traditions, and nothing so sacred as our own.
    1. Re:I used F77 for a while by geekoid · · Score: 2

      OO != speed. NUmber crunching must have speed. a 10% degradation in speed add many hours to some fortran calculations.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    2. Re:I used F77 for a while by IPFreely · · Score: 2
      Very true. True OO can add run time type checking overhead that you don't really want.

      ADA95 has some structures that support most of the type of capabilities that you want in OO, without actually having an OO environment. It is not OO in the same way smalltalk or Java or others are. But it is compiled and can be optimized well enough to match many F77 compilers.
      Of cource, true final speed depends a lot on the specific compiler. GCC has both F77 and ADA and they use the same backend. The end reuslt is probably similar speed for similar code. YMMV with other compilers of either.

      My reference to OO was really more in the idea that you should not limit your language to old constructs such as fortran when modern OO like constructs are available at similar speeds.

      --
      There is nothing so silly as other peoples traditions, and nothing so sacred as our own.
    3. Re:I used F77 for a while by dvdeug · · Score: 2

      ADA95 has some structures that support most of the type of capabilities that you want in OO, without actually having an OO environment. It is not OO in the same way smalltalk or Java or others are.

      Ada95 is not OO in the same way that smalltalk and Java are, but it is OO in the same way that C++. It supports inheritance and dynamic dispatch, the two key elements of OO IIRC. (Ada95 is the first internationally standardized OO language, actually.)

    4. Re:I used F77 for a while by norwoodites · · Score: 2

      C now has a built-in type for complex, look at the ISO C99 standard.
      Also it is Ada not ADA, it is a name of a person and it is now comes with gcc's source, to compile it you need an older version of it. Also gcc comes with a Java compiler which can compile to native code and get rid of some of the runtime checks.

    5. Re:I used F77 for a while by Emperor+Palpatine · · Score: 1

      For what it's worth, IMHO Ada95 would be a good choice here. The best of all worlds really. Very strict, but with most the useful stuff from your other favorite language(s).

    6. Re:I used F77 for a while by Mt._Honkey · · Score: 2
      the only special feature it has is the builtin COMPLEX type
      Hmmm.. that's odd. I'm sitting in front of a FORTRAN IV manual that lists COMPLEX as a type. Maybe it is a propriatary thing.
      --

      Don't Bogart the fish sticks
    7. Re:I used F77 for a while by rnd() · · Score: 2

      I think (CA)ML would also be a good answer to this question. It's a functional language, can be as strongly typed as you want it to be, and ends up being nearly as fast as C.

      --

      Amazing magic tricks

    8. Re:I used F77 for a while by mangu · · Score: 2
      a 10% degradation in speed add many hours to some fortran calculations


      If your program takes many hours to run, you should consider redoing the inner loop in assembly. Use a profiler to find where most of the CPU time is being used and optimize that. I have found that, by proper use of the "asm" construct most C compilers have, one can have the best of both worlds: quick as in assembly, and easy as in C. Compared to that, the only advantage Fortran has is that it's well known by many old-timers who are not computing experts, but need to use computers for number-crunching.

      My answer to the guy who posted the story is, don't bother with learning Fortran, unless your teacher insists you should use it.

    9. Re:I used F77 for a while by Anonymous Coward · · Score: 0

      It's funny, but 99% of the time when a person writes the name of a less common language erroneously in all upper case, they don't know anything about the current status of the language. Eg. when someone talks about LISP, they talk about an interpreted language with list as the only data structure, and that was last true around 1970 or so. The same with FORTRAN which supposedly has no recursion, no dynamic memory allocation etc., and it seems people are doing the same thing with ADA. I don't know why this happens but I am constantly amazed by this correlation.

    10. Re:I used F77 for a while by plaa · · Score: 2
      ... 20 years ago, (ye gads). It is OK, but not anything special. About the only special feature it has is the builtin COMPLEX type. Beyond that, you're in just another procedural language, and an old one at that.

      C now has a built-in complex data type. For example:
      #include <stdio.h>
      #include <complex.h>

      int main(void) {
      _Complex float f;

      f=-4;
      printf("N=%f%+fi\n",creal(f),cimag(f));
      f=csqrt(f);
      printf("N=%f%+fi\n",creal(f),cimag(f));
      return 0;
      }
      However, I'm not sure how widely these C99 extensions are supported on some other compilers.
      --

      I doubt, therefore I may be.
    11. Re: I used F77 for a while by Black+Parrot · · Score: 2


      > OO != speed. NUmber crunching must have speed. a 10% degradation in speed add many hours to some fortran calculations.

      True, but with modern CPU speeds the bottleneck for the vast majority of applications is the development and maintenance time. If you're doing supercomputer applications where you need the result in 10 days instead of 9 and you can't run out and buy a supercomputer, then sure, do whatever it takes to get that 10% improvement.

      But don't let speed be the deciding issue in the general case. It's just one of several factors that need to be weighted for a trade-off.

      --
      Sheesh, evil *and* a jerk. -- Jade
    12. Re:I used F77 for a while by Tony-A · · Score: 2

      IIRC, FORTRAN II had COMPLEX as a native type. Probably goes back to the original Formula Translator.
      Variables I through N defaulted to INTEGER.
      Other variables defaulted to REAL.
      DOUBLE PRECISION and COMPLEX had to be specified explicitly.
      Some kind of hack for Holerith strings.
      Outside of Holerith strings, spacing strictly for the benefit of human readers, although I think some compilers didn't like END stretched across continuation cards.

      If you have lots of formulas and very little logic, FORTRAN is probably the optimal language.

  26. fortran joke by zrodney · · Score: 1

    hey I get to post my favorite fortran joke
    about variable naming.

    "God is real; unless declared integer"

    my other favorite math joke is
    "what's purple and commutes?"

    1. Re:fortran joke by Angry+White+Guy · · Score: 1

      I'll bite.
      What is purple and commutes?

      --
      You think that I'm crazy, you should see this guy!
    2. Re:fortran joke by Anonymous Coward · · Score: 0

      An Abelian Grape!

      HA HA Ha Ha ha!
      ha ha
      heh
      *erm*

    3. Re:fortran joke by karmawarrior · · Score: 1
      "what's purple and commutes?"
      Kermit in a blender.

      Thank yew! You've been a great audience!

      --
      KMSMA (WWBD?)
    4. Re:fortran joke by Angry+White+Guy · · Score: 1

      BWA-HA-HA!

      Only on /. would you get a laugh out of that one.
      Maybe at an engineering convention too...

      --
      You think that I'm crazy, you should see this guy!
    5. Re:fortran joke by zeda · · Score: 1

      An Abelian grape

    6. Re:fortran joke by Anonymous Coward · · Score: 0

      That's hillarious. Too bad /. moderators don't know Fortan well enough to get the joke... :)

    7. Re:fortran joke by Anonymous Coward · · Score: 0

      Ummm... isn't Kermit green?

    8. Re:fortran joke by Spock+the+Baptist · · Score: 1

      "what's purple and commutes?"

      Kermit in a blender.
      ___________________________

      Cough, cough, cough...

      Kermit is green not purple. Methinks that you're thinking of Barny.

      --
      "Oh drat these computers, they're so naughty and so complex, I could pinch them." --Marvin the Martian
    9. Re:fortran joke by gekman · · Score: 1

      A good programmer could write a Fortran program in ANY language.

      This may only be funny to a guy like me who learned Fortran IV back in 1967...

      --
      Look at all the happy creatures dancing on the lawn...
    10. Re:fortran joke by Anonymous Coward · · Score: 0

      What's yellow and equivalent to the axiom of choice?
      .
      .
      .
      .
      .
      .
      .
      .
      .
      Zorn's lemon

    11. Re:fortran joke by Anonymous Coward · · Score: 0

      Ha! Me too, on an IBM 1130 with punched cards at the University of Dallas. We had full control of the computer, console and all. Our chemistry professor thought "this programming thing" would aid our careers, so he forced the Chemistry class to go through IBM's FORTRAN self-study course on our own time. Instead it *became* a career!

      Thanks for the memories!-))

    12. Re:fortran joke by Anonymous Coward · · Score: 0

      No, it's the bad programmers who write FORTRAN programs in all languages.

    13. Re:fortran joke by karmawarrior · · Score: 1

      and the commutes/blender part would mean...?

      --
      KMSMA (WWBD?)
  27. On languages and Fortran. by McDoobie · · Score: 5, Informative

    Different languages have different strengths and weaknesses. I use Fortran, C, Ada95, and Ocaml interchangeably for different tasks. Often times linking the object files into a single executable.
    Fortran, designed for mathematics and engineering, obviously excels at that job. You might want to consider writing the "intensive" parts of your application in Fortran and then linking it with modules written in another language such as C or Ada.
    I've found that C is perfect for handling the I/O routines for such apps, but my Ada libs are ideal for doing memory managment and when the code outgrows the practical limitations imposed by Fortran.(Note: Interfaces.C and Interfaces.Fortran).
    Likewise Ocaml tends to fit around anything with a minimum of hassle.
    Of course, this is just a subjective evaluation derived from my own experiences. However I would encourage you to experiment to find the combination that works best for you. As we all should know "Theres more than one way to do it."

    I'm sorry if this post seems somewhat vague, but it would be rather hypocritical of me to outright prescribe a certain language or tool when I personally have a tendency to float around and use whatever tool is most convenient.

    NiCad

    1. Re:On languages and Fortran. by rainman31415 · · Score: 1

      kind of funny taking advice from McDoobie... but hey, tokin and codin is a great combination.........


      rainman

    2. Re:On languages and Fortran. by gilroy · · Score: 2
      Blockquoth the poster:
      I use Fortran, C, Ada95, and Ocaml interchangeably for different tasks.
      If you use them for different. distinct tasks, as this and the rest of your comment implies, then you are clearly not using them interchangably. That would mean you don't think that the languages have different strengths and weaknesses.

      Sorry, it's the middle of summer and I haven't had any student papers to fill my vocab-nazi quota. :)

    3. Re:On languages and Fortran. by McDoobie · · Score: 1

      See my response to the AC post above.

      I should have said "I use them both interchangeably and for different distinct tasks."

      Too much caffiene sometimes causes my fingers to get ahead of my brain.

      NiCad

  28. Good Fortran Book by hypermodernist · · Score: 1

    Fortran was one of the first programming languages I taught myself in preparation for an engineering contest in High School.

    The book that I used to learn this great language is "Fortran 77 Programming w/ An Introduction to the Fortran 90 Standard" by Ellis, Published by Addison Wesley.

    I have the second edition of this book and not only is it a great programming book but a great Math book as well teaching such concepts as Data Fitting by least Squares approximation and the Newton-Raphson method for solving non-linear equations. (Using the first derivitive of an equation to approximate a root.)

    This book put me well ahead of the people in my calculus classes.

  29. Good Fortran 77/95 Compilers? by citanon · · Score: 1

    G77 works great, but what about ifc (Intel Fortran Compiler)? Anybody tried using it? I tried using ifc (free Linux version) to compile some of my Fortran 77 code, but the program crashes on writing to and from internal files. Is ifc only compatible with Fortran 95? Is G77 compatible with Fortran 95? Anybody know other good free compilers?

    1. Re:Good Fortran 77/95 Compilers? by Anonymous Coward · · Score: 0

      Watcom. Get it from openwatcom.org.

    2. Re:Good Fortran 77/95 Compilers? by GuidoDEV · · Score: 1

      Unfortunately, watcom has only a f77 compiler, and it's for windows at that.

    3. Re:Good Fortran 77/95 Compilers? by Anonymous Coward · · Score: 0

      The question was about F77. And Watcom can be hosted on any of DOS16, DOS32, OS/2, Win16, Win32 and will produce code for any of those.

      I'm not certain about Fortran, but the Open Watcom C/C++ compiled also hosts/targets QNX and PPC. Contributors are working on a Linux port.

    4. Re:Good Fortran 77/95 Compilers? by GuidoDEV · · Score: 1

      Is there *that* much difference between DOS16 and Win32? ;-)

    5. Re:Good Fortran 77/95 Compilers? by forjman · · Score: 1

      The intel fortran compiler (ifc) is great. It's free and beats the crap out of g77. Why doesn't g77 print the same number of digits for single and double precision variables? The point is a good compiler should behave as expected and ifc is one of the best fortran compilers I have seen in my twelve years of fortran programming.

    6. Re:Good Fortran 77/95 Compilers? by Anonymous Coward · · Score: 0

      I use Bell Labs' f2c translator as a front end to C. G77 has some problems still, one of the worst being no "implicit none" ( - u ) command line switch.

      I remember the time i was working on modem algorithms in Fortran and found that the f2c/gcc combination was actually faster than real time. I tried to recode it in gcc alone, but somehow, it got about 10% slower. somehow, the C code that the f2c preprocessor generated must have been "easy to optimize."

      By the way, f2c is actually a complete fortran 77 compiler that uses C/C++ for its "object language."

      I enjoy the "no frills" approach to programming in fortran when the object is not involved with parsing. The set of constructs seem to match the problems ina physical world very well. And the optimization of Fortran compilers is a thing of beauty as well.

      I do remember coding a complex matrix computation in C++ one time... and found that an incredible amount of time was spent in creating and destroying "temporary" complex numbers. I got good answers, but i have distrusted C++ ever since.

      Just my $0.02.

    7. Re:Good Fortran 77/95 Compilers? by Anonymous Coward · · Score: 1, Informative

      I found ifc produced faster code, typically 2x my g77 code, all on fortran 77 code. Not all optimizations work reliably for me, and some core dump. Try turning some off. Most of the speed boost for me is prefetch optimization, in my case. I also have Lahey's fortran express, which at US$250 is the cheapest commercial fortran available for linux. I bought the one before they added prefetch. g77 is the slowest out of all the above. It is also slower than f2c+gcc in my case. But coding for f2c is a pita because it's stricter than g77.

      There is basically no free lunch with regard to f95, well except ifc. There is a project called g95 but it's nowhere near done.

  30. Use Maple by swagr · · Score: 2

    It will export your script as C.

    --

    -... --- .-. . -.. ..--..
    1. Re:Use Maple by swagr · · Score: 2

      It will export your script as C. ...and Java and Fortran.

      From the websites www.maplesoft.com and www.mapleapps.com:

      The new CodeGeneration package provides routines to translate "numeric" Maple procedures and code, such as expressions, lists, arrays, rtables, and lists of equations, to Java code. This new package also contains improved versions of codegen[C] and codegen[fortran]. You now have several options to choose from when translating Maple code to Java, C or Fortran code that provide greater control over how analysis and translation of types are performed. Maple 8 has extended the external linking capability with the ability to link to static Java methods.

      --

      -... --- .-. . -.. ..--..
    2. Re:Use Maple by fireboy1919 · · Score: 2

      Of course, you can do this with the much more powerful matlab...for which you can also buy the maple symbolic evaluation engine, I might add.

      Plus you can do things OTHER than math with it.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    3. Re:Use Maple by swagr · · Score: 2

      the much more powerful matlab ...
      after you add the Maple symbolic evaluation engine. Without it they're powerful in different ways.

      things OTHER than math
      I can do things other than math with a rubber hose. ;)

      --

      -... --- .-. . -.. ..--..
  31. FORTRAN is very much alive by twem2 · · Score: 1

    I know people who only write FORTRAN code. They need the speed which the heavily optimised compilers provide (they use it for simulation of stellar evolution and planetary evolution)
    Its still taught to many Physics students at Cambridge University due to the speed and wide availability of scientific libraries.

  32. In the Smithsonian by jazman_777 · · Score: 1

    It's in the Museum of American History. I saw McCracken's _FORTRAN IV Programming_ or whatever it is, in the IT section in the basement. I learned Fortran with that book! Dang, it's old, and so am I!

    --
    Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
    1. Re:In the Smithsonian by okvol · · Score: 1

      I still have my textbook: Business Programming in Fortran IV. I've gotten a lot of laughs with it, too.

      --
      cabg x3 is a life changing event...
    2. Re:In the Smithsonian by Yunzil · · Score: 2

      Dang, it's old, and so am I!

      Pfft. They also have a Commodore 64. Ask me how depressed I was when I saw that. :-b

  33. fortran 90 and modern computing by cyberwinds · · Score: 1

    The DOC institute I am working at uses F90 to develop FMS (Flexible Modeling System) for the purpose of climate research. The NCAR/NOAA uses F90 in their latest CAM2 (Community Atmospheric Model v2). So it seems pretty safe for me to say that F77/F90 is still very active and is a proven tool in the academic environment.

    --
    Together, we are strong; Apart, we are stronger.
    1. Re:fortran 90 and modern computing by GuidoDEV · · Score: 1

      CAM2 is only one of many atmospheric models using FORTRAN, as mentioned here.

  34. Good with cheetohs too! by Anonymous Coward · · Score: 0

    I still turn to FORTRAN when I have a linear programming problem. There aren't too many simplex solvers out there and most of the good ones I know of are in FORTRAN libraries. In some ways more modern languages just don't go the extra mile on the obscure math and as we all know math doesn't go out of style.

  35. Yes, it's worth wile by unoengborg · · Score: 1

    There are still lots, and lots of libraries for
    numerical analasys written in Fortran.
    So if you intend to use it for somthing like that
    it's a good idea to learn it.

    --
    God is REAL! Unless explicitly declared INTEGER
  36. Octave by Density_Altitude · · Score: 1

    If the only thing you hate in Matlab is the price, give octave a try!

    --
    delete free(system.gc);
    1. Re:Octave by Anonymous Coward · · Score: 0

      And this has a C++ interface for matrix programming, should help to make more fluent matrix programming in C++ without the tedious bug fixing.

  37. This is a really ignorant/uninformed question. by Wakko+Warner · · Score: 3, Insightful

    Fortran is used HEAVILY in very specialized industries -- almost any mechanical design or scientific modelling program has some Fortran code in it.

    What do you want to do with it? Model fluid dynamics? Do structural or materials analysis? (Such software already exists.) Or do you simply want to find a better way to encode your DivX files?

    It appears to me as though you are trying to select the proper tool for driving nails into wood, while looking in the screwdriver section of the hardware store. If you need to ask why you should learn Fortran, you probably shouldn't learn it.

    - A.P.

    --
    "Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
    1. Re:This is a really ignorant/uninformed question. by Anonymous Coward · · Score: 0

      You are a turd.

    2. Re:This is a really ignorant/uninformed question. by Anonymous Coward · · Score: 0
      scientific modelling program has some Fortran code in it.

      We have an Energy Auditing calculation from the early 90's written in Fortran. It is getting rewritten as part of a larger project into a new Java codebase that will exist with some like projects.

      The VAX machine the auditing program ran on was memory and processer deficient, so the original programmer wrote it in six steps. Each steps dumps a .dat file which then has to be parsed by the next process, and so on until the final results are output in flat text.

      omico--

  38. The hell with Fortran by Cro+Magnon · · Score: 0, Flamebait

    COBOL rulez!

    --
    Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
  39. Not Really by briancnorton · · Score: 1

    I've had to do some fortran, and I cant see ANY benefit from using it over something like mathematica or maple for modeling or computation. The price tag isnt that high, and if you're a student, you can usually swing a free copy of one or the other if you look hard. Using fortran, you're going to spend five times as long and get something that might run differently on your development platform than your processing platform. Perhaps you need to specify your task better. "demanding optimization tasks and heavy computations" is vague.

    --

    People who think they know everything really piss off those of us that actually do.

    1. Re:Not Really by Anonymous Coward · · Score: 0

      You have no idea what Maple or Mathematica is doing when you ask it to perform a calculation. If you are asked "how do you know that answer is right?", all you can say is "well, it said in the book that it would work".
      If you need to justify - to yourself or to someone else - your algorithms or your assumptions or where you cut corners to get speed as against precision - then you need to program your mathematical algorithms directly and not rely on some magic black box to do them for you. That is where Fortran comes into its own: every routine you use comes with full source and has been peer-reviewed by your GRANDparents...

  40. Fortran vs. C/C++ by death00 · · Score: 1

    Learning a new language isn't going to help you avoid debugging. C can do anything Fortran can do (but not vice-versa!) Fortran is a simple language to learn, but so is C. Mastery of either is difficult. Because is it so popular, the support base for C is much larger than for Fortran, so I would suggest sticking with it.

    1. Re:Fortran vs. C/C++ by binaryDigit · · Score: 2

      Learning a new language isn't going to help you avoid debugging

      Right but his point was that with C/C++ he spends a lot of time dealing with programming issues unrelated to solving his problem. This is a common occurance in C/C++. In C the most obvious example that is near and dear to everyones heart is string handling. It's easy to introduce many bugs into an app that does even simple string manipulation. Vs say a language like VB, where the string handling is fairly straight forward, so you can spend your time dealing with many of the other shortcomings of the language, oops, I meant to say solving your problem.

      If the man wants to do math and not have to worry about memory mangement and pointer arithmitic, then moving to a language like Fortran is not necessarily a bad way to go. He shouldn't get caught up in the age (after all, C aint no spring chicken either). If it's still around and being used, then it probably does the job well (don't know a lick of Fortran so I can't say personally).

  41. What is your application? by Anonymous Coward · · Score: 0

    You don't say what kind of programs you want to write. For general-purpose programs you're worse of in Fortran than C/C++.

    Your mention matlab and the netlib, which suggests you're doing numerical stuff. For that kind of program Fortran is indeed still very much alive, mainly because of the efficient compilers, the good support for array manipulation, and the enormeous amounts of legacy code.

    You also mention recursion. If you're working on tree-like data structures Fortran is not so great. In that case a functional language such as ML or Haskell can be a very good choice. As a bonus, functional languages are often very comfortable to program in, since a lot of irrelevant detail is silently handled by the language.

  42. why not C? by 4im · · Score: 2

    A friend of mine is very much into computer simulations of physics and chemistry - he writes his own code in c / c++, and so manages to do on a (heavily optimized) Linux PC what his colleagues using FORTRAN still need Crays to run. All the difference is that he can use custom datastructures that FORTRAN (and the existing libraries) does not offer him.

    1. Re:why not C? by Anonymous Coward · · Score: 0

      LOL.

      And this one time at band camp...

      Either your "friend" is lying or his colleagues are idiots.

    2. Re:why not C? by Anonymous Coward · · Score: 0
      LOL.

      And this one time at band camp...

      Either your "friend" is lying or his colleagues are idiots.

      Indeed. Or maybe those old Cray 1's really ARE that much slower than a modern PC for some set of tasks. No, probably just a lying fool.

  43. Matlab and Octave by Vireo · · Score: 2

    If you need to do numerical linear algebra (vectors and matrix), nothing beats Matlab. But as you said, Matlab costs a bunch of money. Maybe you'd be interested in Octave, an open-source, Matlab-like and mostly Matlab-compatible scripting language / interpreter.

    1. Re:Matlab and Octave by Nyh · · Score: 2, Informative

      I agree. Especially for research Matlab is a very powerful tool (in particular with the special purpose toolboxes, Simulink is great!). You will have to think in matrix and vetors to get the speed. I am regularly called by colleagues to fix speed problems with Mathlab applications. Usually it is a for loop that could be vectorised (mostly by the use of boolean array's).

      Why is Matlab so fast? Well, it's nothing more as an easy frontend for the Fortran libraries. That's where the speed is: FORTRAN.

      Cu, Hans

  44. Physics and other legacy code by Soong · · Score: 2

    My dad is a computational physicist. He works with some codes that are k*100,000 lines of FORTRAN. Mostly f77 too.

    Once upon a time, Cray had a really good automatically vectorizing compiler for FORTRAN and a mediocre C compiler. The Killer App stuck.

    The word on the street (from my dad) is that new physics codes are being written in C/C++. So, maybe in 20 years most of the old FORTRAN will be replaced.

    I've tried to get my dad to learn more C/C++, but he plans to retire before that's necessary.

    --
    Start Running Better Polls
    1. Re:Physics and other legacy code by waynev · · Score: 1

      Urban legend has it that someone once asked Seymour Cray what the programming language of SuperComputers would be in the 21st Century.

      He reponded that he had no idea what it would look like, but he knew it would be called FORTRAN.

  45. I use FORTRAN daily but not for long =P by iamwoodyjones · · Score: 1

    Only learn it to convert it...

    I've begun writing a perl converter it convert my company's routines that doesn't mangle the C code like the fortran2c program. Fortran 90 is a bit better than Fortran 77 but only because of the C work around features in the compiler. I also have to disagree about the performance of Fortran compared to C in math heavy routines. I've been having better performance on my math routines after they've been converted to C.

    Reasons why not to use FORTRAN:

    Lack of structures, classes, and a lot of OOP that C/C++ have. Even though Fortran 90 has memory allocation and dynamics, think about how Fortran 77 and g77 don't!

    Not convinced that it isn't for you!? Then try the fact that Fortran passes ALL variables by reference only! Excellent isn't it?

    Still not convinced not to use it for big projects yet? Try that since everything is pass by reference it has no pointers.

    Try making linked lists/trees and stuff out of it easily!

    The only thing it has going for it is the fact that you can pass variable length arrays into a function like so:

    func(array,m,n)

    double precision array
    integer m,n

    -------

    Don't let that fool you into thinking it's robust! You can do that in C although a bit of ugly pointer arithmetic is involved.

    Continuing... If you accidently mistype a variable the compiler will go ahead and create that variable implicitly based on its first letter to determine its primative data type instead of reporting an error!

    Seriously, C can do all the stuff it can do and then some.

    1. Re:I use FORTRAN daily but not for long =P by iamwoodyjones · · Score: 1

      Slight correction with the above...

      double precision array
      integer m,n

      Should be

      integer m,n
      double precision array(m,n)

    2. Re:I use FORTRAN daily but not for long =P by Anonymous Coward · · Score: 0
      Implicit variable creation can be turned off with
      implicit none
      Using this in every program was one of the first things taught in my Fortran 90 class. It's a feature...not a bug :)
    3. Re:I use FORTRAN daily but not for long =P by Anonymous Coward · · Score: 0

      Long time since I used Fortran (it was a post F77 compiler, but pre F90), but it was simple and efficient and reasonably portable.

      Sure, for some problems there are better languages (I had to work with one old hackers program that used arrays to simulate pointers for binary-trees... ugh!)

      And Fortran's IO was excellent (certainly compared to C++'s abomination...)

      Still, I'd generally use something else these days :-) But Frotran still has a place.

    4. Re:I use FORTRAN daily but not for long =P by srslif16 · · Score: 1

      Two words for you: IMPLICIT NONE

    5. Re:I use FORTRAN daily but not for long =P by iamwoodyjones · · Score: 0

      I never said that it was a bug.

  46. Fortran isn't so bad by mthiel · · Score: 1

    I've been using MS Visual Fortran for several weeks now, and it's able to make all the same GUI components I'm used to using in other languages. And, with the Calculator OCX, I'm even able to do math!

    1. Re:Fortran isn't so bad by Papineau · · Score: 2

      For having used it (although only in CLI apps) a few years ago (1999-2000), I really really hated working with it. The compiler itself was Digital's, and it caused me and one of my colleagues quite a lot of problems.

      For starters, the optimized version didn't run correctly, but would report that variables weren't declared (implicit declaration triggered a warning). So we had 3 versions: Debug, Release (optimized, but actually used for debugging), and Release-real (not optimized, but doing the right calculations).

      Then, the linker had some problems once in a while, when it replaced the content of some object files/functions by memory filled with 0. Of course, when you ran into that code, the EIP register would, in time, point to some unallocated memory, and a SIGSEV (or whatever is the equivalent on Windows) would be sent. That problem was very visible in the debugger. The solution? Just recompile the whole thing, and you'd have something sane again. No source file needed to be modified. And I thought that compilers were deterministic...

      Other than that, just make sure you know the language (especially when working with 20+ years old code): IF(CONDITION)10,20,30 is completely legal, as well as not declaring all your variables.

      Back to my own experience, instead of making the GUI in Visual Fortran, it was a separate app in VB. I won't enter the details of what we needed to do to communicate between the two.

  47. Don't use Fortran 90. by Tim · · Score: 5, Informative
    Don't use Fortran 90. It's as messy a language as C++, with the significant disadvantage that it has a much smaller user base.

    Honestly, your objection to C++ is unclear to me...you say you spend more time fixing bugs than approaching the task at hand? Is this because you don't know the language that well? Perhaps because you're not taking advantage of the many excellent libraries available to you? Keep in mind that C++ library design requires a great deal of skill, but using a well-designed library is actually easier than coding in other languages.

    C++ is my own personal choice for anything by the most demanding of high-performance computing applications. Is there an overhead to the language? Debatably, yes. Does it matter, in 99.9% of applications? No. And with only a little bit of forethought, even the "inherent" performance hits can be avoided in the places where it matters. It's just that you have to rely on a profiler to tell you where those places are...

    There is a significant community of researchers and developers working on scientific and high-performance computing in C++. Check out some of these:

    • POOMA - a high-performance mathematics C++ framework
    • Blitz++ - a C++ mathematics library which uses template metaprogramming to achieve FORTRAN-caliber performance.
    • MTL - another example of template metaprogramming.
    • oonumerics.org - a good site for information on high-performance object-oriented code.


    These are just a few good starting points. Do a google search for 'high performance c++' to find many more. Just, please, for the love of Deity, don't code in FORTRAN. ick....

    --
    Let's try not to let fact interfere with our speculation here, OK?
    1. Re:Don't use Fortran 90. by slickwillie · · Score: 2

      Real C programmers who want to use FORTRAN use RATFOR (RATional FORTRAN).

    2. Re:Don't use Fortran 90. by PineGreen · · Score: 2
      Don't use Fortran 90. It's as messy a language as C++, with the significant disadvantage that it has a much smaller user base.

      Not only this, it has two more disadvantages:
      a) The compilers are unbeliveably crash and bad. And I've tried both Sun and SGI f95 compilers... Sucessfully segfaulted them both within a few days of using them... Funnily enough NAG f95 compiler for linux seems to be quite stable.
      b) No GNU f90/f95 compiler. They are making it, but it is not there, yet, and it won't be for a good few years
      c) Surprisingly hard to interoperate with f77 or C, becaused modules get funnly pre/suffixes all over the place...

      I used to hate fortran, but once you get used to type twice the amount of code you need it's actually quite usefull... It's internal rules allows it to paralelise much better. It has well tested implementations of linear algebra (matrices and crap). Two biggest drawbacks are: a) lack of dynamic memory allocation --- plain shit, nothing you can do about, b) everything is passed by reference - no recursion whatsoever, c) shit i/o handling...

    3. Re:Don't use Fortran 90. by Liquor · · Score: 1
      b) everything is passed by reference - no recursion whatsoever
      I hope that was menat as two separate, unrelated items. I wouldn't want you to be unnecessarily accused of overgeneralizing - but most old Fortrans allow recursion, you just need local variables to pass as arguments (or even using calculated values in most versions). Pass by reference in itself does NOT imply no recursion. Ancient lame compilers that statically allocate the argument data, however.......
      --

      Liquor
      Sanity is a highly overrated commodity.
    4. Re:Don't use Fortran 90. by FullyIonized · · Score: 4, Informative
      I can't believe the amount of crap being posted here, and this is fairly typical.

      a) lack of dynamic memory allocation --- plain shit, nothing you can do about
      You obviously don't know a thing about f90. Dynamic memory allocation is the first thing everyone converting an f77 code uses. Yes f77 is dated. Go pick up the f90 book by Cooper-Redwine and read the first chapter. Really, f90 is fairly clean.

      b) everything is passed by reference - no recursion whatsoever
      Inconvenient, but it makes for much easier optimization. For recursion, there are tricks in f90 now that allow you to overcome most of the obstacles.

      The compilers are unbeliveably crash and bad. And I've tried both Sun and SGI f95 compilers... Sucessfully segfaulted them both within a few days of using them... Funnily enough NAG f95 compiler for linux seems to be quite stable.
      I agree that Sun's f90 compilers are crap (although there f77 compilers are excellent), but SGI's is quite good. I use every advanced feature of F90 possible (derived types, pointers, allocatable arrays, operator overloading, etc.), and SGI's works quite well.

      c) Surprisingly hard to interoperate with f77 or C, becaused modules get funnly pre/suffixes all over the place...
      I've never had problems with f77 but I agree with about C. A bigger problem with f90 is that the array structure is compiler dependent. This was done to allow the compiler writers more flexibility in optimizing their code, especially for parallelization issues, but given the way high performance computing is moving (in the U.S. anyway), it is a pain.

      If you want to use f90 on Linux, I highly recommend the Lahey-Fujitsu compiler. This produces nice fast code with good error checking. They seem to focus more on Windows than Linux which I dislike, but it is still a solid product.
      Also quite good is Portrand Group

      Here is some recommended links from them that all of the "Fortran sucks" crowd should read: prentice

      In the U.S., the HPC community is clearly moving towards using C/C++ especially for the libraries (such as POOMA, Blitz,... that the parent poster mentioned). I've seen codes that have been POOMAized and they've run much slower than the original f90 versions. The POOMA guys talk about the fact that they will get their libraries further optimized, but it still remains to be seen. I saw a talk by the BLITZ people on how they are TRYING to get C++ as fast as C, which makes me think they should just use f90. My big complaint with these library writers is that they typically work with relatively simple problems -e.g., Poisson's equation- and then think that it will work for everything. I have yet to see a fluid code that uses these libraries and really fly.

      As scientific problems become harder, the associated numerical algorithms become harder, and the codes more sophisticated and flexible. So agree that f77 is inadequate for any modern, real code, but that is hardly news. While the U.S. HPC community seems to be focussing on trying to get C/C++ up to snuff, it seems that Europe and Japan are pushing f90 or high performance fortran. I personally think we (the U.S.) are heading down the wrong path.

      The basic reason why I use F90 is:
      I'm a physicist, not a computer scientist. Yes, I agree that you can have fast code with C, but it is much harder.

      --
      Sigs are bad for you.
    5. Re:Don't use Fortran 90. by mangu · · Score: 2
      Inconvenient, but it makes for much easier optimization


      The point is, exactly *how* much easier? Assume that F90 will get you code that's X% faster than the one you get with C++. How long will it take for CPUs to get X% faster?


      I programmed in Fortran from 1975 until 1985, but, after I learned C in 1985, I never did any new development in Fortran. I still use Lapack, called from C/C++ programs, but I have completely forgotten those FORMAT statements, thank Thor. The time I don't waste truing to do I/O in Fortran more than compensates whatever gain I'm missing in optimization, even considering that most of my programming involves heavy number crunching.

    6. Re:Don't use Fortran 90. by Anonymous Coward · · Score: 0

      Please keep in mind I'm not a computer scientist or a EE, so don't flame me if what I'm about to say is wrong :-)

      That said, I thought that, in fact, on today's processors, double precision arithmetic is *at least* as fast as single precision, simply because internally the processor does its number crunching in double precision and then casts the result to single precision, if asked to. Something to do with 64 bitness perhaps? (Don't processors have special purpose registers for floating point operations though?) Again, I'm not a computer scientist, so what I'm saying could be completely crazy. Care to enlighten me?

      Later,

      Paul

    7. Re:Don't use Fortran 90. by elvum · · Score: 1

      Many european physicists and physics collaborations are moving from F77 to C++ too. All CERN tools and libraries are currently being rewritten in C++, and many undergraduate courses (in the UK at least) have no Fortran teaching at all - students learn C++ from the outset.

      For large projects, I think the benefits of object orientation vastly outweigh the small loss of speed.

    8. Re:Don't use Fortran 90. by auntfloyd · · Score: 2

      Some posts further down recommend interpreted languages like Python and LISP (jeez!) for such applications. They must be joking.

      Lisp is not an "interpreted language" (if there even is such a thing as a *language* which needs to be interpreted). In fact, most open-source Lisp systems, as well as all commerical Lisps are compiled into native code.

      I find it hard to believe that many people seem to think that after 40+ years of existence, Lisp is still interpreted, as if Lisp users, developers, and researchers were incapable of doing any better.

    9. Re:Don't use Fortran 90. by Anonymous Coward · · Score: 0

      Yes it is an interpreted language, and sometimes called an interactive language. The very basis of Lisp is the read/eval loop.

      It just happens that you can also *bootstrap* and compile it. Compiled Lisp programs are just an extra bonus which makes the programs faster.

    10. Re:Don't use Fortran 90. by Anonymous Coward · · Score: 0

      Some of the people that I work with use fortran programs that run for two months. Even a 5% difference in speed means you get the answer 3 days sooner. And on tight project deadlines, that can be a lifesaver.

      -AC #5421

    11. Re:Don't use Fortran 90. by Anonymous Coward · · Score: 0

      No. Think memory bandwidth and cache hits.

      -AC #5421

  48. This is stupid beyobd measure... by Anonymous Coward · · Score: 0

    Can you read your iPAQ when the battery is dead? I can't. And as good as my iPAQ is for some things, that screen is just too damned small for reading.

    I much prefer books. You can annotate the hell out of them. Books don't crash. Books don't have issues with "alternate" operating systems. Books aren't subject to the whims of some funky piece of software that might just decide to stop working.

    And most importantly, when was the last time you replaced the missing leg on that old couch with an iPAQ?
    -- "It's just this little chromium switch here..."

  49. Welcome to the Real World by Anonymous Coward · · Score: 0

    It always kills me when these kids with snot still dripping from their noses enter the world of programming, and winder when they are going to get to program with the latest and greatest tools that they were promised in schools.

    You are entry level programmers. You will do entry level work until you are no longer the low man on the totem.

    More specifically, unless you are doing something that depends on the latest tools, like web development, then you will need to learn the legacy of where ever it is that you are employed. That is the real world.

    Anyone that tells you different, or tries to sell you a different job went belly up in the dot com bubble burst.

  50. I still shudder... by Subcarrier · · Score: 4, Funny

    FORTRAN has the same kind of cherubic appeal as a very very large hirsute man wearing a tutu.

    You can leave FORTRAN behind, but you can never forget it. Sometimes, I wake up at night, thinking about it -- wishing I didn't.

    --
    "I have opinions of my own, strong opinions, but I don't always agree with them." -- George H. W. Bush
    1. Re:I still shudder... by EnVisiCrypt · · Score: 2

      yes, and parsing through node trees in XML will *really* help the speed aspect of Fortran. Yep.

      Don't even get me start on CORBA...

      --


      *everything* is Orwellian to cats.
    2. Re:I still shudder... by EnVisiCrypt · · Score: 1

      Oops. Wrong thread.

      It makes for some good surrealist commentary, though, I suppose.

      --


      *everything* is Orwellian to cats.
    3. Re:I still shudder... by Anonymous Coward · · Score: 0

      Hey, I'm a very large (6'7" 317 lbs.) hirsute man, and you think you can tell me not to wear MY TUTU?
      Where did you put my TUTU?

    4. Re:I still shudder... by Anonymous Coward · · Score: 0

      There's a piece roaming the Internet, describing several programming languages as if they were women. The entry for FORTRAN reads:

      FORTRAN - Your grey-haired grandmother. People make fun of her just because she is old, but if you take the time to listen, you can learn from her experiences and her mistakes. During her lifetime she has acquired many useful skills in sewing and cooking (subroutine libraries) That no younger women can match, so be thankful she is still around. She has a notoriously bad temper and when angered will start yelling and throwing dishes. It was mostly her bad temper that made grandad search for another wife.

      To which I add:

      FORTRAN 90 -- Old Mrs. Fortran went out and got a brand new wardrobe in the latest fashions. But she's still your grey-haired grandmother.

      FORTRAN 95 -- Then she got a makeover, botox treatment, tanning session, and a wig. But she's STILL your grey-haired grandmother.

  51. I'm glad I'm not the only one..... by friedmud · · Score: 2

    I'm doing some consulting this summer for a company in my home town, and they have a VERY odd fortran implementation.

    It grew out of an old fortran (formatted type - probably f60 or so) program that was written by some guys in germany for calculating the size and price of heat exchangers. This company I work for has since decided it needed to have a web front end for this program and had a couple of engineers (this is the first problem - NEVER have plain vanilla engineers write code!) come up with a 'solution'.

    What they have now is a mess of ASP pages using VB dll's to call a Fortran 60/77/90 and C++ conglomerate program that ultimately writes ASP (yes! directly out of the fortran). All of this interfaces with multiple databases stored on both an AS400 and a Dell/Windows machine.

    IT IS A HUGE FREAKING MESS!! I was brought in to clean it up - and redo all the pricing. I have done what I can - but short of a total rewrite it is not going to get much better.

    Fortran needs to die a horrible death. It is soooooooooo ugly to look at and decipher (all of this code didn't even have branching statements in it - it just had a TON of GOTO's !!!).

    Just thought I would share my experience......

    Derek

    1. Re:I'm glad I'm not the only one..... by geekoid · · Score: 2

      Nope, fortran is much better then c/c++ for what it does.

      don't blame FORTRAN for the crappy way the "engineers" crated a web front end.

      I saved a company over a million dollars by creating a middle tier for a 3270 systems. It took me a week and 6 perl scripts.
      getting legacy stuff to the web isn't nearly as hard as peple think. Mostly, its done by "webmsaters" who took a course in cold fusion and think they understand programing, and have the gall to call themselfs 'engineers'. That is why people think its expensive and hard to do.

      this is why contractors should be paid 1/2 of there fee and not get the other 1/2 until the program is done and working reasonably well.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  52. Are you kidding? Of course it is! by mborysow · · Score: 1

    I'm an undergraduate in Physics at the University of Michigan. Both my parents are physicists and I work for one. What do my parent's use when they need something programmed? Fortran! What does my boss use? Fortran! What does my boss tell *me* to use? Fortran! Fortran is still a very useful (and relatively simple) language that's used very heavily in Physics. Lots of software coming out of CERN is programmed in Fortran. The primarily used Monte Carlo simulation code ( That's particle physics simulations ) GEANT is coded entirely in Fortran. As is another very commonly used in High Energy Physics software package called Paw (Physics Analysis Workstation). Most of the public and very often used software in physics that I've had the experience of working with is most definitely still in Fortran. I can't say the same for most proprietary software. But otherwise, Fortran is everywhere! Michael Borysow, University of Michigan

  53. Fortran optimizes well because... by coult · · Score: 5, Insightful

    ...of the simple loop structures. In C, you can have a for( ; ; ) statement that does basically all sorts of weird crap in here ( ; ; ), and you can also do things like pointer aliasing (impossible in Fortran since there are no pointers at all).

    Fortran loops, on the other hand, are very very simple - all you can do is increment the loop variable, and repeat. That allows for very heavy loop optimization by the compiler - comparable to what the best assembly programmers might be able to do. Furthermore, a Fortran compiler can more easily generate optimized loop code using vector instruction sets like Altivec or SSE2, whereas C compilers have a much harder time (again, because of the wide variety of loop structures possible in C, and things like pointer aliasing, etc.)

    --

    All is Number -Pythagoras.

    1. Re:Fortran optimizes well because... by Anonymous Coward · · Score: 1, Insightful

      There are other reasons, too.

      Two biggies are intrisic functions and subroutine calling standards. Intrinsic functions allow a compiler to inline more and re-use intermediate results between eg. sin and cos invokations (which are computed with similar power series). The fortran calling standard also disallows passing of overlapping arrays to subroutines (if you do it, your results are undefined). This enables a number of optimizations that C is not allowed to perform.

      I use fortran, c, and tcl daily (on alpha/tru64) at work, and they tend to be very complementary. You can write readable, maintainable, portable code in all 3. Of course, you can also write crap in all 3.

    2. Re:Fortran optimizes well because... by Milalwi · · Score: 2

      impossible in Fortran since there are no pointers at all
      Wow, we'd better stop using them in our F90 code, eh?

      One of the biggest problems Fortran has is a PR one. Everyone "knows" things like "Fortran has no pointers". A simple example from the Compaq Visual Fortran help:


      INTEGER, POINTER :: P, N
      INTEGER, TARGET :: M
      INTEGER S
      M = 14
      N => M ! N is associated with M
      P => N ! P is associated with M through N
      S = P + 5

      The value assigned to S is 19 (14 + 5).

      Milalwi
    3. Re:Fortran optimizes well because... by LeeA · · Score: 1
      It optimises well because it assumes/requires no aliasing.
      You can/could always alias by passing a variable (or an array) into a function twice. That is:
      f(a,a)

      This is illegal under the spec (at least up to F77), and the optimisers could work on the assumption that the variables were distinct.... a much easier job.

      Of course, using EQUIVALENCE could introduce the same type of aliasing.

    4. Re:Fortran optimizes well because... by Anonymous Coward · · Score: 0

      This point about aliasing is very important (but see my comments below, on how to partially overcome aliasing problems on C/C++).

      The majority of posts above assume that Fortran makes faster numerical code than C just because the compilers have been around longer, and hence squeeze more efficiency out of the program. But in fact, Fortran compilers on *new* architectures still can run through arrays faster than C, so it isn't just the maturing of the compiler.

      No, the main reason is that the Fortran compiler does not have to assume that any "store" to a variable passed as a routine argument might change the value of any other argument. Therefore it does not have to keep fetching values out of memory, but can just salt the argument values in registers, and run. This can gain you huge efficiencies, especially on architectures that have a lot of registers to spare.

      If you want to see the effect of aliasing in C, try writing a BLAS routine, like DAXPY, in C, but using Fortran pass-by-reference calling conventions. Then compare the speed to the same program, again in C, but passing the array length and strides by value instead of by address.

      You will see a significant speed increase, because when you pass by value, the compiler will "know" it doesn't have to worry about those integer values changing, so it doesn't have to reload them each time. You can verify this by inspecting the machine code. I have seen this on Linux-gcc, on Mac-Metrowerks, and on PC-MS.

      If you want to know more about these effects, jump to the ATLAS web site and read their background information there. This site will also give you hints on how to overcome the aliasing problem if you decide to use C or C++.

      Some time ago, there was talk about adding a "restrict" keyword to C. This would allow the programmer to tell the compiler that certain arguments don't have aliases. I have never seen the restrict keyword implemented, but some C compilers do have pragmas that accomplish the same thing. Read your compiler documentation.

  54. MATLAB C libraries by Anonymous Coward · · Score: 0

    Although I haven't used them personaly, MATLAB has linkable C libraries available for a lot of their highly optimized functions. Of course you have to purchase them, but you get away from having to use their script language which does indeed suck on recursive work. I started working on genetic algorithms in Matlab, but switched to C because the interepretative nature of MATLAB made things crawl. I just wrote my own library of functions that I used for the GA work instead of porting my MATLAB code to C and linked against their libraries.

  55. High Performance Fortran by QuantumFTL · · Score: 5, Informative

    It's obvious that the story's poster didn't really look into FORTRAN much past the aging F77.

    I currently use F77 to do research in magneto-hydrodynamics simulations of neutron stars on Cornell's Velocity Cluster (which has been featured on slashdot before). Fortran, due to its lack of things like pointers, etc, is rediculously efficient, and almost completely cross platform (because surprise surprise- it's very difficult to attempt to do anything remotely platform specific). The language is much simpler than something like C with pointers, etc, that must be messed with. Sure it's ugly as hell, but once again the newer versions of Fortran take care of most of these issues.

    I would suggest that anyone interested in high performance computing should check out High Performance Fortran. It's a set of extensions to the F90 language to allow the seemless integration of large-scale parallelization in your code. It also has several other performance advancements.

    I highly disagree with the poster of the story, Fortran 90 is much more modern than F77, including things like objects, safe pointers, better recursion, better array sharing, generic routines (a type of function overloading). The language syntax is also much more lenient than F77 (which was designed to work with punchcards). It also has some really great array operations (things like slices, etc) that are rediculously fast. While I absolutely hate F77, if I was going to write a computationally intensive simulation, I'd probably do so in F90 or HPF.

    A lot of people still use Fortran, especially computational physicists and meteorologists... Many of these people don't have time to learn new programming languages, and Fortran works very well for what they need, better in most situations than almost any other language. It's something to consider.

    Cheers
    Justin

    1. Re:High Performance Fortran by reverse+flow+reactor · · Score: 2
      We still use a lot of Fortran(90) for our computational work. We do a lot of chemical reaction engineering simulations - fluid dynamics, chemical kinetics, heat transfer, reactor design and transient behaviour. When a simulation runs on the order of 100 hours, you want and NEED everything to be optimized. Fortran runs much faster than C++ for our simulations.

      Argueably, Fortran has a terrible user interface. Granted - it is designed to solve math problems, not make a pretty interface. Some people in our research group have developed JAVA interfaces for their code, but the differential equations are stilled solved in Fortran.

      Each language has its strengths and weaknesses. Use C++ or Java for your GUI applications, and use Fortran for solving lots and lots of differential equations.

      --

      The significant problems we face cannot be solved by the same level of thinking that created them. -Einstein

    2. Re:High Performance Fortran by Anonymous Coward · · Score: 0

      I do a lot of heavy multivariate statistical computing for genomics research, and I agree with you that F90/95/etc. are very nice. They're relatively clean, maintain the native numeric orientation of F77, but without the nonsense of F77.

      The thing that keeps me from using F9x, though, is that there really truly is almost no user base for it. There are some individuals, but if you go into a public code library, or download someone's code off the web, there's a 99% chance it's written in F77.

      Also, as someone posted, F9x isn't THAT much cleaner than C++ or F77. So you're stuck with using something that almost no one else uses, without a dramatic improvement in syntax cleanliness.

      All of this leads me to serious psychological complexes. I stay up all night searching for the magical numeric computing language. So far I haven't found it.

    3. Re:High Performance Fortran by Anonymous Coward · · Score: 0

      As my father (who actually moved to Paris in 1967 to be near the then most powerful computer available to him) used to say, "if you're not doing molecular integrals, you're not computing".

      I learned my computational physics at the feet of Matt Choptuik , who is apparently just about the world's leading expert on computational relativity. He is a great advocate of Fortran, and libraries like LAPAK for linear algebra. he also however, preaches the gospel of making machine readable output which you then analyse with some other software. I for example,do simulations in loading of DNA for capillary electrophorsis. This requires solving the Navier-Stokes equation dC/dt=k*dC/dx with charge conservation and chemical equilibrium going on. My code just spits out big files of numbers, which I stick into Matlab and make animated plots of the time evolution of the system. Fortran has killer libraries for this stuff, and it's fast and can be run on whatever platform is lying around. Matt's crew uses open source graphics tools to look at their data, and like command line stuff like gnuplot. That lets them potentially run the program and then the graphic analysis all from the same shell script. Killer.

      I think people get upset about fortran because they're thinking of trying complicated stuff. Don't sweat it, it's only about the differential equations.

      Robin

  56. FORTRAN is the common denominator. by james_sorenson · · Score: 2, Informative

    I work as a controls engineer at the NASA Ames Research Center. Most of the nonlinear aircraft simulations are still written in FORTRAN. FORTRAN provides very robust mathematical libraries while making it very easy to parse text files. In other words, FORTRAN is ver good at taking a text document of flight data, and crunching it into a useful simulation. The main thing is that so many compilers and languages talk to FORTRAN. I do a lot of work in Matlab and C, and both can link to my FORTRAN code. I can pull up an old simulator from the early 90s, slap on an s-function or C-wrapper, and use the code in my new code. Of course, the question is: is new FORTRAN code being generated for reasons OTHER than to be compatible with the old code, or because it is the only language the crusty engineer knows? Well, it's a toss-up. Matlab seems to be making a lot of headway, especially since it's code is very C-like and can link to old code. But, the gnu g77 compiler means I can distribute my FORTRAN work to anybody with a Unix box. Not everyone has put out the cash for Matlab. My recommendation is to learn enough FORTRAN to understand the math and logic loop functions. This will be enough to be able to read old code, and to be able to write math subroutines to be linked to more modern code. I still have to write in FORTRAN, but it's uncommon that I ever write a stand-alone FORTRAN program with an interface or anything. It is mostly text-file and math subroutines for Matlab or C.

  57. Tools by Wrexen · · Score: 2

    Can it really be true that the best tool we have for heavy duty computing is a 25 year old language

    Can it really be true that the best tool we have for driving nails is a 3000 year old piece of wood with metal on the end?

    1. Re:Tools by Anonymous Coward · · Score: 0

      CLEARLY you have never used a nail gun.

      Next time you have a big job to do (new roof/deck/etc) go out and rent a comperssor and a gun. You'll never want to go back. Its SO much faster and easier than a hammer.

    2. Re:Tools by Mad+Marlin · · Score: 2

      Actually, I rather like nail guns myself, they are much faster than a hammer, and you don't end up hitting your thumb.

    3. Re:Tools by seann · · Score: 1

      I much prefer the ones with titanium on the end, with a lightweight alluminum shaft.

      Or the air powered varietys.

      --
      I'm a big retard who forgot to log out of Slashdot on Mike's computer! LOOK AT ME.
    4. Re:Tools by belroth · · Score: 2
      On the other hand you can't nail your foot to the floor quite so easily with a hammer... :-)

      Of course I'm trying to tie this analogy to having to use VB at work.

      --
      I hereby inform you that I have NOT been required to provide any decryption keys.
    5. Re:Tools by scrytch · · Score: 2

      > Can it really be true that the best tool we have for driving nails is a 3000 year old piece of wood with metal on the end?

      Or nail guns, as one poster put it. I might note the tremendous variety of nails, not to mention screws, and all the ways to drive them. For the truly heavy duty, we have welding and rivets. Then for the lighter duties, we have glue, velcro, and that tacky blue stuff. Not to mention all the neat movable fasteners out there, there's engineering companies that do nothing but come up with new ones. Draw your own parallels.

      'course, when all you have is a hammer...

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    6. Re:Tools by Anonymous Coward · · Score: 0

      ...?

      i've been a carpenter. we use nail guns. there's even hose-less ones. i never realized we were l33t.

  58. About to teach a numerical class... by jvmatthe · · Score: 5, Interesting
    I'm teaching "scientific computing" for the second time at my university this fall and we're going to be using FORTRAN with some C (and C++ if that's your cup of tea). The department here is somewhat slanted towards FORTRAN and C instead of scripted environments and there is some outright dislike of Matlab. In this sense, FORTRAN was worth knowing around here and I had to brush up on my skills, since I'd not touched it since spring of 1992.

    The course mainly focusses on solving machine numbers, solving linear systems (direct and iterative methods), solving non-linear systems (mostly Newton-type methods), and solving eigenvalue/vector problems. The codes that students wrote last year started from scratch with early assignments. Then, I allowed them to incorporate Basic Linear Algebra Subprograms (BLAS) into their codes. Then they were allowed to use LAPACK for the rest of the semester. They were free to use the C interface, but most chose to use the FORTRAN examples, probably because of the skeleton code that I provided.

    Given the tremendous amount of code that is already out there, I agree that knowing FORTRAN is an asset. And since it's not hard to learn, why the heck not, right?

    On a side note, they had to use Makefiles, LaTeX their assignments, and send everything to me electronically in a gzipped tarball. They got quite a workout in console tools. For reference, I had some that were quite familiar with the system and some that had had BASIC at some level and that's it. Lots of help was needed as the semester reached the final weeks.

    Matlab was used for visualization and graph creation, but I am considering using GNUPlot this year, if it is up to the task. (I think it probably is.) I may also encourage the use of Octave, where possible.

    For reference, the class website (which will soon be updated for the new semester) is here: Math 224.

    1. Re:About to teach a numerical class... by Anonymous Coward · · Score: 0

      Gnuplot is ok but for the graphing of data I think matlab still is better. It is easier ( even possible ) to rotate your plots interactively, easier to make movies from data ( say to visualize 4D datasets etc.

      I use both but normally find matlab can do more, but even better would be something like Tecplot. Octave is fine but it uses Gnuplot for its plotting so you still have the Gnuplot limitations

    2. Re:About to teach a numerical class... by sdr · · Score: 1

      For data visualization you may also want to take a look at R. It has much better support for plotting than Octave.

    3. Re:About to teach a numerical class... by joib · · Score: 2

      I'll second that. Although R is primarily for statistics (which is not my cup of tea), I use it for plotting because the plotting stuff in R blows gnuplot (and hence octave) out of the water, IMHO. Another useful free plotting tool that is widely used is grace, it has a nice GUI if you happen to like such things.

  59. Well, it's not a nice language, but... by teamonkey · · Score: 2, Interesting
    As many people have pointed out here - it can shift a serious number of uh, numbers.

    The language feels as though it's designed by a committee and has features tacked on left, right and centre. IO sucks arse, so don't expect to write a wonderful user interface for it (but you could always do a wrapper in another language, I suppose).

    I use F90 at uni, and although it's a bit of a messy language it does what it's good at: spewing out tables of numbers. It is expensive for a single licence, however. I wouldn't bother with it if I didn't have access to the university number crunchers.

  60. In a word... by Anonymous Coward · · Score: 0

    No.

    (Hint: +5 Funny)

  61. Err, big deal by Matthew+Weigel · · Score: 3, Interesting

    All we have is this "25 year old" language for numeric tasks, and another language that's about as old for system programming. It's called C.

    --
    --Matthew
  62. Ratfor at least makes it look better by Mr+Slushy · · Score: 2, Informative

    Fortran is truly ugly, if you need to write fortran, at least do it an ratfor (Rational Fortran) described by Kernigan and Plauger in Structured Programming.

    Ratfor adds "normal" structured programming constructs to fortran to make it readable by somebody less than 40 years old.

    You write code that looks like:
    for(i=1;i=100;i=i+1) {
    fortran code here
    }

    Ratfor generates:
    23002 if(.not.(i.le.100))goto 23004
    fortran code here
    goto 23002
    23004 continue

    I dont know about Linux, but ratfor is included in the FreeBSD ports.

    --

    S.E.S.S.D.E.N.E.E.NW from west end of hall of mists

    1. Re:Ratfor at least makes it look better by puetzc · · Score: 1

      As an engineer (not a programmer) who started with FORTRAN66 on punch cards (this Fortran77 stuff looks great!), I found the second section of code at least as easy to read as the first. It is both ugly and incorrect, however. First, at some point, the index variable needs to be incremented if you want to leave the loop at some point. Second, a .gt. would make much more sense than .not.(.le). Third, a DO WHILE loop would provide the modern loop construction that you want in standard FORTRAN.

      All compilers are tools; use hammers for nails and screwdrivers for screws. If you want a job programming for me, learn FORTRAN, as that is what all of my existing tools are written in. If you really want a job, learn to write friendly front ends in any language that will link to my existing code, in its fully debugged and trusted form.

    2. Re:Ratfor at least makes it look better by Anonymous Coward · · Score: 0

      Personally, I'd write it,

      DO i = 1,100
      ! Fortran code here
      ENDDO

      But that's just me.

      Even the F77 version looks better than what Ratfor generates:
      DO 10 i = 1,100
      C Fortran code here
      10 CONTINUE

  63. Blitz++ by Anonymous Coward · · Score: 0

    Blitz++ makes use of C++ templates to deliver near FORTRAN like speeds (and in some cases better).
    Don't be afraid of C++ templates - all this Blitz code stays clear of C++'s pointers, and are very easy to use.

  64. Real Programmers Use FORTRAN by Anonymous Coward · · Score: 1, Funny
    For your reading pleasure, I posting an excerpt from the story "Real Programmers Don't Use PASCAL" which should give you a hint of what you may be in for:

    The easiest way to tell a Real Programmer from the crowd is by the programming language he (or she) uses. Real Programmers use FORTRAN. Quiche Eaters use PASCAL. Nicklaus Wirth, the designer of PASCAL, gave a talk once at which he was asked "How do you pronounce your name?". He replied, "You can either call me by name, pronouncing it 'Veert', or call me by value, 'Worth'." One can tell immediately from this comment that Nicklaus Wirth is a Quiche Eater. The only parameter passing mechanism endorsed by Real Programmers is call-by-value-return, as implemented in the IBM\370 FORTRAN-G and H compilers. Real programmers don't need all these abstract concepts to get their jobs done -- they are perfectly happy with a keypunch, a FORTRAN IV compiler, and a beer.

    • Real Programmers do List Processing in FORTRAN.
    • Real Programmers do String Manipulation in FORTRAN.
    • Real Programmers do Accounting (if they do it at all) in FORTRAN.
    • Real Programmers do Artificial Intelligence programs in FORTRAN.
    If you can't do it in FORTRAN, do it in assembly language. If you can't do it in assembly language, it isn't worth doing.

    And my personal favorite:

    A Real Programmer might or might not know his wife's name. He does, however, know the entire ASCII (or EBCDIC) code table.

    The whole story can be found here.

    Take the time to become a "Real Programmer." You'll be glad you did.

  65. FORTRAN has its purpouse. by badoingdoing · · Score: 1

    I am currently using FORTRAN 90 to write Maxwell's Equations simulation code.

    At first I was a bit leery of programming in FORTRAN, but after a couple of months on the project I wouldn't start anything similar in another language. The array and mathematical manipulation capability of FORTRAN is just much better. FORTRAN 90 offers more readability than C, anyway.

    So yes, definately learn FORTRAN. For an experienced coder it should be the work of an afternoon to get the basics. The only problem is the output--it might take another whole afternoon to learn format statements.

    --
    sgi? gis? gsi? sig.
  66. MatLab is the shit... don't hate. by edrugtrader · · Score: 1

    i made this site using matlab about 4 years ago.

    matlab is VERY powerful, ESPECIALLY in for loops and recursive problems. any walls you are finding while writing MatLab scripts, well, you aren't trying very hard. i would even write MatLab scripts that would write Perl Scripts that would write MatLab scripts!

    --
    MARIJUANA, SHROOMS, X: ONLINE?! - E
    1. Re:MatLab is the shit... don't hate. by dukethug · · Score: 2

      I agree completely- Matlab is the bomb, and if you have to use loops in a Matlab program, you're a twit- it's a MATRIX based language. Use the matrices.

    2. Re:MatLab is the shit... don't hate. by Anonymous Coward · · Score: 0

      Matlab does some very nice things but matlab is not even comparable to Fortran.

      Matlab is a matrix language, its loops are extrememly slow. I cand code in C/C++ or Fotran with loops and get orders of magnitude difference in speed. Matlab is nice for vectorized problems since it has all of the matrix multipleication etc routines built in and is easy to work with, but still for speed it doesnt come close to Fortran and BLAS or LApack libraries.

      Also MAtlab is not necessarily useful in parallel environments like an MPI enviroment, where Fortran and c/c++ are generally your choices.

    3. Re:MatLab is the shit... don't hate. by edrugtrader · · Score: 2
      --
      MARIJUANA, SHROOMS, X: ONLINE?! - E
  67. Fortran is dead !! by Anonymous Coward · · Score: 0

    Try your stuff in Squeak (http://www.squeak.org) and then see if you come back :)

  68. It is still kicking by NorthDude · · Score: 1

    If it does the job.
    'nuff said.

    --


    I'd rather be sailing...
  69. Languages have very long lives by Ars-Fartsica · · Score: 2
    C will be around for at least another fifty years in some form. Java will be around at least another twenty years.

    With enough production code, you can essentially push a language's lifespan out to infinity.

  70. Try SciPy by drklahn77 · · Score: 3, Interesting

    SciPy is an open source python application that sits on top of quite a few C and Fortran libraries. It is specifically targetted at the scientific computing community, and its performance is quite good, even though it's still a very young product. It supports massively parallel computation, has a number of nice plotting and graphing features, and is completely cross platform. It also includes weave, which allows you to produce native C code from python.

    Best of all, it's python, which means the learning curve isn't as punishing as C++, for instance.

    The website for SciPy is:

    http://www.scipy.org/

  71. The right tool... by sjames · · Score: 2

    FORTRAN is still a useful language for engineering and scientific computing for several reasons.

    A very good one is that FORTRAN isolates the platform much better than C does. a real is a real is a real. At most, it's a matter of finding the appropriate compiler option.

    A great many people in the field know FORTRAN.

    Lack of issues such as pointer aliasing, etc, make automatic optomization and to an extent parallelization go much better in FORTRAN.

    C's history is one of letting the programmer optomize the code, FORTRAN has a stronger history of considering that the compiler's job (good for numerical programming).

    There's a lot of good, well used and tested code out there for FORTRAN.

    If your interests lie programming for scientific or engineering, especially HPC, FORTRAN is still a must.

  72. The right tool for the job. by astroboy · · Score: 4, Insightful
    FORTRAN is an extremely simple language; because of this, optimizers can go nuts, writing extremely tight code. If you're trying to do lots of intense number crunching, and performance is an issue, it really is the right way to go. FORTRAN 90 has some support for modular programming and gets rid of a lot of silly syntactic things which have been mentioned elsewhere (6-char variablenames, strict line formatting, etc.). That's why even Freshmeat has 29 FORTRAN-related projects.

    Having said that, when you're writing a large piece of code, much of the code probably isn't number crunching; its schlepping data back and forth between solvers, doing I/O, etc. For that, FORTRAN is fairly limited; so you use other languages.

    You use the right tool for the part of the code you're writing. We are working on a large simulation code; our numerical solvers are all in FORTRAN, and we have no intention of chaning that; however, we use other things (C, Python) for higher-level tasks. And this is how it should be. People who argue about `Language X rocks!' or `Language Y sucks!' Just Dont Get It. All the languages still in use are still in use for a reason -- they have certain things they're good at. And so you pick the right tool for the job.

  73. Why FORTRAN is still useful by Anonymous Coward · · Score: 0

    FORTRAN is still incredibly useful for high-performance code because, icky as the language is, it has a number of features that make it much easier to optimize than C, C++, or Java. FORTRAN doesn't have arbitrary pointers. When you pass pieces of the same array to a function the language definition says that the compiler can assume they don't overlap, which makes reordering array accesses much easier. These two are the key to effective optimization. Take a look in any compiler book; optimizing FORTRAN is fairly easy, optimizing languages with pointers is much harder.
    Finally, FORTRAN simply doesn't have a lot of abstractions that produce slow code, like dynamic dispatch. When you're doing high-performance computing, the constants in the running time of your program matter, and it's much easier to make the constants small for FORTRAN.

  74. Matlab ? What about R? by Anonymous Coward · · Score: 0

    If you find Matlab price prohibiting, what about trying R ? www.r-project.org !
    Alex :)

  75. Bullshit by Anonymous Coward · · Score: 0

    FORTRAN is used in high performance scientific computing because people in charge are too old to switch to something else.

    1. Re:Bullshit by KnightNavro · · Score: 1
      If you want to create a database of free source code for complicated chemistry and physics problems, I'd be happy to switch.

      I'm not attached to FORTRAN, but there's a ton of stuff out there for academic and scientific use that is constantly being refined and updated. Starting from scratch in a more modern language seems silly. Let me remind you, most people who use FORTRAN are scientists, mathamaticians, and engineers, not computer scientists. Building a program to do complex calculations from scratch is beyond most of them just as determining reaction dynamics is beyond a typical computer programer.

    2. Re:Bullshit by Mt._Honkey · · Score: 3, Interesting

      I'm a physics student working for an experimental physicist. He uses FORTRAN, so I use FORTRAN (only when I can't avoid it). You are right. Pythia (google search the word, and feel lucky) is a great program for simulating High Energy particle collisions (I'm doing Tevatron simulations in the background as I type), but since it was started a couple of decades ago, it's written in FORTRAN. They're trying to convert to C/C++ (can't remember which), but it's a multi-year project for code that's already written. They've put it off for so long because the FORTRAN code works just fine (for the most part). There are some memory considerations and interface issues that make them want to switch over.

      It will be nice when the finaly do.

      --

      Don't Bogart the fish sticks
    3. Re:Bullshit by CptNerd · · Score: 1

      "Refactoring" from FORTRAN to C is not hard, if you use a tool like "f2c" to process the FORTRAN source. I did that on a contract, and converted about 100 F77 legacy modules into C functions. The biggest problem I had was that they had written really bad FORTRAN, and it was faithfully translated into bad C code. There were lots of places where they were doing things like copying 55 characters into a 30 byte character array, which required me to do some rewriting of the generated C, but overall converting and repairing the code only took about 2 months total.

      f2c is also good to use since the terms of use for their FORTRAN I/O workalike libraries is very very open.

      --
      By the taping of my glasses, something geeky this way passes
    4. Re:Bullshit by Bush+Pig · · Score: 0

      Bullshit. FORTRAN is used in high-performance scientific computing because nothing else cuts it.

      --
      What a long, strange trip it's been.
    5. Re:Bullshit by Anonymous Coward · · Score: 0

      I don't know much about generators, but can your professor use EvtGen for some purposes?

    6. Re:Bullshit by Mt._Honkey · · Score: 1

      There are some that we can use. Pythia, Herwig, Bgenerator. I think I've seen EvtGen listed, but don't know anything about it. Pythia is really the one that suits our needs at the moment, but we may be switching to Herwig at some point.

      --

      Don't Bogart the fish sticks
  76. My Own Experiences on this Topic by jpgrimes · · Score: 1


    I've had the same problem and have tried several solutions to it.

    One fortran 90 is actually almost OK to work in. The problem is that many programmers create fortran 90 code that is really fortran 77 code with some new features being used. Unfortunately it still looks like f77 code. f90 (and even better f95) can be fine to program in as it takes care of many of the major flaws in f77. Plus it has many vector functions and is the fastest code out there (that I have come across). However f90 is not free for linux (that I know of) although it does come with most sun & alpha machines.

    Personally I love matlab. You can even call it from C (although I haven't benchmarked that). I disagree that it is flawed for serious programming although it does appear that you can't optimize the code as easily. Anyway I love matlab and the ease of which it graphs goes along way to saving you a lot of time when examining your output.

    I dislike idl immensely and agree that c, even with libraries, doesn't really cut it for serious number crunching.

    Another free possibility is PDL. I quite like it although performance is an issue. Its very fast to develop in although it is always a work in development when it comes to its feature set.

    Hope this helps

  77. think about Scheme by fozzy(pro) · · Score: 0

    Scheme is a solid language taht is very fast. It has excelent math precesion and isn't very difficult to learn. Looping structures are available as the language is ideal for recursive solutions. Check here for more info. If i remeberfree versions are avaialble for you to try them. The precesion is excelent.
    Although many peopl will go Scheme what, sometimes the best solutions are more obscure.

    1. Re:think about Scheme by ganiman · · Score: 0

      I had to do a project in Scheme for one of my CS classes. I hate Scheme! But it is very easy to learn, and good for AI.

      --
      geek n performer who performs morbid or disgusting acts, as biting off the head of a live chicken
    2. Re:think about Scheme by Vengie · · Score: 2

      After having taken yale's cs 201 and taught it twice...i have developed an intense love-hate relationship with scheme -- suffice it to say, it does _NOT_ solve the problem in the orig. post.

      --
      When in doubt, parenthesize. At the very least it will let some poor schmuck bounce on the % key in vi. (Larry Wall)
  78. Benefits of FORTRAN, C by GodLived · · Score: 1
    It used to be that Fortran held the market on formatted I/O parameters; you had Hollerith output, spaces, tabs, etc. which made it good for reading pregenerated ASCII reports.

    When I switched out of engineering and into computer science, I found that C's (and C++'s) printf/scanf supported the same rich lexical scanning constructs but did it in a different manner.

    Some reasons to use FORTRAN: legacy maintenance, well, that's all I can think of; if you want to link to numeric libraries written in FORTRAN but compiled, you can do that from C.

    Some reasons to use C: faster, available on all platforms, and very readable. The line numbers in FORTRAN and indiscriminate GOTO's makes it hard to trace program flow. C encourages gotoless coding practices and, IMHO, is easier to read.

    If debugging is a problem for you, I'd wager you have a lot of memory problems - undefined references, bus errors, and such. Use Java if you can, it combines readability with automatic memory management. Not sure how rich the libraries are for numeric, but you can use JNI to link to some FORTRAN ones if you absolutely have to.

  79. F**k is a swear word even in Fortran by 4dGirl · · Score: 2, Funny

    Back when I used to work in a University Maths department we used Fortran almost exclusively. Because its quicker and easier to code up most math problems in Fortran rather than C and because of the extensive numerical libraries available. The compiler we used would tell you off if you used swear words for your variable names. So of course our favourite game was looking for expletives that the compiler didn't know about. Some of them got pretty inventive!!

    --
    No sigs please, I'm British!!
  80. outperform "c" by Anonymous Coward · · Score: 0

    by clever usage of pass by value, right?

    Nice try on the optimization, though.
    My guess is that they can both be optimized
    pretty much equally. Care to back up your
    argument with a reference; I'm ready to be schooled.

    1. Re:outperform "c" by drudd · · Score: 2

      There are two reasons why fortran generally outperforms c...

      1) Language differences: when you use pointers in c it is always difficult and sometimes impossible for a compiler to know in advance what you are doing, and thus can't necessarily optimize it. Fortran also has constructs which are easily vectorized and parallelized, taking better advantage of the hardware.

      2) the fortran compilers on most platforms are more mature, and the optimizing algorithms for fortran are well documented and have been studied for longer.

      Doug

      --
      Venn ist das nurnstuck git und Slotermeyer? Ya! Beigerhund das oder die Flipperwaldt gersput!
    2. Re:outperform "c" by Beckman · · Score: 1
      1) Language differences: when you use pointers in c it is always difficult and sometimes impossible for a compiler to know in advance what you are doing, and thus can't necessarily optimize it. Fortran also has constructs which are easily vectorized and parallelized, taking better advantage of the hardware.

      This is exactly correct. This is especially important in RISC based systems. The post-RISC, if my understanding is correct, improves CPU's ability to predict commands, although I'm not certain how much better it is.

    3. Re:outperform "c" by epperly · · Score: 1

      FORTRAN has different aliasing rules than C. If you
      have
      subroutine foo(x,y)
      double x(10), y(10)
      FORTRAN assumes that x and y refer to distinct arrays (i.e., you can't modify an element of y with an assignment to an element of x).
      If you have
      void foo(double x[10], double y[10])
      C assumes that x and y can overlap (i.e., modifying an element of x can change an element of y).

      Language differences such as this one allow FORTRAN compilers to do a better job. With the introduction of the restrict keyword in C99, C compilers have a chance to match FORTRAN performance.

    4. Re:outperform "c" by Anonymous Coward · · Score: 0

      The writer of this statement almost certainly has something like a Cray or competitors in this class in mind.

      If one wants references to back up the statement that Fortram outperforms C, just read the Cray Language Reference Manuals.

      In the case of Fortran, the Cray vectorization and parallelization pre-processors are so good that almost everything that will logically vectorize or parallelize is handled automatically by the pre-processor and compiler.

      In the case of C or C++, when you read the manuals, the first thing you will note are all the warnings, "Don't use this loop construct or it won't vectorize!" or, "Don't use this pointer construct or it won't vectorize!", etc., etc.

      It has been remarked that if you alter C code until it all optimizes as well as Fortran, then IT LOOKS EXACTLY LIKE FORTRAN, i.e., no more complicated pointer use, only the most straightforward types of looping syntax and the simplest data types.

      If you want C to outperform Fortran, throw away all of the useless "features". These are just traps leading the programmer into writing bloated, slow code, not to mention buffer overflows!

      C is a lot like Microsoft, with lots and lots of "features", many that are not really needed and many that are actually dangerous.

  81. Re:Are you kidding? Of course it is! by Anonymous Coward · · Score: 0


    the best advice you will ever hear:

    never, ever leave Ann Arbor.

  82. Perl is a good option for this sort of thing by ajs · · Score: 2

    Perl has some handy features in this respect. It's a nice high-level language in its own right, and the Perl Data Language module (PDL) provides access to some very nice numerical and binary data libraries including some that are written in FORTRAN.

    I know Perl seems too high level at first, but give PDL a try. It's well worth the investment of time to get to know it.

    1. Re:Perl is a good option for this sort of thing by Anonymous Coward · · Score: 0

      One wonders whether the correct moderation for this post is +1 Funny, or -1 Troll...

    2. Re:Perl is a good option for this sort of thing by ajs · · Score: 2

      Clearly, you've never used PDL. Go try it out, and then we can talk.

  83. the truth hurts by MORTAR_COMBAT! · · Score: 2

    spent 5 years of my life learning software patterns, algorithm analysis, multithreading, etc, etc.

    what do i get to do? technical document reviews. unit test code for ancient C programs.

    it gets better.

    batch scripts. shell scripts. adding layers of kludge to older layers of kludge.

    but at least they pay me the same as if i were doing all the exciting tech i wanted to do. but there's only so much you can take of shell and batch scripting before you go completely insane, and open a new /. account with all caps, based on some computer game...

    --
    MORTAR COMBAT!
  84. Well, there is Pascal... by skintigh2 · · Score: 1

    When coding for fun, I almost always start out in C as I like to keep my marketable skills sharp, but I usually end up in Delphi (visual Pascal).

    C just requires more babysitting than I am prepared to give. I don't like having to hold the compiler's hand every time I send a variable or pointer somewhere, or have to flip through a reference manual every time I want to use a simple bitwise operation. Typically, I spend 2 hours debugging really bizare behavior (crashes after commenting out a printf, etc.) before switching to Delphi and having completely re-written and running code in 45 minutes.

    It's sooooo nice in pascal to just type "xor" when I want to use an xor instead of looking up some gibberish (%% or && or ^% or something, who knows)

    1. Re:Well, there is Pascal... by drxenos · · Score: 1

      Is this guy for real?

      --


      Anonymous Cowards suck.
    2. Re:Well, there is Pascal... by Anonymous Coward · · Score: 0

      Probably just a troll... or someone who just doesn't know how to code in C.

    3. Re:Well, there is Pascal... by GodLived · · Score: 1
      If he/she is trying to "keep my marketable skills sharp," yet writing simple code with printfs results in "debugging really bizare behavior," then perhaps they're in the wrong market.

      Now, nothing personal, this is pure professional criticism, but the thought of folks like this sickens me across many levels:

      1. They pick a languange purely for the marketable skills potential, not for fitness of purpose;
      2. Resumes never reflect true competency in a skill, and HR departments can't tell the difference because they lack expertise (quasi-understandable);
      3. As a result, I end up having to work with these bozos who stay in a job just long enough to create incomprehensible code that I have to then go back over and fix mere hours before a deadline.

      Learn to program, learn to debug, and learn to tell when you should be giving advice to others and when you should keep your mouth shut.

      C is perfectly acceptable for many uses, and Delphi I'm guessing is also good - but choose it for the right reasons, please, for all our sakes.

    4. Re:Well, there is Pascal... by dilute · · Score: 1

      So Delphi lacks multiple inheritance, templates, multi-platform universality and few other things, but take a look at the tight code it generates (and run a few benchmarks) and you'll see it is a very impressive language.

      It is just happens to be easier to code in than C, that's all.

      If you are doing throwaway or one-of-a-kind applications on the PC, Delphi is definitely a nice way to knock them off.

  85. Don't believe everything (anything?) you read here by Anonymous Coward · · Score: 0

    As a heavy user of F90, and a frequent user of F77, C, C++, and perl, (all in heavy duty parallel and serial computational materials science) I can tell you:

    There are no systematic speed advantages to FORTRAN over C or C++, no matter what FORTRAN zealots might claim. Check out, e.g. Dr Dobbs Journal from Nov 1997.

    There are, indeed, lots of good FORTRAN oriented numerical libraries. This might be the only good argument for FORTRAN left. Compatibility with colleagues from the stone age is another.

    old-fashioned F77 is unusable - predeclared variables, common blocks, and no checking for parameter passing into subroutines will cause many more bugs than C/C++ pointer issues if you're moderately competent with C/C++. Fixed format source and short variable names pretty much guarantee unreadable source, too.

    F77 plus extensions is marginal.

    F90 is perhaps barely usable. You get free source format, dynamic memory allocation, structures, namespaces (sort of), and checking of variable passing into functions. No way to override the latter when it's useful, though. Also NO void *. This means, e.g., no generic communications or I/O routines. F90 pointers are schizophrenic, too. I now hate F90, but I'm locked in by my own legacy code.

    In conclusions: use C/C++. You might need to avoid SOME C++ programming techniques, but it'll still be much nicer/more efficient to code than F90, and at most insignificantly less fast. You can almost always call the FORTRAN libraries if needed.

  86. Hi by Anonymous Coward · · Score: 0

    Yo daddy teaches at a university in the UP. Good guy.

  87. King among parallel processors by StrikerGold · · Score: 1

    You use the right tool for the right job. You don't use a table saw to slice a pizza. In the same way you won't use Fortran in Web design, you will NEVER use Java for massive computational tasks. I'm in the field of physics and astronomy and I'm as old as Fortran 77 itself. It is still being used today, specifically if you have a million point model of a galaxy that you are going to run one simple calculation on over and over again. If you have a dual processor machine, or a massively parallel machine, Fortran is optimized for such tasks and such hardware. Also, I find it necessary to know Fortran and C/C++ and IDL, so I can utilize old, yet optimized Fortran code of my professors' with new "fancier" code I write today.

  88. Say what you will about old languages... by frank_adrian314159 · · Score: 3, Interesting
    ... but they knew what they were about. COBOL was about records and batch processing, Fortran and APL were about arrays and procedural programming, SNOBOL was for strings, and Lisp was about LISt Processing. These languages, although having expanded their paradigms, are still the best ones for doing those types of tasks. They (Lisp and COBOL, in particular) have seamlessly integrated more paradigms and are fully usable.

    Also, despite what you say, well formatted Fortran code is no more ugly than most other code (and a hell of a lot nicer looking than your average Perl code :-().

    I don't know why people believe that newer languages are automatically better. At the end of the day, you got storage, you got ops screwing around with the storage, and you got a mess of control flow holding the guts together. Just because I'm some hotshot wanting to get my name in the (geek-) papers with my shiny new syntax doesn't mean it's any different. And it certainly doesn't mean it's any better.

    So go ahead and learn Fortran. Learn about the joys of representing linked lists as a set of next indices into an array. Learn about dimension statements and equivalence blocks. Learn how to squeeze down your numeric processing into the nub of a kernel of procedural truth. You'll end up being a better programmer.

    --
    That is all.
    1. Re:Say what you will about old languages... by dvdeug · · Score: 2

      SNOBOL was for strings, and [...]. These languages, although having expanded their paradigms, are still the best ones for doing those types of tasks.

      Is SNOBOL still the best? Ralph Griswold (its creator) no longer thinks so; he created Icon (sort of an advanced SNOBOL with Pascal/C'ish syntax) as a replacement.

  89. U.S. Gov, science, engineering all use the crap... by Anonymous Coward · · Score: 0

    I *hate* FORTRAN.
    My main reason for disliking FORTRAN, aside from the complete lack of structure provided/enforced by the language and the true spaghetti nature of most FORTRAN code ( written by engineers or scientists with no interest in the poor saps who have to read/maintain/port/bugfix their code later and little if any notion of good coding practices ) is the fact that I *HAVE TO* read, port, and maintain FORTRAN code.

    The US Government ( FCC, various other gov't branches ) is addicted to FORTRAN, even writes *new* FORTRAN code, and still uses FORTRAN originally developed in the '50s. IMHO, there is no good reason to use the language - I mean, certain math operations might be pretty fast, but what the hell kind of processor are you running on, anyway?? I'd much rather use C, Java, Objective-C, or even crufty C++...

    Unfortunately, FORTRAN, like DOS, will survive forever, like cockroaches; they'll still be kicking after we've nuked humanity from the face of the planet.

  90. Other alternatives by the_Librarian · · Score: 1

    You can't forget the hairstyle-intensive programming language FROTRAN, and the symbolic Ebonics notation language FO'TRAN. ;)

    --
    -- the_Librarian
  91. Give Sisal a look... by jejones · · Score: 2

    Check out Sisal.

  92. Fortran 90 doesn't suck that much. by Anonymous Coward · · Score: 0
    I just finished writing a piece of fortran 90 software. It was a astronomical program calculating orbittrajectories. It is very computational intensive.

    My opinion is that fortran 90 is for straightforward numerical problems. By straighforward I mean simple program structure not the codesize. (My program is about 4000 lines, not much anyway)

  93. real programmers... by jfessler · · Score: 1

    can write a FROTRAN program in any language.

  94. Still in widespread use for MonteCarlo simulations by Imabug · · Score: 2

    FORTRAN is still very much in use by people I know that do lots of Monte Carlo simulations. Lots of people also write most of their code in C, but end up linking to FORTRAN libraries that contain routines that do the computations.

    EGS (Electron Gamma Shower) in particular uses it's own variant called MORTRAN, which gets interpreted and converted to FORTRAN code for execution. MORTRAN is basically a high level set of routines that encapsulates the routines that do all the work.

    --
    "For I am a Bear of Very Little Brain, and Long Words Bother Me"
  95. Just when you thought it was safe... by jalefkowit · · Score: 2

    Is FORTRAN still alive? Check this out and learn the meaning of Fear:

    (Yes, you read that right. FORTRAN.NET. Flee! The Seventh Seal has been opened!)

    1. Re:Just when you thought it was safe... by geekoid · · Score: 2

      "Flee! The Seventh Seal has been opened!) "
      exactly, where would one flee to?

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    2. Re:Just when you thought it was safe... by Anonymous Coward · · Score: 0

      http://www.lysator.liu.se/c/

  96. Language Zealots by drxenos · · Score: 1

    I hate language zealots of all types. All languages have their good points, and most bad points people bring up are biased, uninformed, specious, or just plan ignorance. I never meet a language I didn't like. Well, ok, I don't like Ada...

    --


    Anonymous Cowards suck.
  97. Forgive the old timer. by FreeLinux · · Score: 5, Insightful

    I see these annoying questions all the time. "Don't tell me that a 30 year old whatever is the best we have!" Alright, I won't tell you. But, I'll tell everyone else, Fortran is sometimes the best language for the job, even after 30 years. It is simple, fast as hell and very robust. What's wrong with that? Oh, you can't write a gui in it or you can't have derived object classes? Tough, that's not what it was designed for.

    Why is it that the age of a language or tool is associated with it being inferior? Do you feel that everything that was created prior to your birth is inadequate or inferior? It is in fact, very common for the earliest versions of many things to be far superior to newer ones. This is true, not just for for languages but also for many other things. Most often, the "improvements" and "advances" that are made cheapen, dilute, complicate and destabilize the original product. This is, at least partly to blame for the disposable society that we live in today. Better, or smaller faster cheaper, usually also means less reliable and durable.

    To answer your question, yes. Fortran is still a very viable language and is still, after 30+ years, the best language for heavy number crunching. If you need to create a gui and have derived oject classes as well, just link to the fortran libs. But, I'm sure that some snot nosed whippersnapper will suggest that Perl is the only solution. Puhleez!

    1. Re:Forgive the old timer. by Vortran · · Score: 2

      Actually, I think what was created BEFORE Fortran is superior. It's called machine language. That's right folks, straight binary. One bit at a time, baby! I remember programming a Dyna 8080A processor with a row of toggle switches.

      Seriously, though.. there is a philosophy that says anyone should be able to write programs and that there should be tools available for ordinary folks to create computer programs. The other philosophy is that "ordinary folks" have no business writing software and that if you can't hack it in assembler or C, you should get a real programmer to write the code.

      Which philosophy are you inclined toward?

      Quite frankly, I like C. I like it because:

      - People still learn it. Folks that have programmed for 20 years as well as the snot nosed whippersnappers know C. I don't hear people saying, "C is dead" like I do other languages (e.g. FoxPro, Progress, Fortran, Actor, COBOL, JCL, RPG, PASCAL, LOGO, Rexx, Ada, Lisp, SmallTalk)

      - It is typically compiled to native processor code instead of interpretted, and therefore typically faster.

      - I can usually find a free-as-in-beer compiler for whatever platform I need to write for

      - I don't need to deliver a pile of runtime code or expect the user to have the x.x.x.x build nnnn version of the libraries or VM to run my software. I simply deliver a machine native executable, and it runs. (Of course .Net and the M$ clr will see to it that I can no longer do this.)

      - C is C. C code that is 20 years old compiles and runs without modification.

      - Lastly and most importantly, with C I can do absolutely anything. There are no obstacles whatsoever. There is nothing "unsupported" in C. If I can think it, I can use C to implement it.

      Java is starting to look good, actually.. especially with the business world's love affair with everything Microsoft on the desktop and Microsoft doing everything in its power to make sure no one can write a program that runs in their OS without buying additional licenses.

      Bottom line: if you like Fortran use it for yourself, but don't expect to find a cadre of readily available people with the skills to maintain it. Fortran is wonderful for the original poster's use. The problem is when his little Fortran ditty becomes a mission critical application that has grown into a many-thousand-line monstrosity and he quits, retires, or dies.

      I know of a 66 yr old RPG programmer that is making 6 figures maintaining AS/400 code. Why? Because there aren't any snot nosed whippersnappers that want to learn it.

      Vortran out

      --
      Knowledge is like ignorance.. too much can be just as bad as not enough.
    2. Re:Forgive the old timer. by Anonymous Coward · · Score: 0
      Of course .Net and the M$ clr will see to it that I can no longer do this.
      I'm not sure if you were merely being facetious, but not actually. You can continue to compile your C programs in VS.NET.
    3. Re:Forgive the old timer. by NeuroUk · · Score: 1
      >Oh, you can't write a gui in it or

      oh yes you can - I did several GINO-F based fortran progs icluding one with a crudeish GUI using a pen and tablet as the input mechanisiam and a tektronix display as output.

    4. Re:Forgive the old timer. by Vortran · · Score: 1

      Not if I don't buy VS.NET and/or a digital certificate. The new M$ operating system will eventually not run native exectuable code, only .NET pcode that utilizes the M$ common language runtime.

      We'll see what happens, but as I understand the going plan, if I want a program to execute in Longhorn, I'll need to buy VS.NET or something expensive from M$. I don't think I'll be able to use a free-as-in-beer compiler.

      Am I mistaken about this?

      Vortran out

      --
      Knowledge is like ignorance.. too much can be just as bad as not enough.
  98. Why not? by chickenwing · · Score: 1

    Learning a new programming language never hurt anyone. Once you know one imperative language, learning others is relatively easy. It is a good exercise and entertaining. Also, you will be in a better position to evaluate the pros and cons of Fortran if you actually know it, rather than listening to other zealots do the typical Fortran vs. some other language. Also, since there really isn't anything in Fortran that is different than your standard no-frills programming language, it isn't a mindf*ck to learn.

  99. Right Tool for the Job by 4of12 · · Score: 3, Interesting

    I've known FORTRAN since...well...for longer than many slashdot readers have been alive. Done big, numerically intensive projects in it for many years in the 1980s.

    I've also done C (1990s) and C++ (2000s).

    Ten years ago the criticism about speed was true - that compiled FORTRAN would beat C++ to pieces. Not anymore, unless you're committing newbie mistakes in C++.

    If I were you I'd make the best of all worlds. I'd use Python for upper level logic in a clean syntax, in a quick scripting environment.

    Then, if there's numerically intensive loops in the lower reaches of your code that get executed billions of times, go ahead and use FORTRAN. Especially when you're doing something like computing eigenvalues for specially shaped matrices, etc., where chances are someone has already written a FORTRAN subroutien to do it well.

    Finally, use something like SIP or SWIG to connect the upper level Python to the lower level FORTRAN. Look, too, at Numerical Python and SciPy for others that have been down this road.

    There's a lot to be gained from all those netlib routines that have withstood the test of time and been optimized to such an extent that even the FORTRAN programmers surrender, and drop down to call BLAS routines that are best written in assembler.

    Using FORTRAN for the whole project is asking for pain once you start looking at things like parsing character input, connecting to network, linking into system libraries written in C. Been there, done that, have the scars.

    --
    "Provided by the management for your protection."
  100. Why lisp of course! by Anonymous Coward · · Score: 1, Informative

    I'll get flamed for this but a nice choice, particularly if you want recursive computing, is Lisp. Lisp was not really designed for heavy computational use but it did find its niche in AI which is heavily mathematical in its algorithms. There is a lot of numerical library code floating around out there though you will find none at netlib. clmath is a nice math library that can be found here and there out there. Lisp is slow you say? BS. It is fast for development, fast for testing/debugging, and yes...it is fast to execute. Lisp can be both interpreted and compiled. Interpreted means fast testing. Compiled means fast execution. One implementation of lisp (cmucl) is actually faster than C or fortran in many instances. Personally, I use clisp but that is because it compiles on OS X out of the box for the most part. Well, that's my advice. It's nearly as old as fortran but still a great great language.

  101. Re:Yes: LET ME MAKE IT AN EMPHATIC NO by pretygrrl · · Score: 1

    Fortran is SUCH A pain to troubleshoot.
    Its very easy to make mistakes
    Its easy for mistakes to go unnoticed.
    Typically used with legacy systems, you end up dealing with INCOMPREHENSIBLE manuals.
    However much you try to comment in your program, it will be pretty much of 0 value to anyone else.
    Dont do it......

    --
    Contemplate the marvel that is existence, and rejoice that you are able to do so.
  102. Use Java by TheLastUser · · Score: 1

    Compared to C and C++ its going to be slower, but against interpreted languages, like python and perl, its going to be much faster in the loops.

    It is an easy language from a coding standpoint. Not nearly as dangerous as C and C++, so you won't spend all your time looking for "stacks in my structs, arrays in my queues; I got the segmentation violation, core dump blues" -mod-fortune.

    You can compile Java to native code, if speed is of paramount importance, and it has thread support built in. Does FORTRAN have thread support? On a multi-cpu system this might make all the difference.

    In short, I would sooner code VB than take up FORTRAN again. I would rather deal with C, hands down. I coded once in FORTRAN 77, back in 1988, even then it was archaic, but it was all the VAX understood.

  103. It's really not that bad. by DenOfEarth · · Score: 1

    I was thrown into a project that was written completely in fortran, and considering that my native language is C++, I was a bit nonplussed at first.
    I find, though, that it really isn't that much different than writing procedural C or something like that. I suppose you can complain about it for certain things (memory allocation is a bit of a pain in the butt), but for the most part (for what I'm using it for, Computational Electromagnetics), it works absolutely fine.

  104. But for real mathmatical programming by Anonymous Coward · · Score: 0

    "There are two things a man must do,
    Before his life is done...
    They're write 2 lines of APL,
    and make the buggers run!"

    I did a good amout of Fortran and Algol in the late 70's/early 80's for CAD software... then I got into APL for simulations, auto-place and route, and DRC. If you're doing compex array or matrix programming, you can't beat APL. Multiply one x-dimensional matrix by a y-dimensional matrix using only one operator... fun stuff, especially for 3 dimensional vector graphics!!

  105. Use Matlab by Atomic+Frog · · Score: 1

    If you don't think it will cut it, then you probably don't know how to use it. Matlab has plenty of constructs for doing loops.

    Also, there are often times when you DO NOT want to use loops with Matlab. For example, you may create a loop to do matrix multiplication, but you don't do that with Matlab, because it's already been optimized to calculate such stuff. In fact, anytime you can perform an operation with vector math instead of looping, it is _much_ faster.

    Did you know you can also compile to C code with Matlab? Is that enough for you.

    You have to think about what your target problem is. There are many professors in my department, most have switched OFF of FORTRAN. Why? My favourite quote from one guy (old guy), "I used to spend 2 days programming and debugging. Now it happens in 2 hours with Mathematica"

    I feel the same. I get my work done much faster using Matlab/Maple/Mathematica. I don't care how fast the code runs, because the END RESULT is completed much more quickly.

    If you don't want to pay for Matlab, Octave is free (and GPL).

    There are times when you may still want to use FORTRAN, but that is if the program is relatively short and simple compared to the run-time. Also, for particular fields (e.g. particle physics), there may be "pre-done" routines in FORTRAN for analyzing data a certain way.

    In general, I'd recommend staying way from it if you can.

    1. Re:Use Matlab by Knacklappen · · Score: 1

      I totally agree with you and all the others out there who promote Matlab - a great tool! And all the available toolboxes (like Simulink) certainly don't make it less desirable...

      One guy recommended using C++ together with specialised toolboxes... no need for this with Matlab! Sure, if you only need to do something once or twice, the price tag is an obstacle. But in the industry it's often more costly to have an engineer using 2 more weeks on a problem than coughing up the money for a license...

      --


      Excellence: Moderate (mostly affected by comments on your karma)
    2. Re:Use Matlab by Anonymous Coward · · Score: 0

      While being able to do RAD programming with a language like matlab is nice, it is not always the right solution.

      I might be able to wirte matlab code in an hour or 2 and take 2 days to write compiled c or fortran code, but if I need something that could solve in seconds very large problems matlab will never be the choice for that.

      I work in high dimensional mathematics, doing huge monte carlo simulations and high dim inegration. Matlab is useless for this. I've used it, can program very well in it, but looping in matlab is horrendously slow. Furthermore I can parallelize my code for a beowulf cluster and slove problems in parallel even faster.

      There as many such problems that need to be solved quickly, not necessarily coded quickly. Eg, quantitaive finance problems are a perfect example. You need results in seconds not hours and you will reuse this code frequently. It doesnt matter that your matlab code was built faster, cause it doesnt do the job.

    3. Re:Use Matlab by loudici · · Score: 1

      Matlab does not run on big iron. Big problems need big iron.

      --
      Dev elpizw tipota, dev phoboumai tipota eimai lephteros http://euclidian.org
  106. Fortran and Open Source for a big project by imr · · Score: 2

    Here you can find a project of the french compagny of electricity (state monopoly) that went open source for every one to use and contribute to.
    And it's not a dead project that they would kinda release, it's alive and already interresting a lot of less rich countries specialists.
    Some dig it.

    1. Re:Fortran and Open Source for a big project by Anonymous Coward · · Score: 0
      Here [code-aster.org] you can find a project of the french compagny of electricity (state monopoly) that went open source for every one to use and contribute to.

      Not for everyone. The page is in French, which leaves out all of us except some Quebec-ers and the denizens of francophone Africa.

      Since it is in French, I can't tell what the licence is, or even if it has anything to do with Fortran. Since there seems to be no link to an English version, it appears that the nice folks who are doing whatever it is want to keep it in the French ghetto.

      And it's not a dead project that they would kinda release, it's alive and already interresting a lot of less rich countries specialists.

      Francophone Africa would count as ``less rich'', I'm sure.

      Some dig it.

      I might, too, if it wasn't for their rather exclusionary choice of language.

      Goodness knows, we NEED a good GPLed Fortran 90 compiler, and it's looking as if g77 might never get to g90. Unfortunately, this (even if it has acceptable licensing, and really is Fortran-XX) probably isn't going to fill the bill outside of France.

      If there IS a version which accessible to the vast majority of the world, please point us to it.

  107. Fortran 90 by ErfC · · Score: 2
    I don't know much about optimization for various languages, but I can attest that Fortran 90 has everything you'd really need in a language. It's not object oriented, but I've never needed that. It does do structures nicely, and it has nice looping features (like the ability to name loops) that help things to be clear. And it's got functions and subroutines and modules and things. Of course it's still possible to write illegible code, but it's actually possible to write good clean code, too.

    (This is unlike Fortran 77, where for example there are certain tasks that cannot be performed without GOTO's. Ugh. It's got many other problems, too, even leaving aside the 6 character name restriction (since most compilers allow long variable names anyway).)

    I couldn't tell you whether it'd be worth your while learning Fortran as compared to using other languages. I do know that there seems to be no (reliable) free Fortran 90 compiler for Linux (g77 does a good job with Fortran77, though, with a few exceptions). We're using a compiler from Absoft here at work, and it seems to work well.

    My main point, though, is that Fortran 90 is not a bad language to use. It's not any more hideous than any other language, as near as I can tell; I've seen terrifying code in any language, and I've seen (and written) good code in F90.

    --

    -Erf C.
    Cthulu always calls collect...

  108. Fortran - Use and Abuse by jefu · · Score: 1

    Fortran is still alive and kicking - there are good optimizing compilers for Fortran on a number of machines and a number of good libraries for it.

    However, I distrust Fortran personally - a number of years back I took a course in non-linear optimization - the course focussed on well behaved objective functions (smooth, a single optimum...) and the prof had some sample Fortran code that used his favorite optimum finder.

    He gave us an example and the answer. But his version was running on one architecture, compiler and OS - I did not have easy access to that machine, though I did to others. I ported the program to those other machines (mostly a question of fiddling output statements and similar more or less trivial changes - the algorithm was still the same). I eventually ran it on six machines (architectures, compilers...) and got six different answers - three of these were close, the other three were substantially different from each other - and the original answer was one of the outliers.

    I tried to figure out what the code was doing to see if I could find out where the error was creeping in. The code used pretty much every icky Fortran construct possible (multiple loops ending at a single statement, odd traversals of arrays, and the like) and of course not a comment to be seen. After about a week I gave it up as a bad job.

    Yup, this was only one program, but my sampling of fortran code shows it as more typical than not.

    There are a couple of interesting alternatives. One is Sisal - a very interesting language that attacks numeric problems more directly than Fortran (see sourceforge for the current Sisal project). Some measurements showed Sisal as being more than competitive with Fortran and other such languages and it seems quite possible that it could take advantage of the processing power in a clustered environment. When I tried to do some image processing algorithms in Sisal it took about two days to write error free code and another day to write code that outperformed my original C code.

    Another is APL. I've not been able to verify this recently, but I once heard that there was an APL interpreter that extended APL with some basic numeric operations (matrix inversion and the like are built in) that would pass off the hairy stuff to optimized routines. Admittedly, APL is an interesting language to learn, but it does provide wonderous array manipulation primatives.

  109. Has its place of course by CapnGib · · Score: 1
    Fortran still has (and will likely continue to have) its place in science and engineering especially for simulation and computational purposes. For the reasons already listed, efficient and robust computational libraries like BLAS and LAPACK are written in Fortran.

    Fortran was designed specifically for numerical calculations and thus is better suited for certain tasks than a language designed for system programming like C. Many engineering schools (mine included) require Fortran in the first year curriculum. They keep talking about switching to a more "modern" language like c or matlab, but that has been mostly talk.

    So go learn some Fortran, if you will be doing computational programming. Even if you won't it is one of the easiest languages to get into programming.

    --
    Beauty is truly in the eye of the tiger
  110. Re:FORTRAN? by B3ryllium · · Score: 1

    Yeah, yeah, I know. Shameless plugging. :)

    To be a bit on-topic, however - I've never used FORTRAN, so I don't know what its benefits are. I've used QBasic, VB, Visual DialogScript (a Delphi offshoot), C++ (Both VC++ and "regular" linux/BeOS C++), and now I've been playing with PHP.

    I really like PHP. It's fun. :)

  111. Damn near 50 years old by Anonymous Coward · · Score: 0

    Whilst Fortran '77 has been around for 25 years, the original language was developed in 1954, some 13 years prior. The fact that it is still used and highly regarded 48 years later is pretty amazing. I used it in college circa 1973 - "Where's my deck?, Anybody see my deck?"

    "Can I borrow some blank cards?"

    "Oh shit!, I dropped my deck!"

    "I hear we're getting a 360/70!!!"

    -Ojnab

    1. Re:Damn near 50 years old by Anonymous Coward · · Score: 0

      Should have previewed! Read - 23 years prior.

  112. GCC doesn't translate to C by Trepidity · · Score: 2

    GCC now has a very flexible front-end and back-end model. The front-ends translate the language into an internal sort of meta-language, and the back-ends output assembler. Even C code goes through this translation process, via the C front-end to GCC.

    Besides, even if it did translate to C, it could still be faster than most C code, as it'd likely be translating to a subset of C.

  113. Guess I'm in Luck by dilute · · Score: 1

    It's the first language I learned, punching cards one-by-one and handing in the deck to be compiled a la "batch" style, with 24-hour turnarounds between compiles. The language is a lot older than 25 years - I believe it's been around for more like 50 years.

    No, I don't see why, with a decent compiler, Fortran should be particularly more efficient than, for example, C, except perhaps for transcendental functions and the like which have been espicially optimized in Fortran compilers.

    I could see why the OO overhead of C++ could be a downside compared to Fortran, at least for purely numeric processing tasks.

    You think you've seen bugs? Try unravelling all the GOTOs and CALLs in the typical patched-up FORTRAN program.

    Moreover, I have no desire to go back to those stupid "FORMAT" statements! YECCHH!!! Believe me, you can be a lot more productive in other languages.

  114. Dijkstra by 4of12 · · Score: 3

    Edsger Dijkstra (Interestingly enough, Dijkstra died today.)

    Yeah, I saw that. Sad, losing a luminary like that.

    And pointedly relevent to this discussion, since FORTRAN used to use GOTO statements for branching.

    If you're considering FORTRAN, then beware the GOTO as Edsger pointed out in this classic.

    --
    "Provided by the management for your protection."
    1. Re:Dijkstra by smileyy · · Score: 1

      I'm somewhat irritated that I can't find any news sources talking about this. This doesn't sound like a /. troll, but I'd like to see more coverage of the passing of a computing pioneer.

      --
      pooptruck
    2. Re:Dijkstra by Chundra · · Score: 3, Informative

      Yeah I don't think it's a troll as it seems to be coming from reliable sources. Apparently his family sent an email to the faculty at cs.utexas.edu which has been forwarded around. I would imagine it would show up in the news within a day. Here's a link to the email, on the perl5-porters list.

    3. Re:Dijkstra by Anonymous Coward · · Score: 0

      This is indeed confirmed. He passed away last night at 11 local time in the Netherlands.

      After Dahl passed away last month, only Hoare is left of the trio that wrote "structured programming"

      CS as a science is coming of age, as our emiritus professors start to die ...

    4. Re:Dijkstra by Smallpond · · Score: 1

      "I mean, if 10 years from now, when you are doing
      something quick and dirty, you suddenly visualize
      that I am looking over your shoulders and say to
      yourself, "Dijkstra would not have liked this",
      well that would be enough immortality for me"
      -- EW Dijkstra

    5. Re:Dijkstra by VP · · Score: 3, Informative

      UT-Austin has an obituary.

    6. Re:Dijkstra by Bush+Pig · · Score: 0

      Believe it or not, it's possible (in fact with FORTRAN it's necessary unless you have FORTRAN V) to write structured code while using GOTO. You just need some self-discipline. I have to hand D.D.McCracken's "Computing for Engineers and Scientists with FORTRAN 77", which I would recommend to anyone still using FORTRAN. It shows you how to produce well-structured, non-ugly FORTRAN.

      --
      What a long, strange trip it's been.
  115. Is it really worth it? by photon317 · · Score: 2


    I've never touched Fortran in my life, and I have no desire to. I hear all the time about how fortran code is faster than language_x for math, but I have a hard time buying it.

    In most cases, does a given numerical algorithm well-coded in C underperform the same algorithm well-coded in Fortan? Assume of course there are better and more expensive optimizing C compilers, as there are for Fortran.

    If so, by how much? if it's 10%, or even 20-30%, I would think it's not worth the trouble of using a nonstandard language. Your next hardware upgrade will make C just as fast if not faster.

    If Fortran wins - I would assume the win is because the restrictiveness and explicitness of the language make it easier for an optimizer to *really* know what's going and how to optimize things away safely. In this case I have to ask - can't you still code 90% in C and the rest in assembler - or be careful about your C code's semantics to make sure optimizations are obvious to the compiler? And wouldn't eitherof those still be preferable to supporting a klunky old language?

    --
    11*43+456^2
    1. Re:Is it really worth it? by randombit · · Score: 1

      If Fortran wins - I would assume the win is because the restrictiveness and explicitness of the language make it easier for an optimizer to *really* know what's going and how to optimize things away safely.

      You are exactly correct here. One of the big reasons Fortran can be faster than C/C++ is that aliasing has to be explicit in Fortran. For example:

      void foo(double* x, const double* y,
      const double* z, int size)
      {
      int j;
      for(for j = 0; j != size; j++)
      x[j] += *y * z[j];
      }

      A C compiler can't tell if x, y, and z are the same pointer, overlapping, or some other weird combination that might cause problems, so it can't optimize as well. For example if y == x + 5, many obvious loop unrolling and vectorization optimzations don't work correctly.

      The 'restrict' keyword is claimed to solve a lot of these problems, but I've found, looking at the generated code, it doesn't make too much of a difference. Maybe someday compilers will be able to handle it better.

    2. Re:Is it really worth it? by geekoid · · Score: 2

      10% reductio in speed can ad days to some FORTRAN programs.

      A hardware upgrade will make fortran faster as well. assembler gets you nothing, and is way to costly.
      Then there is parallization.

      I would go on, but since you started by saying you never looked at, and then went on to say why something else is better, tells me your mind is already shut.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    3. Re:Is it really worth it? by dvdeug · · Score: 2

      I would think it's not worth the trouble of using a nonstandard language.

      It's easy to argue that in this field, C is the nonstandard language.

      can't you still code 90% in C and the rest in assembler

      Why does a engineer want to learn assembly? Part of the advantage of Fortran is that my college professor who was in grad school when it first came out can still use it. Even 386 assembly is only 15 years old, and really ought to be rewritten for the most recent chips to be fast. Worse, it does you no good when you need to move the code to the Alphas or the Crays in your department.

    4. Re:Is it really worth it? by photon317 · · Score: 2


      Yes but 10% is 10%. If 10% is two days to you, it's two out of twenty - was it worth it? Given the whole Moore's law shebang, is 10% at any given time worth it when the 100% increases in underlying hardware come so fast?

      --
      11*43+456^2
    5. Re:Is it really worth it? by OAB · · Score: 0, Troll

      WE ARE NOT TALKING ABOUT PCs YOU FUCKWIT

      CPU time on really big iron is charged for, time is money.

    6. Re:Is it really worth it? by photon317 · · Score: 2


      You're rude, obnoxious, and uninformed. I'm not talking about PCs either you uneducated fuckwit. But let's digress for a minute:

      1) the "10% is 10%" argument applies to money, time, and power - so your point is moot.

      2) If you're paying people for cpu horsepower per hour, you're living in the stone age and you need to get with it. I bet I could take a month of your fees and purchase all the compute power you need permanently, and it would probably remain fast enough for you for at least a year or so before needing upgrade.

      --
      11*43+456^2
    7. Re:Is it really worth it? by OAB · · Score: 0

      No, you are still a fuckwit. If you need to fun SERIOUSLY big numbers in any sane amount of time, you either pay for your CPU time, or spend 10 times as much trying to build an 'inexpensive' cluster.

      And if you really think saving 10% is pointless, I have a bridge you might want to buy.

      (Fucking college students, alway thing they know best)

  116. problems with loops? by spongebobsquarepants · · Score: 2, Informative

    I hate to sound trollish, but Python seems to handle loops quite well, and I find them intuitively easier to implement than in C/C++. The next time the author uses Numeric Python maybe he should give for or while a try. Plus there are other modules such as sci.py and scientific python that offer other tools, and Python integrates well with R, gnuplot, GRASS, and other computational tools. And I find C++ to be pretty zippy speed-wise.

    1. Re:problems with loops? by Ian+Bicking · · Score: 3, Insightful
      I think we was talking about "inner loops" -- a classic speed problem for languages like Python. For example, Python is very bad at something like:

      i = 1
      for j in xrange(1000): i = i + some_func(j)

      Dumb example, but it more or less shows the issue... when you are dealing with data structures the overhead of the loop isn't that significant (e.g., doing list manipulation). But when you are dealing with numbers there's the potential to be much more efficient, and Python's for loop overhead will be very significant.

      Of course Numeric Python can solve many of these problems, as can SciPy's weave and Pyrex, which compiles psuedo-Python to C. You can also program your inner loops directly in C, and make a Python module out of it. Or even write the module in Fortran.

      Python clearly isn't a good language to write number crunching algorithms. But it's great for using those algorithms -- and it makes it possible (and relatively easy) to mix in other languages that are good for those algorithms.

    2. Re:problems with loops? by spongebobsquarepants · · Score: 1

      Yes, exactly. And besides, no one language/tool is going to work best for every application. The 'integrative' approach illustrated above is a good example of how one might optimize their toolbox to fit a specific problem.

  117. FORTRAN still in use by Twister002 · · Score: 1

    FORTRAN will always be in use as long as there is ONE scientist alive who knows it.

    Scientists like to latch on to one thing (theory, programming language, etc...) and never let it go.

    We have guys where I work that would install Cygwin on their Windows machines (rather than just install Linux or use one of the many Unix boxes we have) because that's what they used before.

    People still using Netscape 3 because that's all they know.

    I'm sure that whatever work is being done in FORTRAN could be done just as well in another language (Lisp, Java, C/C++, etc...) but since that's all they know, that's what they use. I've seen some pretty big number sets crunched using Java and even bigger sets crunched using C++. Maybe FORTRAN just allows sloppy coders to get away with more? A good programmer can eek as much performance out of a language as is possible.

    I think the questioner should just stop whining about how hard C++ is to program in and either become a better programmer or (if his/her profession isn't programming) find a better programmer to do the work.

    Just my 0.02 cents, feel free to mod how you see fit.

    --
    "For a successful technology, honesty must take precedence over public relations for nature cannot be fooled." -Feynman
    1. Re:FORTRAN still in use by Anonymous Coward · · Score: 0

      You sure are cheap! I mean, everyone else here puts in two cents, and you come along and can't do any better than one percent of that. To most people, 0.02 cents rounds to nothing, so unless you're going to post 50 or a hundred times on every subject, I don't see why you even bother.

  118. Uninformed speculation by Anonymous Coward · · Score: 0

    I suppose it's the case with most articles on here, but many of the comments appearing seem to be written by people with no knowledge of the subject. Instead it seems to be "I don't have a clue about this but..." speculation.

    Fortran 77 has not aged as well as C. It lacks pointers, which can allow the compiler's optimizer to operate more efficiently as there aren't aliasing problems, but there are a number of things that just can't be done efficiently without pointers (or equivalents). I am not aware of any other performance benefit over C. In exchange you get utterly lousy IO, no structs, and a generally clumsy way of doing things.

    Fortran 90 has pointers (as well as many things you expect in a modern language), but then as a result it loses that particular performance advantage over C/C++. Fortran 95 goes further down that route.

    The big benefit of Fortran 90/95/later versions is that they have parallel programming constructs, which on the face of it give a major performance win over other languages. Indeed it does if a) you're running on a parallel system, b) you have a compiler capable of optimising parallel code for that system and c) you're solving a problem for which the inner loops aren't available in some form of library (e.g. NAG).

    The fact is 90% of numerical computing boils down to feeding numbers into standard black box routines: linear algebraic solvers, eigensolvers, BLAS, etc. These should be available in highly optimised (i.e. assembler) form for whatever system you are using, so the language you use to call them is irrelevant from a performance perspective. Consequently other considerations come in.

    Take an example. A huge area is finite element analysis. This involves generating a mesh (a complicated procedure), building a linear system, and solving it. The last (rate determining) stage would be done with a fast library routine. That leaves meshing as the primary challenge, and that -- like much computational geometry -- lends itself to C/C++ for a number of reasons: object orientation is a convenient paradigm; there are C++ libraries; and perhaps most importantly from a practical perspective, you can use OpenGl (or a variety of libraries) to display the result.

    And that last point is the key one. You can go off and use Fortran, and perhaps (and it's a big "perhaps") get some performance advantages in specialised applications. But you're effectively cutting yourself off from the rest of the computing world. What are all the graphics libraries written in? OS APIs? UI toolkits? You become a second class citizen when interacting with the system, and in a world where numerical computing is being driven towards user-friendliness and nice windowing interfaces, Fortran is not an asset.

  119. Fortran on the Resume by KoSpdX · · Score: 1

    Fortran is easy to learn if you already know how to program, and coming out of college it pays to know as many different languages as you can. I graduated a few years ago, and thankfully I took a class that required Fortran programming. I taught myself as I went along, and ended up learning a lot about Fortran. At the time, I thought that I'd never use it, but I was wrong. After some corporate downsizing, I found myself in the same market as people with five times my experience. I had trouble finding work using my favorite languages (Java, C++, C#) because of the poor job market (200+ applicants for an entry-level job). But, I recently landed a great job because I knew Fortran. None of the other candidates that applied had Fortran experience. Best of all, I get to code mainly in C#.

    If you have the time to learn Fortran, by all means do it. It sucks trying to find a computer job right now coming out of college (depending on where you're at), and having Fortran on your resume might be your ticket in. Trust me, you never know when you might use it!

  120. MOD UP PARENT! by Anonymous Coward · · Score: 0

    If this is right its by far the most interesting statment in the discussion.

    FORTRAN is good because its limited!:)

  121. Was 1 of 2 languages at my school by jpthegeek · · Score: 1

    FORTRAN was one of the two languages taught at my college when I was there, and up until 1998, it was the primary focus next to COBOL.
    There were a lot of local businesses that still used it in some form of another. Both of these in the government sector (defense and insurance).
    I guess it's hard to kill that kind of language when the primary machines you have still depend on it for survival.

  122. I still use FORTRAN... by SkipToMyLou · · Score: 1

    My current place of employment still uses FORTRAN, and it's still a very integral part of the system.

    The computer system is a real time host that processes up to 800 transactions per second. Each transaction consists of incoming data, validation, comparison to other data, writing of data to disk, formulation of reply, validation of reply and sending of reply. The central engines are written in FORTRAN.

    We have a slightly nicer front end (pre-compiler) called RATFOR - it's much closer to C. The rest of the system is written in C, and there's some nice stuff done to interface between the FORTRAN and C code.

    This system is supporting a very large business, and has to be stable. It also has to handle enormous amounts of transactions at peak periods. It has to do it reliably, and fast. FORTRAN is at the heart of this system, pumping away without problems. Don't think it's crap, just because it's old!

  123. easy by doofus1 · · Score: 1

    Fortran is still around in scientific applications and probably will be for some time to come. To write parallel code in C you need to manage the threads yourself. In fortran, you compile, set some environment variables and you're running multiple threads...Of course, I'd take the ugliness of pthreads over the ugliness of fortran any day.

  124. Re:Are you kidding? Of course it is! by Anonymous Coward · · Score: 0

    It's true, but from what I understand CERN is beginning to rewrite the libraries in C++. I think that GEANT will be primarily C++ in the next 2 years.

  125. Is FORTRAN still kicking? by Quixadhal · · Score: 2

    Yes, much like the chicken who's been decapitated some time ago. It doesn't make it any less dead.

    1. Re:Is FORTRAN still kicking? by CaptainAvatar · · Score: 1

      Well, it's more like Mike the Headless Chicken ... by all rights it should be dead, but surprisingly enough, it actually isn't.

      --
      The real Captain Avatar is a fictional character, so I suppose he doesn't mind if I impersonate him.
  126. Matlab? by gcondon · · Score: 3, Insightful

    While I certainly agree with your observation that Matlab is pricey, I don't understand your complaint that it is "inadequate as soon as it is necessary to use loops to describe a problem".

    Heck, one of Matlab's greatest advantages is that every numeric variable is represented as a matrix and that many loops can be dispensed with completely with a little judicious linear algebra.

    If you want to rip on Matlab, you'd be better off scorning its poor memory management or its byzantine handle graphics.

    However, it does provide a nice development environment for computationally intensive problems. Scripting is a lot nicer than compile-link-debug-repeat when you're still trying to figure out the problem. Plus you can always farm out the most intensive processes to external code modules - which you can write in C/C++, Java or (gasp!) FORTRAN.

    If price is the sticking point - why not take a look at GNU Octave. It is free as in beer (not GPL despite the name) and offers much of the same functionality as Matlab. Unfortunately, it shares most of the weaknesses of Matlab as well - and they are usually worse.

    1. Re:Matlab? by rweir · · Score: 1

      Uh, Octave (which I'm using right now) is GPLed. If nothing else, do you think the GNU project would support non-Free software?

  127. Learn COBOL instead by DeadBugs · · Score: 2

    FORTRAN looks modern and up to date compared to COBOL. I actually had to take COBOL in college and I miss every minute of time I lost learning it.

    --
    http://www.kubuntu.org/
  128. I'm a computational chemist. by thehappygit · · Score: 0

    Every code that we use that has been purchased from an outside vendor uses FORTRAN for the actual number crunching. C is generally only used in data analysis after the fact and visualization. AMBER, Gaussian, NWChem, GAMESS-US, GAMESS-UK, you name it - FORTRAN is still the standard.

    That said, everything I write is in C :).

  129. Edsger Dijkstra, computing pioneer is dead ! by Anonymous Coward · · Score: 1, Funny

    I just read some sad news on the internet.
    It seems that Dijkstra is dead.
    I'm sure the whole slashdot crowd will mourn his death. Even if you don't like stacks, there is no denying that goto is harmful.

  130. Have you looked at ratfor? by Anonymous Coward · · Score: 0
    Back in the summer of '81 I did programming work for a defense contractor. We wrote our code in ratfor ("Rational Fortran"), basically a front end for fortran that allows the use of structured programming concepts.

    I think it is still in use--do a Google search for ratfor.

  131. One significant disadvantage to FORTRAN by Tim · · Score: 4, Insightful

    While the first two of the three points listed in the parent post are somewhat true, they are usually mitigated, depending on the languages you consider (e.g., you can find good compilers and well-optimized routines for C++ that will perform on par with FORTRAN, but maybe you can't for, say, Java).

    However, the third point is actually a disadvantage in my mind: the overwhelming simplicity to FORTRAN leads to simple-minded implementations that are often less efficient (in time and especially in space) than a good implementation in a more modern language.

    Case in point: Check out the sorting chapter of Numerical Recipes, and you'll find that their "ultimate" sorting algorithm -- and hence the algorithm that a whole generation of FORTRAN coders think is the fastest -- is heapsort. Now, heapsort is a fine algorithm, but it has some significant disadvantages over quicksort (the algorithm used in the C/C++ standard library. well, almost, anyway.) Of course, you can't implement quicksort properly in FORTRAN because the language isn't recursive! So, I guess it makes sense that they skip over it in Numerical Recipes.

    These sorts of issues abound in FORTRAN programming. A lot of (older) engineers and scientists still insist that FORTRAN is the best language for high-performance mathematics, and to some extent, they're correct. As long as your mathematics are limited to those problems that can be solved with gobs of iteration, FORTRAN is your tool. But the minute you step into a realm where a more advanced data structure would be more important to performance (think hashes, heaps, trees, linked lists, etc. Places where algorithms actually matter.), FORTRAN falls flat on it's face. And don't even get started on space efficiency -- any modern language will beat FORTRAN 77 on this, hands down. Pre-allocation of arrays tends to kill an application's memory footprint...

    Some of these issues are addressed in FORTRAN 90, but really, if you're going to use that language, you might as well use a language like C++, which is more common, and just as efficient, with proper care.

    --
    Let's try not to let fact interfere with our speculation here, OK?
    1. Re:One significant disadvantage to FORTRAN by Beckman · · Score: 1
      overwhelming simplicity to FORTRAN leads to simple-minded implementations

      Consider two identical algorythms written in F77 and C++...

      Case in point: Check out the sorting chapter of Numerical Recipes

      NR writes for both FORTRAN and C. The shortcomming isn't the language.

      issues are addressed in FORTRAN 90

      FORTRAN 90 does increase the users ability to create complex structures, but this comes at the cost of speed. FORTRAN exists for solving numerical problems such as finite difference problems. When you move to a system that requires complex data structures, and there's no other way, then you had might as well switch to C.

    2. Re:One significant disadvantage to FORTRAN by Tim · · Score: 2

      Consider two identical algorythms written in F77 and C++...

      Ok. It depends on the algorithm, actually. C++ can actually be faster. But that wasn't the original point. The point is, that algorithms are often more important than sheer loop-iterating speed, and for this, FORTRAN comes up short.

      NR writes for both FORTRAN and C. The shortcomming isn't the language.

      Sorry, but no. Look at the code in the versions of NR. The C version is basically a rehashed version of the FORTRAN version (almost, but not quite, an f2c of the original book). The algorithms are the same, with minor exceptions. And frankly, it is a language isssue. FORTRAN doesn't have recursion. You can't properly implement quicksort in a non-recursive language. And quicksort outperforms heapsort in most cases.

      --
      Let's try not to let fact interfere with our speculation here, OK?
    3. Re:One significant disadvantage to FORTRAN by jaoswald · · Score: 2

      You are right about naturally recursive applications in Fortran. But I would hesitate to use Numerical Recipes as evidence. The code generally blows for both Fortran and C, and the numerical methods are mostly out-of-date.

      Good numerical code is found in places like Netlib, or by having your institution license good numerical packages from reputable vendors.

    4. Re:One significant disadvantage to FORTRAN by Anonymous Coward · · Score: 0

      Your DS instructor should have shown you non-dyamic implementations of all of the above. You can do it all in Fortran, and you can build complicated numerical algorithms as well. It's not trendy, but it is frequently the best tool for the job. Check our the examples on the Blitz page; to get Fortranish performance the examples used to be written in something that looked like C++Tran. If you're going to do that, you might as well program in Fortran and avoid the overhead.

    5. Re:One significant disadvantage to FORTRAN by velco · · Score: 1
      Case in point: Check out the sorting chapter of Numerical Recipes, and you'll find that their "ultimate" sorting algorithm -- and hence the algorithm that a whole generation of FORTRAN coders think is the fastest -- is heapsort. Now, heapsort is a fine algorithm, but it has some significant disadvantages over quicksort (the algorithm used in the C/C++ standard library. well, almost, anyway.) Of course, you can't implement quicksort properly in FORTRAN because the language isn't recursive! So, I guess it makes sense that they skip over it in Numerical Recipes.
      FWIW, both heapsort and quicksort have average complexity O(n log n), but heapsort has the same worst case complexity, whereas quicksort has O(n^2).

      ~velco
    6. Re:One significant disadvantage to FORTRAN by Tim · · Score: 1

      FWIW, both heapsort and quicksort have average complexity O(n log n), but heapsort has the same worst case complexity, whereas quicksort has O(n^2).

      True, however, quicksort's constant is lower than heapsort, which means that in most implementations, it is faster than heapsort, on average.

      It is also true that quicksort has a worst case of O(n^2), but introsort (the variant of quicksort acutally used in the C++ library), has both average and worst case of O(n log n).

      (FWIW, the constant difference is one of the reasons that NR doesn't implement quicksort. well, that and their irrational fear of the cost of recursion - they go so far as to implement their own stack, which is absurd.)

      --
      Let's try not to let fact interfere with our speculation here, OK?
    7. Re:One significant disadvantage to FORTRAN by hawk · · Score: 2
      >FORTRAN doesn't have recursion.

      Boy, I'm sure glad you didn't tell my committee this before they approved my degree . . . they never would have approved my recursive algorithm in fortran.

      Fortran 77 and earlier don't have recursion. Claiming that Fortran doesn't is as silly as basing criticisms of c and c++ on K&R or the assumption that c++ is handled by a c pre-processor. (However, all thinking people bash Pascal--even if you're wrong when you bash, it deserved it for something else! :)

      hawk

    8. Re:One significant disadvantage to FORTRAN by SigmoidCurve · · Score: 1
      Numerical Recipes is the only book that has taken on the mammoth task of codifying a vast amount of material related to scientific computing. Nothing else comes close! In some instances, yes, their references don't make it past 1975 but nowhere else can you find as complete a reference to just about any numerical problem imaginable.

      And to criticize N.R. for being out of date while recommending Netlib is ridiculous - most of the code on Netlib is truly ancient!

      czep

      --
      Dictionaries are for loosers.
    9. Re:One significant disadvantage to FORTRAN by mikec · · Score: 2

      Be very careful of Numerical Recipes. It is full of nasty traps and outright mistakes. See http://math.jpl.nasa.gov/nr/ for examples.

    10. Re:One significant disadvantage to FORTRAN by velco · · Score: 1

      they go so far as to implement their own stack, which is absurd.

      Nope, it is not. In fact is may have distinctive performance advatages. Consider this:

      void quicksort (ELT *array, int low, int high);

      That's three parameters to be passed in three registers or in three stack slots, compared to just two indices in the explicit stack. Then there's the return address, the caller-saved registers, the callee-saved registers and the stack alignment restrictions imposed by the architecture/ABI. It may happen that all of a sudden you are using, say, 16+ bytes for each recursive invocation instead of 8 for two integer indices. Now, take into account the additional cache and TLB misses imposed by the additional space needed and the additional control transfer during returns (I don't count calls, because the non-recursive version will have a loop).

      ~velco

    11. Re:One significant disadvantage to FORTRAN by Anonymous Coward · · Score: 0

      Implementing your own stack makes perfect sense for introsort; it is fast, and bounded to a small maximum, since if you exceed that you should give up on quicksort and resort to heapsort.

      For vanilla quicksort...your own stack obviously doesn't make sense.

      My biggest gripe about sorting algos in practice - the C library sort has a very slow constant factor because comparing is done by a callback.

    12. Re:One significant disadvantage to FORTRAN by rkit · · Score: 1
      Of course, you can't implement quicksort properly in FORTRAN because the language isn't recursive!
      Of course you can implement quicksort without recursion. All you need is to manage a stack yourself. Usually, this will also run faster. See e.g. Sedgwick's Algorithm book. Which shows that usually it is not a problem of language restrictions, but of lack of knowledge.
      --
      sig intentionally left blank
    13. Re:One significant disadvantage to FORTRAN by mat.h · · Score: 1
      Some points:
      • Don't form your image of Fortran after having a look at Numerical Recipes. I'm an undergrad, and I actually got to like Fortran after putting away NR and reading parts of Linpack (20 years old, with comments like 'LAST CARD OF SUBROUTINE whatnot' at the end of some files) along with Golub/van Loan's "Matrix computations" textbook. This combo is the best I'm aware of for learning about computational linear algebra, and because Linpack is built on BLAS, it's much easier to read than the code in the C version of Numerical Recipes. Really.
      • heapsort has its place. For one, it doesn't explode on presorted input data. And at least part of that "whole generation of FORTRAN coders" might have read other books apart from NR.
    14. Re:One significant disadvantage to FORTRAN by paulwomack · · Score: 1

      the overwhelming simplicity to FORTRAN leads to simple-minded implementations

      Very important comment; here's an extreme example to demonstrate the point.

      BugBear

      --
      Ignorance is curable. Stupid is forever.
    15. Re:One significant disadvantage to FORTRAN by Tim · · Score: 2

      It is absurd. What's the advantage gained by the hand-coded stack approach? Smaller stack frame, you say? Why does that affect execution speed in this context? You do some hand-waving by mentioning "cache and TLB misses," but this is almost pure crap, given that the context in a recursive function is going to be local anyway, and thus, the issue of cache misses will rarely, if ever, arise during function body excecution.

      Granted, you might run into this problem at the unwinding phase of the stack at the end of the recursion, but at this point, the performance impact is negligible anyway.

      Pile on top of this the fact that the NR stack makes it harder for a C/C++ compiler to properly optimize call dispaches in a sensible way, and the fact that, most likely, the compiler is going to do a better job of optimizing the stack code of a particular architecture than the authors of NR, and you end up with a smelly implementation of a good algorithm. And it isn't the only one. The code in NR is positively awful.

      --
      Let's try not to let fact interfere with our speculation here, OK?
    16. Re:One significant disadvantage to FORTRAN by Tim · · Score: 1

      My biggest gripe about sorting algos in practice - the C library sort has a very slow constant factor because comparing is done by a callback.

      A good reason to use C++. The C++ sort faces no such limitation (thanks to functors).

      --
      Let's try not to let fact interfere with our speculation here, OK?
    17. Re:One significant disadvantage to FORTRAN by Hasie · · Score: 1
      Your argument about Numerical Recipes using Heapsort in FORTRAN is flawed.


      Numerical Recipes in C does NOT use recursion for Quicksort (to make the code faster) so there is no reason why the algorithm cannot be implemented in FORTRAN.


      Heapsort is also recommended in Numerical Recipes in C because the worst case running time of Quicksort is very poor (it becomes an N^2 process), but this is not the case for Heapsort (about 20% worse than average).


      So in both these cases your argument that this is a proof of fundamental limitations in FORTRAN is flawed.

    18. Re:One significant disadvantage to FORTRAN by Claudius · · Score: 2

      "Don't drive a Ford. Fords suck because my 2003 Caddy has way more features than a Model A." Let's compare apples and apples, shall we? It is unfair to compare Fortran 77 with modern languages such as C++. Either you compare Fortran 77 on its own merits with C++ circa 1977 (i.e. nothing) or else you should consider the most modern incarnation of Fortran (Fortran 95) with C++.

      Fortran 95 has pointers; I have implemented essentially all "modern" data structures--hashes, heaps, tress, linked lists--with it. You can program object oriented F90/F95 (with one caveat--see "*" below). If you are averse to the ugly language features of F77 and its predecessors and their inclusion in modern Fortran for backwards compatability reasons, then you are welcome and encouraged to program in a beautified and simplified subset of the language such as the language "F" and forget about Holleriths and EQUIVALENCEs and the like.

      As has been commented by others, Fortran is very efficient and relatively simple to optimize for certain kinds of tasks seen frequently by those in the science and engineering fields. Fortran 95 has nice array syntax that is dead easy for compilers to detect and optimize. Fortran also allows for a fairly rapid development cycle--the language doesn't have as much capacity for "being cute." You may hate the simplemindedness, but in the real world people have to read, understand, and maintain other people's code. All those cute syntactic tricks one feels obliged to play in C or C++ just add to the time it takes for someone to read over your code and figure out what the heck it is supposed to be doing. In my experience other peoples' Fortran 90 is so much easier to human-parse than other peoples' C or C++ that that alone would be enough to justify the language on any kind of nontrivial project. (That, and you don't have to piss away your time worrying about whether a method should be virtual or pure virtual, but I digress...).

      As for your slam of heapsort in Numerical Recipes, in my recollection Press et al. identified many specific technical reasons for suggesting heapsort for many numerical applications over quicksort: it is an "in-place" sort, it has the same computational complexity as quicksort, the worst case scenario is only about 20-30% slower than the best case scenario, and, yes, its implementation in some languages is more transparent. (People who use numerical algorithms that they don't take time to understand should be forced to take the maiden ride in the airplanes or drive over the bridges they design). In many numerical applications one needs to sort large "nearly sorted" datasets; naked quicksort without some kind of shuffling dies a painful N-squared death on these cases.

      (*) To be fair, I should comment that "object oriented" F95 doesn't support runtime polymorphism, but I've yet to encounter a numerical analysis task that would benefit in any significant way from this language feature.

    19. Re:One significant disadvantage to FORTRAN by Tim · · Score: 2

      "Either you compare Fortran 77 on its own merits with C++ circa 1977 (i.e. nothing) or else you should consider the most modern incarnation of Fortran (Fortran 95) with C++."

      Who are you to decide what can and can't be compared? A language is a language, and I can compare and contrast the features of languages as I please. Note that I talked about FORTRAN 77 in my post, not F90 or F95. It was a fair comparison - F77 is deficient when compared to a modern language such as C++.

      As for F9x, look around for my other post on the topic. Yeah, the language adds some desperately needed features, but all in all, it's as messy as C++, has fewer features than C++, and has a smaller user community! I personally wouldn't even consider F90, unless I had a big chunk of F77 code that I didn't want to port, and a good reason not to link it into a C or C++ application.

      "You may hate the simplemindedness, but in the real world people have to read, understand, and maintain other people's code. All those cute syntactic tricks one feels obliged to play in C or C++ just add to the time it takes for someone to read over your code and figure out what the heck it is supposed to be doing."

      These issues have been so well debated that I'm not even going to go into them here. You're wrong. Time and experience have shown this to be true. The "cute" features that bother you are important to writing large, maintainable projects. Can they be misused? Yes. Sure. But to programmers skilled with the language, they provide valuable tools that FORTRAN just doesn't offer.

      "As for your slam of heapsort in Numerical Recipes, in my recollection Press et al. identified many specific technical reasons for suggesting heapsort for many numerical applications over quicksort: it is an "in-place" sort, it has the same computational complexity as quicksort, the worst case scenario is only about 20-30% slower than the best case scenario, and, yes, its implementation in some languages is more transparent."

      Gee, it'd be interesting to see the date of the paper you cite, given that the introsort variant of quicksort guarantees O(n log n) performance, and has a lower constant than heapsort for most inputs (and, BTW, this is the std::sort in the C++ standard library). To be fair, introsort wasn't around when the original version of NR was published, but the authors haven't bothered to include or even mention it in any subsequent volume. Wonder why that is....(my own personal opinion is that the other versions of NR are simple-minded translations of the original FORTRAN code...)

      "To be fair, I should comment that "object oriented" F95 doesn't support runtime polymorphism, but I've yet to encounter a numerical analysis task that would benefit in any significant way from this language feature."

      I work in molecular simulation, and it's easy for me to come up with numeric tasks that benefit from polymorphism. Consider this: geometrically "building" a molecule is essentially nothing more than linear algebra, but polymorphism allows you to write the build code once, and re-use it on whatever particular molecule type you desire. Incredibly convenient....

      --
      Let's try not to let fact interfere with our speculation here, OK?
    20. Re:One significant disadvantage to FORTRAN by Claudius · · Score: 2

      Who are you to decide what can and can't be compared? A language is a language, and I can compare and contrast the features of languages as I please. Note that I talked about FORTRAN 77 in my post, not F90 or F95. It was a fair comparison - F77 is deficient when compared to a modern language such as C++.

      Read my comment on comparing modern automobiles with the Model A. Fine by me if you want to make the comparison--you just look a bit silly is all. Shall we dismiss C++ out of hand because pre-ANSI/ISO-Standard C++ had no convergence on template functionality? (In practice, compiler vendors still often don't implement the language standard fully, but I digress...).

      These issues have been so well debated that I'm not even going to go into them here. You're wrong. Time and experience have shown this to be true. The "cute" features that bother you are important to writing large, maintainable projects. Can they be misused? Yes. Sure. But to programmers skilled with the language, they provide valuable tools that FORTRAN just doesn't offer.

      Two obvious comments: First, language selection is entirely subordinate to design and planning of a project. A skilled programmer with an understanding of modern data structures and algorithms can, with very few exceptions, implement any of them in any sufficiently powerful language. You don't need C++ to do linked lists or hash tables or to have OO structure, or even to design large maintainable software projects. I have seen many large C++ projects fail because of poor design, and I have seen many large F90/F95 projects succeed because of superior design. The design decision on what language to use for a given project should be based solely on technical criteria and not kneejerk prejudices.

      Second comment: Those "skilled programmers" you refer to rarely seem to end up writing the code I have to read and maintain. I myself don't work in a software house--I am a scientist and I work with scientists, people who, unlike me, often don't have formal computer science training or any compelling inclination to learn to write beautiful, well-structured C++. We're not talking about people who have read, understood, and know how not to abuse the information in Design Patterns--we're talking people with PhDs in physics or engineering who have taken a 1-week "How to get stuff to compile with a C++ compiler" syntax course who suddenly feel qualified to code up the world only to end up, more often than not, reinventing (badly) features already in the STL. They have only a nebulous understanding of the subtle aspects of C++, and they tend to cling to "natural-looking" constructs and idioms that just end up bogging down their code factors of two to ten compared to equivalent Fortran. These people are much less of a hassle if you let them program in Fortran.

      I maintain, and I have considerable experience to back this claim, that because C++ is so large a language, to have any measure of refactorability you have to have programmers who have a solid understanding of the language as well as significant training in software design. Otherwise you get an unmaintainable mess, and the power and flexibility of C++ is overkill. Even if you do have such a team of programmers, it is not clear that C++ is always the language of choice: if you are not leveraging old C++ class libraries, you anticipate no need for refactorability of the current class libraries, if you have specific performance objectives (e.g., heavy array manipulation, which other languages handle better) or design objectives (a deadline that cannot tolerate the longer design cycle of designing/testing C++ class libraries), then C++ is simply not the best choice.

      As for introsort, I concur with your technical assessment of the algorithm. My only reason for broaching the subject was to comment that Press et al. had presented a set of technical reasons for preferring heapsort in many settings (not the least of which is that the algorithm is dead easy to understand) and not some misguided attempt to crown an "ultimate sorting routine" as your original caricature suggested.

    21. Re:One significant disadvantage to FORTRAN by Anonymous Coward · · Score: 0

      "Case in point: Check out the sorting chapter of
      Numerical Recipes, and you'll find that their
      "ultimate" sorting algorithm -- and hence the
      algorithm that a whole generation of FORTRAN
      coders think is the fastest -- is heapsort."

      This is simply incorrect. From the Numerical
      Recipes fortran version of 1992 we find the
      following quote on the first page of the sorting
      chapter:

      "On the balance we recommend Quicksort because of its speed, but we implement both routines" ...implementing both routines is, imo, not a bad
      thing for a book whose purpose is to summarize
      what are the most common algorithms out there.

  132. Damn you science! by GoatEnigma · · Score: 1
    You mean I'm not the only one that had to *shudder* use Fortran?

    Last summer I worked for a computer modeller who took vast amounts of matrix data and performed hundreds of operations on it. The application was to calculate crustal rebound from glacial retreat based on dozens of lithospheric parameters, and the data was anywhere from a 100km to 100m cell resolution.

    Because the jobs took so long, I experimented with it in between jobs. I took a subset of the program, (two routines + main) and rewrote it in C and Perl and ran it on an UltraSparc 10. C was about 1.5 times slower and Perl was 1.65 times slower.

    When you're talking 24 hour jobs, a 33% (from C to Fortran) speed gain is measured in hours. On a shared supercomputing facilitie, all the other eggheads appreciate it if you take the least amount of time possible!

    P.S. > Fortran is simple to learn. Takes about 3 days if you know C. That being said, I did spend 2 full days debugging a program only to discover that my vast overflow errors were because I had tab characters at the start of my line instead of 5 space characters!

  133. The obligatory fortune... by Jon+Abbott · · Score: 2


    "A computer without COBOL and Fortran is like a piece of chocolate cake without ketchup and mustard."

  134. The right language for the right task by Anonymous Coward · · Score: 0
    Some of these things have been said before, but I'd like to add my two cents to this discussion.
    • If you're considering learning Fortran, just do it. If you're fluent in other languages, it'll take you a day to learn Fortran, and another to feel comfortable in it. It is pretty simple (which also makes it possible to have compilers that generate very optimized code, as was mentioned by other posters here).
      Then decide whether it is worth it for you to switch to Fortran, or whether you may want to write speed-relevent parts in Fortran.
    • Every programming language has its specific area of use.
      A case in point: Matlab. You critisized the high price tag and its low performance. The application of matlab is quick prototyping of mathematical algorithms. I am a mathematician and as such, am interested in getting the algorithm to work. Once I have accomplished this (including convergence theory and parameter optimization, done in matlab), I am ready to implement this algorithm in a lower-level language such as C or Fortran (lower level compared to Matlab).
      In this scenario, Matlab has a clear advantage since I don't have to mess about with matrix manipulation, eigenvalue approximation or linear equation solvers---I simply use the algorithms supplied by Matlab.
    • I'm sorry, but I can't resist: If speed is what you're after, program in assembler! ;)
    So, to summarize: real men code in asm, and geeks code in whatever is convenient.
    HTH, mlf.
  135. I learned F77... by dokhebi · · Score: 1

    I learned Fortran 77 in college, my father learned an earlier version when he was in college. It is ugly, clumsy, strange, and very, very good for doing scientific calculation because it was designed as a scientific calculation language. Anyone who uses it for anything else is going to feel a lot of pain, just as they would if they tried to use other languages for doing calculations, or Cobol for anything at all.

    Just my $0.02 worth.

  136. Funny you should ask! by macemoneta · · Score: 2

    I just recently completed a port (a consulting job) of some MSDOS Fortran IV to Linux Fortran 77 (about 65K lines).

    The interesting thing is that I wasn't ever a big fan of Fortran, and never used it much. In fact I haven't written a line of code in Fortran in over 15 years.

    However, it literally took me only a few minutes to "come up to speed". The language is very clean, readable and maintainable. I wonder if anyone will be able to say the same about current languages in 15 years.

    --

    Can You Say Linux? I Knew That You Could.

  137. Frances E. Allen just retired from IBM by burgburgburg · · Score: 1

    Interesting article about Frances E. Allen in the NY Times yesterday. She just retired from IBM after 45 years. She joined the company in 1957. Her first job: teaching FORTRAN to skeptical IBM programmers. Up until then, everybody at Big Blue was hand coding assembly.

  138. why not: Fortran ***AND*** C++ ??? by edhill · · Score: 1


    "...Fortran code can be much better optimized than C/C++ code for numerics."

    Hardly. Apparently, you've slept through the last half-decade of advancements in OO numerics and C++ libraries. See Blitz++, MTL, and the numerous other C++ projects listed on NETLIB.

    But more to the original point, why does everyone assume that FORTRAN and C++ are an either/or proposition? They aren't!!! Its not at all difficult to call most of the myriad F77 routines (including highly optimized BLAS and LAPACK libraries) available on NETLIB from C++ programs. I've done it both "by hand" and with the help of wrappers available in, for example, MTL.

    Since this is yet another "tool for the job" question, I think its very important that people understand that they don't have to use just one tool. With a mixed-language approach you can employ, for instance, C++ to handle strings and call FORTRAN for the BLAS and LAPACK routines.

    hth,
    Ed

  139. "it is simply too easy to make mistakes" by ToasterTester · · Score: 1

    Well sounds like you should be using VB, it was designed to hold your hand.

  140. What about IDL? by Anonymous Coward · · Score: 0

    Another product to consider is IDL. The only problem with IDL is that it's price tag is similiar to that of Matlab. However, it does provide a complete programming language, a rich set of data analysis and computation routines, it's own development enviroment, and the ability to create complex visualizations and user interfaces.

  141. Talking as a guy who is currently working... by jellisky · · Score: 2

    ... with FORTRAN, I will echo what others have said, plus add a bit.

    Yes, FORTRAN is incredibly nice for what it was designed to do: calculate. It is quite quick at it, and the compilers for the 77 version, as noted by others, are incredibly well optimized for this purpose.

    FORTRAN is the code of choice for anything that requires a huge bit of mathematical calculations. When you're working with weather models, and it takes 20 hours just to run the FORTRAN code, you begin to notice when that extra overhead the other copilers put in when it increases run times by hours.

    That said, if you've programmed before in other languages, be prepared to be sitting there complaining about how terribly FORTRAN is set up. One of my mantras about FORTRAN which keeps me sane is: "The people who made FORTRAN were obviously screwy in the head." Of course, that is said entirely tongue-in-cheek, since the language was "setup" before I was even born. ('Course, not long before, but still before.)

    There's a lot to hate about FORTRAN from modern programming, but if you're willing to bite the bullet and accept it for what it can do, then you probably will find it incredibly useful in the long run. FORTRAN is perfect for long calculations (think hour-long, at least), but it is terrible at many other things.

    As for the 90 version, it has some nice features, but, overall, you can do a lot of what 90 has in 77 with only a few extra lines of code. Plus, from what I understand, the only decent 90 compilers are commercial (i.e. not free), so factor that into your decision.

    So, yes, FORTRAN is ugly code... yes, FORTRAN is terribly constructed given current languages... but, it does its job admirably well. And if anyone wants to complain with me that the difference in running time between C and FORTRAN is only 10%, let me give you a program that'll run for 30 hours in FORTRAN and I'll gladly have those 3 hours extra I just saved.

    -Jellisky

  142. Variable declarations by bigsexyjoe · · Score: 1

    When I programmed in FORTRAN the compiler didn't make you declare variable names. You could declare them implicitly in the code. So I was constantly misspelling variables and therefore creating new ones on accident. This led to tons of bugs even in small programs. There might be some compilers that don't allow this though. If there are use those, because misspelling variables is a gigantic source of errors.

  143. Engineering Programs are moving away from FORTRAN by c0d3fu · · Score: 1

    At the University of Missouri-Rolla, I have noticed many of the engineering departments use applications written in FORTRAN. Just because these huge programs are effective at doing what they do, however, does not mean FORTRAN is a better language. In fact, most of the most recent software I have gotten my hands on is written in C or C++.

    Of recent, however, they have been moving over to C and C++. I think this is a wise move as C and C++ are better documented, more versatile, and better understood by modern programmers than FORTRAN. The key to a having easily updatable science and mathematics software lies in within those factors. Plus, C can do so much more.

    FORTRAN has some nice elements, but they only carry it so far.

    --

    [c0d3fu]: jwjb62@umr.edu || james@macrohub.com
  144. pari gp? by luphus · · Score: 1

    Ever play with pari gp? We used it for calculations in a cryptography course. Our prof was very much into linux and perl - quite a guy really. Tis GPLed, works on several architectures, and is really powerful. Go here or apt-get install pari-doc pari-extra pari-gp, if debian's your bag.

    nwp

  145. Debate continues because they won't consider ... by Anonymous Coward · · Score: 0

    Forth.

  146. Java instead of FORTRAN for NC? by apuku · · Score: 1

    This is an interesting paper on the subject: paper

    --
    Look, it's trying to think - Albert Rosenfield
  147. Common Lisp by looie · · Score: 1
    CL may be worth a look.

    Franz has some case studies of high-end solutions with CL.

    more info can be found at XANALYS Lisp Works, which includes this comment:

    "Advanced numeric types. The Common Lisp arithmetic package includes unlimited size integers, fractions, complex numbers, and a complete floating point library. Conversion between numeric types occurs automatically."

    mp

    --
    "The secret to strong security: less reliance on secrets." -- Whitfield Diffie
  148. Just had a class this summer... by jaaron · · Score: 2

    I just had a grad class this summer in Scientific Computing and it was all Fortran 90. I knew Fortran 77 from a numerical computation course a few years ago. My point is, it is _still_ being taught and it is still *THE* language of choice for high performance scientific programming. Those who count Fortran as "outdated" or no longer significant obviously don't get exposed to this type of programming. While Fortran can seem "odd" to a programmer who grew up on java or C++, it is still a worth while language to learn and use.

    --
    Who said Freedom was Fair?
  149. Re:Are you kidding? Of course it is! by Anonymous Coward · · Score: 0

    Thank you. You have convinced me to use C. University of Michigan is obviously an inferior school and thus uses Fortran. As a student at The Ohio State University, I can not in good faith use the same thing as University of Michigan. Go Bucks!

  150. Fortran77 by Anonymous Coward · · Score: 0

    F77 is an old beast indeed, but, like a lot of people have mentioned, still the best for numerical computing and analysis - mostly because there's a huge library of well-written math/science functions sitting out there for it.

    My personal advice, from experience (I've helped rewrite/maintain/port Fortran77 code written for VAX - not a pleasant thing), is that once you go over about 500 lines in FORTRAN, you're asking for trouble. It's not a language designed for Big Things - it's designed to do Little Things Really Well (like, say, intensive mathematical computations - exactly what it was designed for!).

    Write your computation-intensive routines in it and bind the code into your C/C++ interface that does all the string handling/GUI/OS interface/whatever - GCC makes this lovably easy as long as you're not braindead.

    In short: It's well worth learning, because there's still code out there written in it, and it's bloody fast. Don't reinvent the wheel if you don't have to. Plus, saying that you have experience with Fortran77 is a great thing to put on a resume.

  151. Try O'Caml by Tom7 · · Score: 3, Informative

    Try O'Caml (caml.inria.fr); it's a modern language that's compiled very efficiently (independent benchmarks) and is suitable for heavy crunching. O'Caml has lots of features that you won't find in many languages, like algebraic data types, higher order functions, etc., but is intended for real general purpose programming. Most importantly, it's type-safe (statically) so you probably won't spend as much time tracking down bugs unrelated to the problem at hand. (That has certainly been my experience with SML, a language from the same family.)

    1. Re:Try O'Caml by Anonymous Coward · · Score: 0

      I've often wondered why OCaml hasn't caught on more in the numerical computing community. Maybe it's too young of a language. I myself haven't jumped on the Ocaml bandwagon as quickly because there just aren't many--any?--native matrix libraries available. Otherwise it seems like the natural choice for numeric computing.

  152. It's all user preference by UID30 · · Score: 1
    C, Fortran, Ada ... they're all pretty much the same thing except for syntax. The only real difference in language comes when you start to use an object oriented language like C++, Objective C, or Java which universally produce code which is less effecient than a lower level language.

    Most compiler manufactureres (gnu, DEC, Sun, ...) produce one compiler back-end with different language specific front-ends ... nothing at all like the olden days where compilers were custom built for each language.

    Object oriented languages produce less optimized machine code because they make assumptions for you, the programmer, about how the program is supposed to work. The object oriented view is often more powerful conceptually and programmatically, but the piper will be paid in machine code before it is over.

    As languages get higher level, they get less effecient ... there are really about 5 levels that I can identify, each level having roughly the same potential code execution speed:
    • Assembly (assembled, HARD to write/debug, runs like the wind)
    • C, Fortran, Ada (compiled, easier to write, slightly less effecient)
    • C++, Objective C (compiled, conceptually more powerful, slightly less effecient)
    • Perl, Python (dependent on external runtime environment, quite abstract syntax, much less effecient)
    • Java, Powerbuilder, other 4GL languages...
    Before you flame me, I list Java with Powerbuilder only because I really really really hate them both ... yes they are quite different, yes java is a supreme example of _________ (fill in whatever mumbo-jumbo you wish).

    Anyway, back on focus now with the original question, any language higher level than assembly is going to have ineffeciencies ... and it's all user preference when deciding which limitations you are happy with in your application.
    --
    "Glory is fleeting, but obscurity is forever." - Napoleon Bonaparte
  153. A Lot of People are using Numerical Python by g8oz · · Score: 1

    It's probably worth checking out

  154. Engineers use it. by endeitzslash · · Score: 1

    I do subsurface fluid flow modeling and most of the industry standard codes are written in Fortran. Examples: Flow and Transport: MODFLOW-88, 96, 2000 (Fortran 77, 77, and 95) UTCHEM 6.2 and 7.1 (Fortran 77, 90) SWIFT (Fortran 77) Optimization: PEST (Fortran 77 or 90) The addition of dynamic array allocation was the largest (and best) improvement between 77 and 90 in my opinion. Also, the modularity has improved with each new addition. Basically I find a combination of Perl and Fortran to be the most useful for crunching numbers and interpreting results from the huge data files that are produced. -ed

  155. hear hear for portability by jjtime4sko · · Score: 4, Informative

    I'm not going to wade in on a lame language war, but Fortran IS very portable. I have worked on code that was written in 1967 for a CDC mainframe. It was then ported to a:
    PDP-11, then a
    Vax, then a
    486-class PC. The code ran much faster on the PC then the Vax.

    Then I discovered that I needed a routine from the original CDC implementation, which had not been touched since. So I typed in the routine FROM CDC PUNCH CARDS. Compiled perfectly.

  156. My fortran programs are still in use ... by matt_morgan · · Score: 1

    In grad school in 1992 I wrote FORTRAN programs when I was trying to use fractal methods to describe landscape patterns and time-series data of sandy beach volume measurements. I hadn't ever used fortran since I learned it in undergrad, in maybe 86. But I started from other people's programs, and they were written in FORTRAN.

    Nobody cares much about fractals in that field any more, as far as I know, but they're still using the programs in a "math for scientists" class, in the unit on time series. FORTRAN may be ugly to real hacker-types, but scientist-types, who generally don't put as much thought into the "what language should I really be using" question, still use it all the time.

    As an IT manager now I wouldn't want any new programming done in FORTRAN (I manage a Museum, though, and most of our programming is OpenACS stuff anyway). But scientists pretty much work for themselves and make their own decisions. Given the entrenchment of FORTRAN and its ability to do calculations, scientists will be using it, and mostly it, for a long time to come.

    So I think this comes down to a personal decision: I had an academic career as a scientist, and programmed in FORTRAN. Now, perl, php, python, tcl, java, VB weren't options then, but if I'd been in Grad school in the late 90's, and I'd known that I'd end up in IT instead (I did know that, actually)--then maybe I would have picked some other language to learn knowing that it would be better for my ultimate career. Even if it would be slow or difficult for calculations (it was only a master's). But if I was going to stay a scientist, then FORTRAN would have been fine as a choice.

  157. Fortran is NOT turing complete by dlakelan · · Score: 1

    Just a bit of trivia. FORTRAN is NOT turing complete.

    For example, there is no way to write a Fortran program that computes the summation of two arbitrary numbers without using input and output primitives. (when I say arbitrary i DO MEAN ARBITRARY).

    The main reason for this is that Fortran has no memory allocation method. You have to give it a finite initialized memory storage hard coded into the program.

    Not only that but Fortran doesn't support recursive functions.

    Basically every Fortran program is a huge finite automata.

    This of course assumes you aren't using input and output parameters to get arbitrary storage...But that's really ugly.

    Not that you can't do useful things with Fortran, but I'd suggest Common Lisp, an ML dialect, and C over Fortran any day.

    --
    ((lambda (x) (x x)) (lambda (x) (x x))) http://www.endpointcomputing.com a scientific approach to custom computing.
    1. Re:Fortran is NOT turing complete by dbretton · · Score: 2

      wrong.

      f90 does have dynamic memory allocation.

    2. Re:Fortran is NOT turing complete by jefu · · Score: 1


      OK.

      I'm confused (not a rare thing, actually), in fortran you can emulate a turing machine with the tape being a big array (up to the maximum array size you can allocate), if necessary, you can write the tape out to disk, and do all the operations on a small window on the tape in memory.

      But, really, you can't do any better in any language I know. The tape will always be finite, and of some maximum size. So you are always limited by that.

      Anyway, any closed finite computer is little more than a big finite state machine.

  158. The obligatory other fortunes... by Jon+Abbott · · Score: 2

    OK, I couldn't resist... Here are the rest:

    "Real programmers don't write in FORTRAN. FORTRAN is for pipe stress freaks and crystallography weenies. FORTRAN is for wimp engineers who wear white socks."

    "The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change."
    -- FORTRAN manual for Xerox Computers

    "You can measure a programmer's perspective by noting his attitude on the continuing viability of FORTRAN."
    -- Alan Perlis

    "You can tell how far we have to go, when FORTRAN is the language of supercomputers."
    -- Steven Feiner

    "An engineer is someone who does list processing in FORTRAN."

    "FORTRAN is a good example of a language
    which is easier to parse using ad hoc techniques."
    -- D. Gries
    [What's good about it? Ed.]

    "FORTRAN is not a flower but a weed -- it is hardy, occasionally blooms, and grows in every computer."
    -- A.J. Perlis

    "FORTRAN rots the brain."
    -- John McQuillin

    "FORTRAN, 'the infantile disorder', by now nearly 20 years old, is hopelessly inadequate for whatever computer application you have in mind today: it is too clumsy, too risky, and too expensive to use."
    -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5

    "[FORTRAN] will persist for some time -- probably for at least the next decade."
    -- T. Cheatham

    "It's multiple choice time...

    What is FORTRAN?

    a: Between thre and fiv tran.
    b: What two computers engage in before they interface.
    c: Ridiculous."

    "On the eighth day, God created FORTRAN."

  159. Extra ints on unformatted writes by TFloore · · Score: 3, Informative

    Your issue with extra ints on unformatted writes of Fortran file io... I've worked on Fortran development on 2 platforms:
    1) DEC/Compaq Alphas running OpenVMS with DEC compilers
    2) Windows NT4/2K with MS Powerstation v4 and Compaq Visual Fortran v6 compilers.

    The DEC compilers on OpenVMS did *not* do those extra ints on unformatted file io. My C code to read the output file worked with no extra steps, and could read data structures with few problems. The MS/Compaq compilers *did* write extra ints on the Windows platform. Drove me buggy when I was trying to port some software from VMS to Windows. (Don't ask why, I was ordered to do it.)

    Incidentally, the MS Powerstation v4 compiler wrote a 16-bit int before and after, and the Compaq Visual Fortran v6 compiler wrote a 32-bit int before and after. That change also drove me nutty. This had some extra issues... an array declared as
    integer(4) MYVAR(1000)
    was *larger* than the 16-bit int could specify... so the compiler broke it up into 128-byte chunks. Yes, a 4000-byte array was written as a series of 31 128-byte chunks (each with its own leading and trailing 16-bit ints), followed by a 32-byte chunk with its own leading and trailing 16-bit ints. Making C code to read this mess hurt my brain. At least switching to the Compaq v6 compiler took that issue away.

    I didn't look up the Fortran language spec to see which one was actually complying with the spec. Having seen all three methods, I decided none were correct.

    Incidentally, when doing unformatted writes of structures where one language is writing, and another language is reading the file... Make sure both compilers are using the same memory/data alignment rules. My Fortran compiler was doing align=byte, and my C compiler was doing align=word, and my structures with some logical*1 and integer*2 variables were messing up my read routines.

    Ahh... the dangers and joys of multi-language development projects.

    --
    This is my sig. There are many like it but this one is... Oops. Frank, I've got your sig again! Where's mine?
    1. Re:Extra ints on unformatted writes by Rasta+Prefect · · Score: 2

      Cray and IBM both put them in..32 bits.

      Make sure both compilers are using the same memory/data alignment rules. My Fortran compiler was doing align=byte, and my C compiler was doing align=word, and my structures with some logical*1 and integer*2 variables were messing up my read routines.

      Don't I know it. As I was attempting to make this software run on both a Linux machine and a Cray T3E, I opted to just read in each array and variable seperately, and that seemed to work. This made things more interesting because Cray likes to word align things, and a Cray word is 64 bits. Also, a Cray int is 64 and a short is 32. Mostly I just kinda fiddled it until things lined up right(fortunately, there were some nicely distinctive tags in the datafile).

      --
      Why?
  160. Re:Are you kidding? Of course it is! by Anonymous Coward · · Score: 0

    A lot of new code is being written in C++, though, and Root (http://root.cern.ch) is used somewhat in place of Paw. Pretty much all of our code for run 2 of CDF (the Collider Detector at Fermilab) is in C++, although some wraps older Fortran code (in particular, Monte Carlo generators like Pythia). I hear Atlas at the LHC is using Python to drive some of its code, most of which will be in C++.

  161. You should invest the time in learning FORTRAN by nusuth · · Score: 1

    Not because FORTRAN is a must-know language (actually it is butt-ugly) but the time you need to invest is a few days at worst. Yes, FORTRAN (77 and prior versions) is that simple.

    --

    Gentlemen, you can't fight in here, this is the War Room!

  162. The real question is... by Glock27 · · Score: 2
    what will replace FORTRAN down the road?

    I vote for high-performance Java, personally (with further extensions for better performance like lightweight objects [no inheritance but very little overhead for things like complex numbers], immortal [static] objects and a good generics implementation). I'd also like to see a very flexible and extensible operator overloading functionality, as well as the ability to use Unicode in Java source as an optional extension, for both variables and operators.

    Also don't forget that gcc 3.x now includes a Java front end...perfect for extending into numerical Java. It's especially appropriate since it is a traditional "ahead of time" compiler permitting full optimization.

    IBM has already provided matrix libraries written in Java with about 80% of the performance of fully optimized FORTRAN. Another interesting library is the Colt Library. It is also possible, using JNI and DirectIO, to use legacy libraries efficiently from Java where appropriate.

    The focal point for numerical Java is Java Grande.

    BTW, I was sorry to miss the Java 3 discussion yesterday, but this post summarizes my desires in that area. Quite a bit different from those of the article's author (what a whiner that guy was!).

    At any rate, FORTRAN is still alive and kicking, and will be for another hundred years I'm sure... ;-)

    I hope new development is mostly being done in Java in the not too distant future, though!

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
  163. so much great numerical analysis code by hopeless+case · · Score: 1

    I think the main reason Fortran is still alive and well is that legions of professors and graduate students in the 60s and 70s wrote so much good numerical analysis software. Translating that code into a more modern language is simply out of the question. It would require a huge effort.

    If is really tough to write a function to invert a matrix of arbitrary size that performs well and to do it with proper attention to numerical stability (basically I mean that round off error won't kill you). You would need to write about a thousand such functions to replace the work that is available if you are willing to use fortran.

    The R language (www.r-project.org), which for this discussion can be considered an open source version of matlab, has been built atop the old fortran sources. It's a very cutting edge software package and if it weren't for the gnu fortran compiler and the old fortran numeric code, it would have never gotten off the ground.

  164. Yes, it's still kicking, but should it be? by Anonymous Coward · · Score: 0

    I am so glad to see this topic on Slashdot. I can't say how many times I have asked around with this question, only to see it neglected. I think the issue of whether or not FORTRAN is still kicking belies another, much deeper problem in the numeric computing community that this post touches on. I'm convinced that numeric computing is in quiet crisis at the moment.

    FORTRAN is still kicking, very much so, for all of the reasons you enumerate: it has been the standard for so long that everyone uses it, it's widely available, and archaic code has stood the test of time. So in one sense, the answer is "Yes, FORTRAN is still kicking."

    In another sense, though, the poster was asking whether or not they should learn FORTRAN. That I just don't know about. Maybe FORTRAN is still kicking. The question, though, is "Should it be?"

    True, FORTRAN is fast, it's freely available, everyone knows it, and there's plenty of code available for it.

    However, FORTRAN is entirely too archaic. I can't stand the syntax, which I find gratuitously convoluted and difficult to work with (GOTO jokes that apply to BASIC should be applied with equal regularity to FORTRAN). Some might praise FORTRAN for its procedural "simplicity", but I think it's just crude and inefficient. Newer versions of FORTRAN, such as 90, 95, and so forth, take care of these issues, but are irrelevant because practically no one uses them! It's almost as if FORTRAN 90+ exists solely for the purpose of rhetorical argument, to say "Yes, but newer versions solve those problems." It's a trick, because the newer versions are rarely used, undercutting all the benefits of longevity and standardization that F77 provides.

    In the end, then, you have this dilemma: C/C++ provides the modern syntax, but lacks the numeric constructs of FORTRAN (native matrix notation, etc.). FORTRAN, on the other hand, is made for numeric computing, but undercuts itself by being nauseatingly convoluted.

    Thus, the crisis. Numeric computing is missing a language. We have high-level languages like MATLAB, Octave, R, Maple, Mathematica, and so forth, and the extremely low-level FORTRAN, but nothing in between. True, you can do numeric computing in C++ (that's what I do), but that's sort of bastardized due to the lack of native numeric constructs. Java might work, and has its own benefits for numeric computing, but also it has its own problems. Modern FORTRAN looks good, but no one uses it.

    So, in a sense, I don't think this guy should be asking "Should I learn FORTRAN?" We should all be asking ourselves "What the hell are we doing?" Is there a language that we could be using that would be better? Is it time to make a painful but necessary effort to just switch to, e.g., F95? Tacitly shun F77 and translate existing code into F95?

    This is something that really bothers me a lot. I don't mean to sound complainy, but I really think there is a problem. There shouldn't be as much of a disconnect between MATLAB/R and C++/FORTRAN as there is; there should be something sitting in the middle.

    Are there any other languages that look like serious rivals to FORTRAN that the numeric computing community should be switching to or evaluating? I've seen some suggestions here, like Ada, but are there others?

    I for one am surprised that OCaml hasn't proliferated more in numeric computing, given its speed and functional-object-oriented nature. It would be nice to see native OCaml matrix libraries, for example.

    So what about it? What else could this guy learn? What else could we all learn and teach in our CompSci 1024, Introduction to Numeric Computing course?

    1. Re:Yes, it's still kicking, but should it be? by spiro_killglance · · Score: 2

      Fortran having a goto isn't the problem, the
      problem is in fortran you have to use it, because
      you have got loop altering constructs like break and continue, or basic switches.

      Fortrans other, problem is that its lack of
      pointers or references, makes it very hard to
      do simple datastructs like linked lists, or
      trees without resorting to ugle and wasteful
      int arrays of look up values into other arrays.

    2. Re:Yes, it's still kicking, but should it be? by Tony-A · · Score: 2

      Should I learn FORTRAN?
      Should I use FORTRAN?
      Different questions, and not as related as one might think.
      From long ago, an observation that it is better to learn Pascal and use FORTRAN. Learning FORTRAN and using Pascal doesn't work.
      FORTRAN (I'm thinking FORTRAN-IV (1966 standard, I think)) is in some sense an optimal substitute for raw machine language. It can be very machine/architecture independent. There are things expressible in the language which would be better if they were illegal, but that would break the language. With Fortran77 they had an opportunity to make it a programming language. Instead they left it Fortran. I'd be surprised if Fortran90 were any different. If I had to use Fortan, I'd tend to stick to the basics and not victimize myself into thinking the language would take care of me.
      If the validity of your results is important, and you are willing to pay the price, Ada should be a good choice. There's stuff in Ada that turns "semantic" errors into "syntactic" errors. This is to avoid cases where a program can give correct results on one architecture and wrong results on a different architecture.

  165. Fortran 90, 95, 2000.... by Anonymous Coward · · Score: 0

    Yes - it is still useful. Here at LANL (http://www.lanl.gov/) it is the predominant language for existing AND new scientific codes. Array languages are just better suited for scientific computation, and Fortran is the most popular. Others such as ZPL show promise, but for mainstream support F90/95 is the best. I have worked with POOMA, which was mentioned by someone. There is a reason that very few people use it. C++ is just too gross for real codes.

  166. Design and Structure by Morris+Schneiderman · · Score: 3, Informative

    Fortran does not force you to write spaghetti code, any more than c forces you to generate buffer overflows or perl forces you to write unreadable code.

    Design and structure your application.

    If you are used to objects and methods, just use subroutine modules and entry points to the same effect.

    Fortran was where I learned to use multiple entry points into one sequential file for recursive processing.

  167. Hi by TekReggard · · Score: 1

    I'd just like to say that I'm employeed as a programmer and my last few tasks have been to take old highly computational programs in fortran, and reprogram them into VB 6.0. I have found that using VB is almost exactly like using fortran and is fairly easy. The last program I worked on was one that simulates the risk of consequence in an 80 foot drop of a container of nuclear waste. [My company engineers the containers] The only serious difference in code was how variables were stored going from procedure to procedure. When I was done, the code was nearly the same, but more modernized. So in my opinion VB 6.0 is a better option than FORTRAN just for the simple fact that its more, modern. -Me

  168. It's not 25 years old by Anonymous Coward · · Score: 0

    it's 45 years old. Original Fortran, 1957. Fortran-77 isn't all that different from F66 and its predecessors.

    That being said, if you write numerical algorithms or bust numbers for a living, there's nothing like it. (of course, that's also said of Vegamite)

  169. Extra integers in binary data records by tartagli · · Score: 1
    You wrote:
    Why does it do that stupid little thing when its writing binary data, tacking the extra integer on the beginning and the end?

    I know the reason for it: any binary file in fortran has to be separated into records. On the other hand any record may contain any sequence of characters, thus no record separators (like the newline for formatted files) can be defined. One of the solutions (not encoded within the standard, so be careful when you want to read a binary fortran file from a new architecture) is putting an extra piece meta-information with the length of the line (usually a four bytes integer not belonging to the record itself). Now you may want to ask: Why the length of the record is written both at the beginning and at the end of any record? The reason for this is that the fortran code should be able to move both forward and backward of one record at a time. Ones I bacame mad trying to discover these things ... also consider that the extra bytes at the boundaries of the records are written with the endianesses of the machine you are using! That time I hated fortran too! Bye, An happy Fortran and C user
  170. Don't do it -- more complicated than you think by Anonymous Coward · · Score: 0

    Right now I'm debugging a 10 year old fortran project, and it's hell. Somebody decided "hey, let's add something", and forgot that somewhere else in the code, common block A was used to transfer the data rather than common block B. Naturally, being common blocks, there is no need for having a common _name_ across the different files, so it is impossible to track.

    So, I'm stuck with a problem that can't be tracked, in a language that nobody knows and a project that most people don't care about anymore (after all, it's my Ph.D., not there's!).

    Take my advice -- forget the optimizing, and use a language you can read. Hardware will catch up soon, and in probably less time than it takes you to debug the damn thing!

    If you want a serious scientific library written in C, see the GNU scientific libary at http://www.gnu.org/software/gsl/gsl.html

  171. Survey Says: FORTRAN Most useful language by guisar · · Score: 2, Interesting

    I was involved in a study by UNM on the choice of language for entry level computer scienctist (aka the weed-out course). We considered all the options (java, c++, pascal, lisp, etc) and I happened to think it might be useful to ask practicing programmer what language they learned and what language they would recommend new developers to cut their teeth on.

    I asked them to consider both the training (aka marketability) and educational aspects of their recommendation. I didn't want the concerns of getting a job to be the overwhelming focus of their recommendation. I wanted them to also think about how much useful experience, insights and language neutral knowledge they gained from the language they first learned.

    Not suprisingly, BASIC was the most common language cited as "first learned" followed closely by PASCAL. FORTRAN, Modula II and SCHEME all placed in statistically close proximity to one another. Don't stop reading yet though- the punch line is to come.

    A more interesting trend came from these same practicing programmers answer to the question of whether they felt their first language was of great help to them or simply a cross to bear. FORTRAN 77 was overwhelmingly cited as the most worthwhile language to learn from. This was almost universal among the FORTRAN first users and statistically relavent among those who'd taken learned other langauges first and come to FORTRAN later on. Please note this was conducted in '94 before FORTRAN 90 had sort of taken over.

    The BASIC developers, once they had a bit of experience under their belt, as the source of many bad habits and of limited income earning and problem solving potential. The PASCAL initiates saw no use for the langauge beyond academia. Modula II was cited as a very educational language but with limited commercial potential. FORTRAN, though, was overwhelmingly cited as a great langauge to learn from.

    It's simplicity gave the semantics a low learning curve but the richness of the constructs and the structure they impose avoided the bad habits picked up within BASIC. The respondents (other than the old hats) were also nearly universally suprised by how widespread FORTRAN was not only for legacy code but as an everyday prototyping and general purpose language. They found FORTRAN knowledge mapped easily into other imperative languages.

    So, from both a practical, resume building point of view and for the holistic education FORTRAN will provide- go for it. 215 programmers can't be wrong.

    vr/
    Justin

  172. Re:FORTRAN? by Anonymous Coward · · Score: 0

    and you're a fag

  173. Factoring by Eccles · · Score: 2, Insightful

    There are some memory considerations and interface issues that make them want to switch over.

    If it's mainly the interface issues, restructure the Fortran code as a library, factoring out the interface code, and then rewrite the interface in a different language. It's not that hard to call library functions from most languages.

    --
    Ooh, a sarcasm detector. Oh, that's a real useful invention.
  174. In a nutshell: yes by cheezfreek · · Score: 0
    Sure it's still alive and kicking. A Committee Draft of the Fortran 200x standard is coming "real soon now" (i.e. should be within a month or two), and it adds asynchronous I/O and object-oriented razzle-dazzle, among many other things. It's all at http://www.j3-fortran.org, so go and take a look.

    And, as a Fortran compiler writer, I say "Use it! Oh God, please keep using it, or I'm out of a job!"

  175. True, but... by Anonymous Coward · · Score: 0

    I agree with you on a number of levels (and admire your use of Ocaml). I use different languages for different tasks; I think most of us do.

    I'm not sure that this is the issue here, though. I think the problem is not "Which language should I use?", but "Which language should I use for low-level numeric computation?"

    This is a much more serious and direct question. The problem isn't that one language doesn't do anything, it's that one language isn't good at what it's supposed to be good at anymore, and there isn't an adequate replacement. Sure, I wouldn't write scripting interface in FORTRAN or C++; I'd probably use Tcl/Perl/R/something similar. But when it comes to writing that multivariate integration routine, what should I use? FORTRAN? C++? OCaml? What?

    I agree that we should use the right tool for the job. This is something else: there is no right tool for the job.

    1. Re:True, but... by McDoobie · · Score: 1

      Good point.

      "Low level numeric computation" could involve different problems of it's own though. Is it suppose to be done in real-time, on an embedded system, on a cluster or supercomputer, etc...
      These issues would influence what tool I use. Perhaps a more accurate question(one with many more possible responses) would be "Which compiler is best for the job."
      I've rewritten a couple of my own Fortran90 libs into Ada95 using the OpenRavenscar profile, because they were to be used on a Real-Time system. There was nothing wrong(that I was aware of) with the F90 versions of the libs, just that the language/compiler didn't have the kind of safety/security features I needed for the port. The performance on the real-time system(Lynx OS in particular) was actually better than if I had used the F90 code, BUT when running the Ada code on my FreeBSD general purpose workstation the F90 code blew the Ada code away.
      So, even when talking about low level computation, there are still many variables(pun) to take into consideration when performance is a concern.

      If one was only talking about number crunching with no strings attached, I would say Fortran90.

      NiCad

  176. Learning from the past by greymond · · Score: 1

    If RPG video games like Fallout or Arcanum have taught us anything its that OLDER forgotten technology/magic ALWAYS is/works better than NEW technology/magic.

  177. Just do it. by JWhitlock · · Score: 2
    I'm beginning to wonder if I should invest the time in learning FORTRAN.

    What investment? It takes a day to learn FORTRAN. Just go learn it, then decide whether you want to use it or not.

    If you know any other programming language (C, C++, Perl, LISP, Visual Basic, Q-BASIC, ANYTHING), then it will take you a day or two to learn FORTRAN, especially if you don't need I/O routines. Give yourself a week if you want to learn I/O, EQUIVALENCEs, and the other details. Type "FORTRAN TUTORIAL" into your local Google search box and start working.

    I wouldn't want to learn it as a first language - I think the I/O is terrible. I can't use it for 30% of my work - I use C for decent I/O, preprocessor macros, simple string manipulation, pointers and casts. For the other 70%, it's just as good as any other procedural language.

    Of course, now someone will say C's I/O is terrible, and FORTRAN's is far easier. But again, it's silly to spend much time listening to debates like that, when you could learn the language in a day or two and decide for yourself. Jeeze, it's not C++ or LISP - it's just FORTRAN. It's like asking if Wordpad or Notepad is better for text editting...

  178. C is designed for fast execution by geekee · · Score: 1

    Anyone who's written in c knows that's it's constructs are very simple. Also "safety" features such as array bound checking, etc. are nonexistent. Therefore, compiling it to any normal machine code is very straightforward because of the simple mapping. Not familiar with Fortran, but I doubt it's any better for performance than c.

    --
    Vote for Pedro
  179. hunting bugs unrelated to the problem at hand? by ebyrob · · Score: 2

    What types of bugs would these be exactly.

    "Compilation" bugs? Those are actually there to help you and will save you many more nasty "logic" bugs in the future. Take some time and learn the language a little better, these will gradually become insignificant and invaluaable at the same time.

    "Logic" bugs? It's hard to see how logic bugs could be unrelated to the "problem at hand" unless it's a lack of libraries and or consistent interface that is your problem. Not sure how Fortran would help in any case.

    Knowing something about these bugs is the first step in trying to avoid them. (whereas switching languages would be one possible last step)

    I'll make some guesses:

    You're experiencing many compilation bugs because you don't understand the C/C++ environment you're working in, or because you're trying to force fit code from one environment to another. This is natural in switching from a specialized high level language to a very general purpose low level language. It takes a lot of time and effort to really master C or C++.

    A nice compromise might be using C or C++ that is callable from Matlab code. This could give you performance where you need it and ease of use when you don't. (Although from what I remember of Matlab the *seems* are no fun...)

    Of course, an even better alternative might be Java. It has wide library support and a great degree of similarity in the API's presented by most libraries. It might not be quite as efficient as C or C++ for some problems, but can be more efficient for others. It's also fairly easy to learn and use, and it's going to beat the pants off Matlab or Maple in computation speed. (It can also call native C when necessary, though the data structures differ greatly between C and Java)

    Hmm, maybe this whole article is just a Java troll...

  180. Why not learn them all... by jvl001 · · Score: 1
    Let me preface the following statements by stating that I program in C/C++/Fortran within a high performance computing environment.

    There are many, many numerical based libraries available (see LAPACK, BLAS, SPARSEKIT, etc) that were originally written in Fortran. Many people much smarter than I have spent countless hours writing, optimizing and verifying these libraries. Since there is no point in reinventing the wheel, I make heavy use of the above.

    However, just because they are written in Fortran doesn't mean I have to write in Fortran. I can link in these libraries using whatever language I chose. In my case, that's C/C++.

    The advantage and disadvantage of C/C++ is that they are advanced languages. You are given more than enough rope to hang yourself multiple times. At the same time you can write some amazingly powerful stuff. Good style and experience can protect you from many pitfalls.

    You mention that you find you are spending too much time fixing bugs related to your lack of experience with C++. If you are more experienced in Fortran than C++, then certainly you may find your time better spent coding in Fortran.

    However, there is no evidence to believe that Fortran is a superior numerical coding language based solely upon the large available base of libraries. Packages such as Blitz++ written in C++ have already demonstarted performance on par with Fortran based codes.

    If you have the freedom of choice use whatever you are most comfortable in using. The reason Fortran numerical libraries are still around is sheer inertia. Personally I can't imagine coding in a language as full of vestigial punchcard idiosyncrasies as Fortran on a daily basis.

    --
    /. is to journalism as graffiti is to a bathroom wall
  181. Bizarre complaints gainst other languages by tswaterman · · Score: 2, Insightful
    The poster makes some really bizarre complaints against other languages:

    any script based language (Matlab, Numeric Python, Scilab) to be inadequate as soon as it is necessary to use loops to describe a problem and using such tools for recursive systems can be a real pain.

    These are exactly the places where these languages excel, especially as compared with fortran! Fortran has only the most basic looping structures, and the lack of complex structures, pointers, and object abstraction makes writing any complex algorithm an excercise in mental anguish.

    Things like Numerical Python were implemented specifically to put the control structures in a language that is readable, writable, portable and understandable. If you really need to, you can code the bit twiddling in C and link from Python/Matlab/whatever, but for god's sake, leave the high-level program structure up where you can read it.

  182. FORTRAN 95 by ChaoticCoyote · · Score: 2

    Always use the right tool for the job... in other words, learn every language you can. I regularly program in C++ (mainstream applications), Fortran 90/95 (scientific number curnching and high-performance cluster apps), Python (scripting and prototypes), Java (portability and network systems), and various other languages as the need arises. Programming is a matter of algorithm, process, and design; syntax is a detail. BTW, your opinion of Fortran 90 is incorrect; indeed, Fortran 90 (and 95) is widely used, especially in the high performance computing (cluster) community. There is an active Fortran 95 project for the GNU compiler collection, and Intel has a "non-commercial" version of the Fortran 95 for Linux. Fortran 200x is in development right now.

    1. Re:FORTRAN 95 by ChaoticCoyote · · Score: 2
      What in the heck happened to my HTML tags? They were there in the preview... oh well, here goes again:

      Always use the right tool for the job... in other words, learn every language you can.

      Rgularly program in C++ (mainstream applications), Fortran 90/95 (scientific number curnching and high-performance cluster apps), Python (scripting and prototypes), Java (portability and network systems), and various other languages as the need arises.

      Programming is a matter of algorithm, process, and design; syntax is a detail.

      BTW, your opinion of Fortran 90 is incorrect; indeed, Fortran 90 (and 95) is widely used, especially in the high performance computing (cluster) community. There is an active Fortran 95 project for the GNU compiler collection, and Intel has a "non-commercial" version of the Fortran 95 for Linux. Fortran 200x is in development right now.

  183. Thoughts on Fortran Non-Obsolescence by coats · · Score: 3, Insightful
    1. Fortran as a language has evolved over the years. Most of the complaints that I see here are really myths about 1960's vintage Fortran-IV, not even about quarter-century-old Fortran-77.

    2. Always use IMPLICIT NONE in your Fortran; making declaration of variables required (as this command does) really can save your butt on large programs.

    3. It is really nice to program in a language where arrays are true "first class citizens". In neither C nor C++ can one conveniently and efficiently do the equivalent of
      Subroutine S( M, N, P, A ) ! arguments: Integer M, N, P Real A( M*N, 13*P, M+N-P ) ! local variables: Real X( M*N, 13*P, M+N-P ) ...

    4. For the current generation of compilers, Fortran is about twice as optimizable as C or C++. There are a number of reasons for this:
      • C compilers generally lack the address-calculation optimizations required for efficient access to run-time-dimensioned multidimensional arrays (stubbornness of the C-compiler writers being an obstacle here ;-()
      • Aliasing (array-overlap) assumptions present in C and C++ but not in Fortran (this may eventually be fixed by strinct-ANSI typing rules and restrict pointers -- provided that the programmer is smart enough to use them correctly.)

    5. A native complex data type is nice to have for many applications domains.

    6. Fortran character-strings frankly are both safer and a lot easier to use than C strings: they're the equivalent of a system-supported
      struct{ int length; char * contents; } foo_string;
      together with built-in (and optimizable!) concatenation operators, and comparison operators that behave sanely for different-length strings.

    7. Fortran-77 and K&R C are "small" languages with simple concepts and therefore are easier to learn and understand. Fortran-90/95 and ANSI C89 are "large" languages with correspondingly more subtleties and difficulty of learning. C++ is a huge language, and almost impossible to learn and understand completely--a fact that has much to do with the popularity of Java.

    8. As a numerical analyst, I find the fact that C -- by explicit wording in the standard -- refuses to respect parentheses, and has ill-defined arithmetic to disqualify that language for serious numerical algorithms. The result of -1/(-1) should not be up to the vendor to define!

    --
    "My opinions are my own, and I've got *lots* of them!"
  184. Will Python take over FORTRAN's niche? by steveha · · Score: 5, Interesting

    I read an article recently about a C extension to Python that very efficiently (and correctly) handled multi-dimensional matrix math. Thus you can write code using the very nice syntax of Python and still get good performance. The author of the article said something like "No one who has tried Python with these extensions ever wants to go back to FORTRAN."

    It made me wonder if, with enough C extensions, Python can take over FORTRAN's niche as a high-performance heavy number-crunching language.

    I don't know enough about the issues to make any predictions; I'm just wondering.

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
    1. Re:Will Python take over FORTRAN's niche? by fxj · · Score: 3, Informative

      Eventually it will. Look at www.scipy.org. They have a module called weave. With that module you can mix C-code into Python-code. The C-code is compiled when you run the program the first time and then you have a fast module.
      There are also some modules which allow the linking of FORTRAN subroutines into Python code.

    2. Re:Will Python take over FORTRAN's niche? by sandgroper · · Score: 2, Informative

      Lots of things to like about Python, but NumPy is one of the better ones, IMHO. There is a largish and growing community of numerical jocks coalescing around around Python in scientific computation. NumPy makes Python into an "array language" (like Matlab, S-Plus/R, APL, etc. etc.) where the crunching is heavily optimized C code. Links to LAPACK et al., and Fortran wrappers exist in f2py and PyFort, for that old still-running-after-all-these-years code.

      (Just another enthusiast, dabbling in the religious-war du jour. Flamage to /dev/null ;-)

    3. Re:Will Python take over FORTRAN's niche? by clive_p · · Score: 2, Informative
      For some things, yes. It has the advantage of good exception-handling mechanisms, which won't be in Fortran until F2002 (and then not as good as Python's). And for high-performance applications, where you want to run on parallel hardware, it's not clear that Python can compete with a fully-compiled language.

      But I'm astonished at the range of mis-information on earlier replies in this thread. Most seem to think that Fortran means Fortran77, though just a few mention Fortran90. Most users of the language that I know have switched to Fortran95. It has just about everything C++ has, and more in a few ways: for example in Fortran you can define your own operators, and overload them. In C++ you can only overload an existing operator symbol, which leaves you with a rather small choice. Suppose you want to implement a "like" operator for string matching along the lines of that in SQL: you can define .like. to do it in Fortran, what obscure symbol are you going to choose in C++? Fortran95 isn't fully compatible with object-oriented programming, but for scientific applications that's often irrelevant.

  185. I meant Fortran 77 by coult · · Score: 1

    Sorry, I meant Fortran 77. Fortran 90 of course has pointers, but if I'm not mistaken Fortran 90 has facilities for avoiding pointer aliasing (perhaps that is what your code is showing? I've never written Fortran 90 code...)

    --

    All is Number -Pythagoras.

  186. Oops! You mean x^2 is _NOT_ x squared? by binaryfeed · · Score: 1

    I think the author spent two weeks wondering why 3^2 kept giving him the answer 1 instead of 9.

    Duh.

    In my numerical analysis class, we spent a good deal of time demonstrating the pitfalls of Fortran. There are certain numerical mistakes that can ONLY be made in Fortran. Ick.

  187. Pick'n'mix? by Anonymous Coward · · Score: 1, Informative

    I do use Fortran (F95). It runs beautifully both on my Linux desktop and on a remote Alpha cluster on True64. It also runs fine in the Soliaris and SGI workstations. The beauty of F95 is not that it is quite portable, but it is _easy_ You can use loads of time saving constructs which are a pain to deal with in C (I also do C for some other things mind you). If you use Windows, you get some pretty good debuggers (the ones for Linux are quite ugly, and since gcc does not yet support F95, gdb does not particularly care for it).

    The thing is that if you tye F9x, you'll find writing the code easy. Learning the language is a no-brainer. You can then interface the numerical stuff with things such as SciPy to display it and so on.

  188. Used for jake brake simulators by danpbrowning · · Score: 2

    I happen to know that fortran is used for:

    * Modeling entire forests (not as easy as it sounds)

    * Modeling Jake Brakes (18 wheelers')

    It is a powerful language, still very much alive. Notice recent changes that allow it to link with Visual Basic code as the UI.

    --
    Daniel
  189. Two words: complex variables by Anonymous Coward · · Score: 0
    We use Fortran for our high-end numerical simulation work (very big models, very big computers). Never mind all that, Fortran since day one has had COMPLEX VARIABLE TYPES (x+jy) and has all the requisite built in functions. C does not. C++ has it as a kludge, if you get the lucky vendor that includes a library. Fortran has LINPACK and all the good, super optimized, super tested, super KNOW-IT-GIVES-THE-RIGHT-ANSWER subroutines from IMSL and such.

    Besides, I'm not porting the 2.7 million lines of code to C++ to make some linux weenie happy.

  190. The Infantile Disorder by asdffdsa · · Score: 1

    "FORTRAN --"the infantile disorder"--, by now nearly 20 years old, is hopelessly inadequate for whatever computer application you have in mind today: it is now too clumsy, too risky, and too expensive to use."

    --Edsger Dijkstra, 1975
    How do we tell truths that might hurt?

  191. Improve C++ by ooa · · Score: 1

    I think the original poster is correct about a few points. A major problem with C/C++ is that it assumes its user is an expert programmer and will willingly go off the edge of the nearest cliff if steered that way. On the other hand FORTRAN is very primitive but can still provide better optimization because it can make more assumptions. My proposed solution is a subset of C++ that limits what the programmer can do so that novices, and people that don't need the flexibility can have seat belts. With these limitations imposed, it would be possible for the compiler to also make more assumptions and generate more optimized code. There might even be a compiler option to automatically generate multithreaded object code.

  192. the us government still uses it by wifflefan · · Score: 1

    if you ever see yourself working for the us department of defense, it might worth your time to familiarize yourself with it. sure, in most cases they've moved on from it (and ada) to c++ and others, but there's a crapload of legacy out there that has to be maintained by somebody. because a lot of the guys who know fortran are near retirement, they'll need a replacement...and if you knew fortran, you'd be one of the few young folks who knew it.

    w|f

  193. Fortran at 300,000 M/s by rockmuelle · · Score: 1

    Fortran is only still alive because that's the only language that scientists and engineers (other than CS people) are taught. Just like the speed of light is still considered constant becuase that's what we were all taught. -Chris

  194. ???huh??? by hawk · · Score: 2
    >Of course, if You know the size of Your matrices
    >in advance, and are able to simulate decent
    >control structures with GOTOs, go ahead...

    ???

    GOTO???? Yes, both C and older version's of Fortran have them, but the last version of Fortran that needed them was the 1966 standard. There is no need for them in 77 (save the strange places you would also need them in c, but those are more thana little rare).

    hawk, trying to figure out how to criticize the 1966 c standard

  195. FORTRAN is still *heavily* used by many airlines. by Richard+Steiner · · Score: 1

    The core mainframe-based flight operations system I worked on at Northwest Airlines (originally developed at United and also heavily used there) is almost all FORTRAN code, and there are several dozen airlines around the world (including Luftansa, Air France, and Air Canada) who are still using various "USAS" airline applications from Unisys Corporation (written in FORTRAN 77).

    (USAS stood for "UNIVAC STANDARD AIRLINE SYSTEMS" at one point in time, and it reflected the heavy presence Univac 1100 mainframe hardware had in the airline industry in the 60's and 70's).

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  196. See the forest, not the tree by Weasel+Boy · · Score: 1

    You are asking entirely the wrong question. It is never appropriate to ask, "Should I learn ?" Instead, you should ask, "Under what circumstances is it best to use ?" For nearly every language, there is a use for which it excels.

    This attitude that "you kids" seem to have today of "is this language worth learning" drives me up the wall. Learning a language to the point where you can use it to do routine tasks should not take more than about 4 weeks. It's just not worth worrying about. I have used over 2 dozen programming and scripting languages, and won't hesitate to learn more.

    If you know the fundamentals of software construction, you can see that most programming languages are about 95% similar. You can categorize most languages into one of a handful of classes of similar languages. Once you arrive at that point, whether or not to learn another language is almost a complete non-issue. If it fits the job, you do.

  197. What a shame: reviving FORTRAN on such tragic day by marcelk · · Score: 1

    It is striking that this nonsense FORTRAN debate makes it to the /. front page on the day that the death of E.W.Dijkstra has been announced. It is even more striking that the news about the loss of this computer science giant is deemed of less significance by your moderators. What is next? Advocating the implementation of 'goto' in java 3?

    E.W.D. was one of the most influential pioneers of computer science, like Turing, Zuse and Von Neuman. His work was always been in the light of creating a solid mathematical foundation for programming. His most remarkable achievements include the wide acceptance of 'structured programming', the invention of semaphores and ofcourse the Dijkstra shortest-path algortihm. He was awarded the ACM Turing Award in 1972. For /.-ers is may be interesting that he also started the first real flamewar with his infamous "Goto considered harmful"-article.

    For the news on his death: here, here or here.

    For programmers who like to read all of his manuscripts (if you haven't read them, you don't know what programming is about): there is a great archive of all his material. Dijkstra died at the age of 72. May he rest in peace and may his work live on.

    Back on topic:

    FORTRAN, "the infantile disorder", by now nearly 20 years old, is hopelessly inadequate for whatever computer application you have in mind today: it is too clumsy, too risky, and too expensive to use.
    -- Edsger W. Dijkstra.

  198. Skip to page 7 by briansmith · · Score: 2

    http://www.cs.utexas.edu/users/EWD/ewd03xx/EWD340. PDF

    Granted, I don't know if this guy has the necessary credentials to make such statements.

  199. picking nits by Anonymous Coward · · Score: 0

    forest, trees, blah blah blah...

    The post in question was discussing the code in NR, which uses FORTRAN 77 (yes, I know it can be compiled using F90).

  200. Try Numpy by Devil's+Avocado · · Score: 1

    Check out the numerical extensions to Python. They're quite good and can give you an environment with the power of Matlab for zero dollars.

    Numpy uses the netlib libraries behind the scenes, by the way, so you get very good speed for array operations. You get the best of both worlds -- Fortran speed with Python's expressive power. It's much easier to do I/O and UI programming in Python than Fortran. :-)

    -DA

  201. FORTRAN used for high perf. computing at ARSC by Isthistakenyet? · · Score: 1

    I worked at the Arctic Region Supercomputing Center for one summer when I was an undergrad. I didn't do any FORTRAN programming, but almost everyone else there did. If you want some information about FORTRAN programming on high-performance systems, check out their newletters, or just try searching their site for 'FORTRAN'.

  202. Free modern FORTRAN for Linux, Solaris, Windows by $QIO · · Score: 1

    If you're good at a tool the religion is kind of moot, isn't it ?

    Try a modern Fortran called F which pruned away some stuff that was said to be confusing (although not to me) and kept the good. It is free, although not GPLed (spare me the GPL flames, please):

    http://www.fortran.com/fortran/imagine1/index.ht ml

    Regards,
    rcs

  203. VISUAL BASIC ROX by Anonymous Coward · · Score: 0

    If you wan't the job done, and don't want to fuck around debugging all day go for .net, either vb.net or C#, these languages are so user friendly it hurts !!

  204. Still a required course... by krich · · Score: 1

    FORTRAN is still a required programming course for an undergrad degree at my university... but not for the CS students. It's still required for all Nuclear Engineering students, because there is nothing better or with a decent enough user base for nuclear modeling applications. No one else takes it any more at my alma mater except for us nukes.

  205. Have you had a look at "R" by Anonymous Coward · · Score: 0

    It may or may not be up there in computational speed, but is is extremely functional mathematics application, and it is extremely configurable, and is Open Source. An excellent application that I have used on occasions with excellent results.

    Kim

  206. Google group discussion. by OoSync · · Score: 1

    There has been a very long discussion on the comp.lang.fortran groups about a very similar question. Many people there can help you decide what your particular problem warrants as they use most of the languages described in the various comments here. Quick link to this particular thread is below: discussion at groups.google.com --OoSync

    --

    I always get the shakes before a drop.
  207. ROOT - Scientific computing in C++ by Anonymous Coward · · Score: 0

    I don't know if anyone mentioned ROOT yet, so here goes.

    There's a framework from CERN called ROOT, which has a lot of nice features for numerical scientific computing.

    The language is C++, but don't let that scare you - in time you will also frown upon procedual languages (they are hard to maintain) and functional languages (they just don't do the job for numerical stuff - to bad - I like the concept).

    ROOT provides things like histograms, persistent object storage (and it beats Objectivity by miles!), and ladida. ROOT also has an interactive scripting environment, using C++. This is cool, as it means you can prototype your algorithms as scripts, and when your happy with them, you can simply compile them, and get much higher speeds.

    Also note, that Intel's free C++ compiler is reputed to give a 30% increase in speed compared to GCC 3.0.

    ROOT is used by some 70+ physics research projects around the world - from the gigantic Alice and STAR to the more modest Athena and BRAHMS.

    If I were you, I'd defently consider C++ again. The stuff you've found on netlib is almost all outdated, and there's a good chance that it's been ported to C/C++.

  208. Java? by MConlon · · Score: 1
    Ya, I can hear everybody laughing now, and I'll probably get modded into the basement, but bear with me for a minute...

    There are quite a few people working on polishing up Java for numerical work.

    A couple of links would be IBM's NINJA, the Java Numerics page and Java Grande.

    There are papers (albiet old) on the IBM site which show they were able to come within 10% of FORTRAN performance using Java code and a massaged JVM.

    IBM's matrix routines (downloadable somewhere) are friggin' fast.

    The runtime optimisation also lets you tweak and prune to a greater extent than C/C++ code, although FORTRAN still rules in the code optimisation department. I believe this is because it's a simpler language (and most papers I've read come to this conclusion... C/C++ lose because the compiler can't be as brutal in its optimisation).

    For a while there were large advances in C/C++ compilers, but I don't see as much of that any more... not that it would be on my radar necessarily, because I haven't kept up on the reading.

    Anyway... Java... eventually. I think it'll get there. Of course I meet with huge resistance from the FORTRAN purists whenever I say that, but that's life. Whatever works for you, I guess. I'd rather write stuff in Java that FORTRAN; FORTRAN drives me up the wall.

    That being said, I do most of my stuff in MATLAB these days. That program rocks.

    MJC

    1. Re:Java? by mysterious_mark · · Score: 1

      Java compiled to native code can be both clean and high performance. Mark

  209. Mixed languages by vodka_au · · Score: 1

    In my first job I found niether, FORTRAN nor C/C++ up to the job. But given that the FORTRAN compiler compiled in to C, I found that it was easy to write C programs that used FORTRAN subroutines. The catch being that the C wrappers I wrote for the FORTRAN subroutines were not portable in their own right as name munging and argument handling was differnt for each operating system.

    However the effect was worth while, and gave me a way of dealing with legacy code (all in FORTRAN).

    Mixed language programs, is an idea often forgotten, but often give the best solutions.

  210. Is FORTRAN Still Kicking? by Anonymous Coward · · Score: 0

    Very much so. I use it very regularly on old and new code. I typically use f77 primarily because I use C for all non-numeric work. This tends to make new FORTRAN functions very short and clean. Pop in, do a bit of complex arithmetic and pop back to C. As long as you don't pass strings
    to FORTRAN mixing the languages is easy. On one
    large (>500,000 line) system I mixed C, FORTRAN, lex and yacc.

    I don't usually use FORTRAN unless I'm doing complex arithmetic unless I want to preserve the style of a larger system.

    FORTRAN and C share a common trait. I can remember all the important parts of the languages standards. I doubt that anyone can make that claim about C++.

    Note that if you don't do serious numerical work, there probably is no reason to use FORTRAN. My default choice is C which handles the 80% that doesn't require heavy lifting.

    As for people who insist on rewriting numerical routines in the language de jour. They should get a life instead of wasting time rediscovering how hard serious numerical routines are to code.

  211. Yes and No by Anonymous Coward · · Score: 0

    I've extensive scientific programming with both of these languages.

    The strengths of FORTRAN and Perl in scientific computing are orthogonal.

    FORTRAN is perfect for number crunching - compilers are very mature, lots of numberical libs exist, the language lends itself to matrix operations, etc. That's why FORTRAN is so pervasive in physics and engineering settings. But FORTRAN is the wrong tool for text manipulation, string matching, process management, etc.

    Perl is great for text manipulation, especially with pattern matching (regexps). That's why Perl is used so much in bioinformatics where the bulk of the work is munging and searching text data and connecting to DBs. But its a terribly inefficient language for large scale number crunching.

    1. Re:Yes and No by Bush+Pig · · Score: 0

      Of course ... remember that _real_ men code their text editors in FORTRAN ...

      --
      What a long, strange trip it's been.
  212. Python has some strengths by tutal · · Score: 1

    I've used Python for a numerical analysis / computational methods class (wich delt with algorithms and algorithm discovery). I found it to be very capable in handling very large and very small numbers. For example, it was able to determine 30,000! (yes that's thirty thousand factoral). It also handled extremely small decimal numbers to the precision of 10^(-600000), I didn't go any further as I did not care to test how precise Python would allow. The only problem I had was with garbage collection, when using it I did not know of any GC methods (as I was new to the language) and subsequently after a very memory intensive procedure was run (like computing 30,000!), my computer pretty much crawled along.

  213. FORTRAN and Proteins by Kaz+Riprock · · Score: 1

    FORTRAN is still currently the language behind CHARMM and AMBER, two molecular force field programs in the realm of protein modelling/energetics. It's also the reason that PDB files (protein coordinate files) are the beast that they are to work with. Each column has to be in perfect alignment for when the FORTRAN parser reads them in as units for the CHARMM program.

    --
    Mordor...a magical, mythical land where women are more rare than dragons--but where every man would rather find a dragon
  214. There are 'better' ways to program in FORTRAN by SignoffTheSourcerer · · Score: 1

    RATFOR was the start of structured F77, but is rather obsolete now.
    F90 is ok (that's it)
    HPF (High Performance FORTRAN) is not a dream, but one of the best cross-platform opensource parallel languages I have ever seen.
    take a look at Adaptor

    --
    Ordo Militum Unix.
  215. Re: Ok, you are forgiven by anticypher · · Score: 3, Insightful

    A quick search on jobserve turns up 19 current job listings requiring Fortran. Not bad for a 30+ year old language. Several satellite, stress engineering and meteorology jobs.

    Working code just doesn't stop working because some new language has come out. Imagine having the job of converting 5 million lines of fortran code into visual C++ dotNet code. By the end of the week. With no errors. And no overtime... It just doesn't happen, working code doesn't need to be replaced, and thus it isn't.

    I'm still surprised when recruiters ask me about my fortran and cobol skills. I don't list them as skills, because I haven't touched them in more than a decade. But the skillPimps can see I'm an old fart, and the older ones know I started my career with the old languages, because perl and C++ didn't exist in 1972. Hell, Larry Wall was still in diapers when I first touched a computer.

    This goes back to the discussion, here and other places, about the difference between coders and computer scientists. Coders insist the only language they know is the only one for the job, because they are too uneducated to understand a language is just a tool. CompSci gurus will just pick up the best tool for the job, whether something ancient like fortran, or something like a procedural language or even assembler.

    the AC

    --
    Hemos is like...sci-fi fans;he thinks technology is cool, but he hasn't bothered to understand the science it's based on
  216. Troll? by Anonymous Coward · · Score: 0

    -1, Troll?

  217. Re:why not: Fortran ***AND*** C++ ??? by Anonymous Coward · · Score: 0

    Hardly. Apparently, you've slept through the last half-decade of advancements in OO numerics and C++ libraries. See Blitz++, MTL, and the numerous other C++ projects listed on NETLIB.
    Sorry, but there's a hell of a difference between beating a naive fortran code compiled with g77 (which sucks) and a manually tuned piece of code compiled e.g. with IBM xlf.

  218. Fortran is more versatile than it looks by seawall · · Score: 1
    The language has been used to write compilers (e.g. The original Pascal), screen editors, memory management (for large scale matrix manipulation) and even whole operating systems such as PRIMOS (albeit with some serious libraries added) as well as things like S and numeric libraries.

    Most of this stuff was eventually rewritten in other languages and programming them wasn't necessarily an entirely pleasant experience but all of the above were done with Fortran 66 [often with a ratfor preprocessor], all were successful in their niches and the things in that list I used were pretty reliable. Note also that, by using the popular compiler of the day, most of these projects were also fairly portable.

    There are some advantages to a sparse environment and Fortran (at least until recently) certainly qualified!

    PRIMOS was a particuarly interesting case. Prime had a similar idea to Unix: They wrote it in a language accessable by their target users of scientists and engineers: Fortran IV (Later it was rewritten in PL/1 subset G).

  219. Real Programmers STILL use FORTRAN by Chris+Y+Taylor · · Score: 2

    http://www.pbm.com/~lindahl/real.programmers.html

  220. price of Matlab and in fact of every software by ldumais · · Score: 0

    Additionally, although tools like Matlab exist they don't provide the power that justify the huge price tag they carry.>

    This is the problem of all linux users, they think that everything is free and they are killing their own industry living on the money of the stupid IPO of companies like RedHat, valinux, mandrake and others. The development of linux would never be without those company and by the governement funds.

    I'm just feeling bad about this cause I would like to do software for living later and this is not on the linux side that I will can.

    I'm just hoping linux will not kill the software industry.

  221. Fortran's still there. Learn it and move on. by syousef · · Score: 1

    I'm currently writing an Astronomy library in C# for an Astronomy Masters (which I'm doing entirely online incidentally). My motivation was disgust with the overuse of archaic languages in computing. For example try finding a book on orbit determination with a computer that doesn't have basic or fortran code (or sometimes pascal).

    I want to write a truely extensible, object oriented library. OO programming is ideally suited to flexible scientific modelling, where everything is based on a scientific model - mostly idealized or statistically based. I narrowed the menagerie of languages down to 3 possibilites - Java, which I ruled out as too slow, C++ which does require mastery if you don't want to be chasing technical and memory management bugs, and C#. I chose C# for a number of reasons, not the least of which that this was a good pet project to learn to use it. I've written some code for numerical methods, and a few simple astronomical problems so far. C# does appear to be a good language to work in for this kind of problem. My only complaints are:

    1) It's a proprietary language.
    2) It's currently limited to the windows environment, and some parts of it may always be despite efforts to get past this.
    3) Lack of 3D graphics support at this stage.

    Advantages include:
    1) A modern complete and quite powerful language.
    2) Interoperability with other languages.

    My feeling is that scientific computing needs to move on from the procedural era, just as most business computing has. It's not good enough to say that you're not a computer person and thereby justify your avoidance of learning the best currently available tools for a programming task. That just doesn't make sense.

    That said it also makes sense to be able to read, modify/maintain and perhaps even wrap existing fortran code. I would encourage anyone who's doing scientific programming to LEARN Fortran, but not to use it in a new scientific project, unless constraints won't allow the use of an object oriented paradigm.

    There is a lack of availability of freely available numerical libraries in other languages. This is a good reason to go out and develop them! Not a good reason to stay buried in archaic code. There is nothing inherent about modern OO languages that prevent them for being used for numerical processing.

    Sammy

    --
    These posts express my own personal views, not those of my employer
  222. MATLAB & loops by Black+Cardinal · · Score: 2, Interesting

    First of all, let me say that I concur with the many others who've said that FORTRAN is alive and well. For a lot of numerical computing, it is a powerful tool.

    I do not consider MATLAB a replacement for FORTRAN, rather it's a fast-feedback analysis and visualization language. For matrix math it's unsurpassed. But I totally disagree about it being inept at looping--it would be a useless language if it were.

    It's been years since I've used MATLAB extensively, but I remember writing simulation of electro-mechanical systems in MATLAB that used FOR looping, conditional looping, and breaking out of loops. No disrespect meant, but I suspect that the person who asked this question has only a cursory knowledge of MATLAB, the kind you get after having one linear algebra class in college where the most advanced operation you use MATLAB for is to find the eigenvalues of a matrix. If you're a EE, then you don't really get to see what MATLAB can do until you take some advanced control systems or power systems analysis classes.

  223. Free F compiler available by nerk88 · · Score: 1

    If you are after a Fortran like compiler, there is the F compiler. F is a language that is a subset of Fortran 95. The F compiler is free (check the licence, its been a while since I used it) and can be found here.

    From what I remember the F language supports a large and usefull subset of the Fortran 95 language and the compiler is based on the NAG compiler, so should produce pretty reasonable code.

  224. Re:Are you kidding? Of course it is! by Anonymous Coward · · Score: 0


    Don't be an idiot. You have to realize that they're probably using Fortran because that's what they learned and they're biased against all those "lesser" languages that they don't know or understand. Give it a break. I still have to argue with dinosaurs in my company that think Object Oriented programming is a fad, "Windows is a toy operating system", and "the command line is the only interface our users need". When you get older, you'll come to realize that daddy doesn't know best. In fact, when it comes to programming, the old programmers are usually wrong in assessing new technology.

  225. Hey, thanks! by maynard · · Score: 1

    I desperately need a free for noncommercial use F90 compiler. Thanks! If the license turns out to be OK for University work I'll install it throughout our lab. This will make a number of scientists very happy!

    So, is Fortran dead? Hardly. :)

    --Maynard

  226. Re:why not: Fortran ***AND*** C++ ??? by Chexsum · · Score: 1

    ...they don't have to use just one tool.

    This idea is common sense IMO. =)

    --
    Pixels keep you awake!
  227. Is Fortran still kicking? by grampy · · Score: 1

    OK. The argument about numerical efficiency -- I'll cave on that. But, Fortran vs. C/C++, it's got to be very close. The real issue here is about the culture of language. You can tell by my nickname that I go back aways - my first language was Fortran in the (19)60's. It was great. Back then. Then Cobol, PL/I, 20 different assembly languages, APL, Bliss, Pascal, C, C++, Perl and, finally, Java, Python, PHP. The real important differences in languages are the ways they help you to think about the problem. I have some old colleagues who still insist that Fortran is best for what they do. However, when I probe, I discover that they have many types of objects they're dealing with. If they knew an object-oriented language their code would be simpler, probably would more accurately reflect the physical model they're trying to emulate. (recall: (legend has it that) C++ was invented to simulate phone systems.) So, though Fortran may still live, it's unfortunate. Java or C++ would be better to help clarify thinking. C++ would be better for performance. C++ is better than Java because in the real world we really do have multiple inheritance.

  228. Damn, I wish someone would mod this up by Anonymous Coward · · Score: 0

    This comment elequently points out -- from a real F developer -- why Fortran is still of such use! Buddy, even if no moderators notice your comment, this AC surely does.

    Best to you,
    -AC

  229. Forth by jbolden · · Score: 1


    This depends a bit on your age. If you are old enough that you know the HP calculator syntax 32S, 48G... pretty well then you basically know Forth. If you liked the HP calculator syntax you'd probably like Forth. Forth is faster than Fortran, it can be translated easily into pseudo-assembly, and thus you can take advantage of CPU firmware specific instruction sets. Forth does have a very nice style is freely available. Lots of mathematical libraries exist for it (nothing like the number for Fortran but enough so you are writing everything from scratch). It's kind of outside the mainstream but you are looking for suggestions...

    1. Re:Forth by Jerry · · Score: 1

      I've used Forth and have programmed an HP calculator. The Reverse Polish Notation (RPN) used by the HP is only similar to Forth. The HP can be mimicked by a LIFO stack and a single loop surrounding a series of case statements that parse the operators operators. The operators indicate how many operands are replaced by the result.

      The book "Starting Forth", by Lee Brodie, is still the best introduction to that wonderful language. It is humerous too! Forth is a bottom up threaded language. You define some words. You combine some of them to define other words. Eventually you have a single word which is your entire application. Only assembler is faster than Forth.

      --

      Running with Linux for over 20 years!

    2. Re:Forth by jbolden · · Score: 1

      Exactly definitions + stack manipulation based just like the HP. Anyway I think we agree its another choice for the low level computational intensive type work he wants to do.

  230. One reason - buggy C/C++ optimizers by Animats · · Score: 2
    One big reason much number crunching is done in FORTRAN is that FORTRAN compilers are expected to get number-crunching right. Some friends of mine maintain some major numeric codes written in C. These codes are used for structural analysis, and the right answers matter. For each new version of each major C/C++ compiler, they run a big collection of correctness test problems. And they find bugs that give wrong answers. Most new Microsoft compilers do not do optimized number-crunching right as shipped. Nor are the GNU compilers without flaw. They typically use compilers several years old, for which the problems are fixed or known, for serious work.

    In the FORTRAN world, where number-crunching is the main application and optimization is easier, compilers are expected to number-crunch correctly as delivered, or the vendor gets hell. So they do.

  231. FORTRAN is like VI ... by IXI · · Score: 1

    FORTRAN is like VI
    It's blatantly out of date
    But it will never die

    If you look sharply enough at the FORTRAN syntax you can still see the punch card shine through. And through VI you can look at the typewriter console.

    --
    He saw some dirty arabs and fired. Too bad it was just some friendly kurds, BBC reporters and his fellow cowboys.
  232. FORTRAN is still kicking by Cable · · Score: 0

    I've seen a lot of FORTRAN code converted to Visual BASIC. But then I've also seen companies still using FORTRAN 77 on IBM 4381 Mainframes, running DOS/VSE, go figure! FORTRAN and COBOL jockeys also tend to make some serious money for those companies running Dinosaur IBM 4381 Mainframes.

  233. Blitz++ (a C++ library) vs Fortran by Anonymous Coward · · Score: 0

    All of you who are clinging to Fortran based on the assumption that Fortran is faster (and who are afraid to research the facts because you might find out you should learn another language), do some research:

    Blitz++ (a C++ library) vs Fortran
    The benchmarks show Blitz++ beating Fortran in most cases. (Originally from Dr.Dobbs Journal)
    http://osl.iu.edu/~tveldhui/papers/DrDob bs2/drdobb s2.html#qcd
    4: Conclusion
    After nearly a decade of being dismissed as too slow for scientific computing, C++ has caught up with Fortran and is giving it stiff competition. The combination of new library design techniques (expression templates, template metaprograms) and better compilers means that programmers can enjoy the expressiveness and ease of C++ without paying a performance price.

    And if you're worried about "not being able to use the legacy fortran code", then call fortran from C.

  234. Re:FORTRAN? by IXI · · Score: 1

    I really like PHP. It's fun. :)

    Maybe fun to play around with for a while, but it can't seriously be considered a programming language. It's a totally inconsistent mixture of C, Perl, Java and whatsoever. The API description already take >2000 pages and keeps growing like leavened dough. Security was discovered only recently and I bet there are a zillion holes still buried inside.

    --
    He saw some dirty arabs and fired. Too bad it was just some friendly kurds, BBC reporters and his fellow cowboys.
  235. Fixed in C99 and soon in GCC by yerricde · · Score: 1

    In C, for the same function, you are allowed to send it the same array twice (it's called aliasing)

    As velco pointed out, ISO fixed the aliasing problem in C99. C99's 'restrict' keyword lets a developer specify in a function's prototype that no two input pointers point to the same area of memory, letting the C compiler do Fortran-esque optimizations. GCC is working toward C99 support.

    --
    Will I retire or break 10K?
  236. Its a real man's language by thogard · · Score: 2

    Your not going to learn about the computed goto? how many other languages allow you to use an expression to evaluate to a three way branch?

    How about redimensioning an array? Or even redimensioning the middle of the array away so you can use its memory for some other bit of code you need to run? Many programs would set up a huge array and then repartition it latter depending on what they were doing and it was common to load compiled code into an unused section of memory and then call it.

    How about vector calculations?

    The fastest machines in the world still use Fortran and ist mostly because there are standard ways of telling fortran to do vector arithmetic while newer languages depend on add on libraries.

    Fortran's history is relected in most languages today as well as the archetecture of the CPUs.

    A language that doesn't affect the way you think about programming, is not worth knowing. --Alan J. Perlis
    Fortran offers new ways to wrap your head around some problems. That makes it worth learning.

  237. I was forced to take Fortran 66, 77 and WATFIV by pvera · · Score: 1

    I was forced to take Fortran 66, 77 and WATFIV (University of Waterloo Fortran) in engineering school in 1988. 14 years later and I still curse the goddamn day I walked into that classroom.

    The only thing that course was good for was for some war stories:

    1. Our professor, an electrical engineer, kept swearing there was no way a modem could go faster than 1200 bps. I know he meant baud, since normal copper has a hard time going over 2400 baud but to this day I still remember him. I bet he is still teaching that damn class.

    2. I took this course at the University of Puerto Rico. Puerto Rico has sub tropical weather, for us 78 degrees means run and grab a frickin sweater. The very first time I saw a parka in person was in the admin console for the DEC/VAX 11/750 at the computing center. The VAX was kept in a glass-walled room at around 65 degrees Farenheith. The parka was kept by the door for when the sys admins had to walk into the room!

    3. We were using DEC VT-100 terminals to access the VAX to do our homework. A couple lucky bastards got to use the VT-220 (which to us was the shiite).

    4. The first time ever I connected to a computer system remotely was when we used our VAX accounts to connect to the library catalogs of the other UPR campuses in the island. We could use it to request inter-library book loans.

    5. We learned to curse the students taking structured programming in Pascal. While our WATFIV programs were only a few hundred lines long, theirs were thousands! If you were unlucky enough to run a compile right after one of the WATFIV people started theirs, you could actually walk to the cafeteria a hundred yards away, get coffee, come back and still not finish the compile.

    After I graduated in '92 I thought I would never see a damn VAX 11/7XX series again. 6 months later in the US Army Space Command, guess what I found: A freaking 11/780! Gimme a break!!!! We used them for simulating RF saturation of satellite communication networks. Terrible. Step too hard on the elevated floor tiles and the disk packs died on the spot. No wonder there were so many disk platters used as decorations (people would spend night shifts engraving them with all sorts of cool stuff, then hang them as cubicle art).

    Fortran was a necessity back in the day, but honestly I don't see why would anyone need it now except people maintaining legacy apps. WATFIV output formats still give me the creeps after all this time.

    --
    Pedro
    ----
    The Insomniac Coder
  238. Re:FORTRAN? by B3ryllium · · Score: 1

    Well, I won't argue with that. It's nowhere near the programming language that C++ is. I like it, though, because it gets results. It's quick and painless to build a nice database-driven website with a decent visual appearance, whereas making a good-looking GUI app in C++ (or even a website using C++ :) can be an excercise in futility for inexperienced programmers.

    Anyway. I like PHP because it gets results, and because I haven't decided to take that final leap and actually learn how to program GUIs in C++. :) Oh well, once summer's over, I'll jump off that building. :)

  239. Does the JIT help by nabeel · · Score: 1
    I'm a big MATLAB fan, and worked at The MathWorks for 5 yrs. The latest release includes a built-in JIT (Just In Time compiler) which automatically compiles loops before running them - the feel and use is the same as before (feels interactive), but you can get a serious speedup; it could be worth looking at (brand new stuff, just released this week).

    Netlib is FORTRAN-ish, but has a significant amount of C, too. Many languages, MATLAB included, allow you to call C and FORTRAN code from their languages. So why not use the best of all these worlds? Pick your favorite language that provides you with an API to functions implemented in other languages, and use it.

    I prefer MATLAB for *many* reasons, but regardless of what you pick odds are you can still mix-and-match languages to some extent. Microsoft's CLR is a big step in this direction, too, but that's a whole other thread...


    -- Nabeel

  240. Data Dependency by MrEntropy · · Score: 1

    One of the major reasons FORTRAN became so popular in the high performance arena was data dependecy analysis. Companies like Alliant, Convex, and SGI were building parallelizing compilers based upon Kuck's concurency analysis. In order to make things concurrent in a loop (execute in parallel), the compiler needed to make sure there was no data dependency. In example:

    for (i=0 ; i<100; i++) {
    a[i] = b[i] + c[i];
    }


    In theory, each iteration of the loop could run on a seperate thread because it is not data dependent. i.e. neither the value in b[] or c[] depend on any previous iteration. In C however, b[] and c[] could be pointers to some section of a[] . For instance, b = &(a[i-1]); . The value of b[] could be the value of a[] from the previous iteration of loop. This is nearly impossible to check for at compile time. In FORTRAN, (or more specifically, FORTRAN 77) there are no pointers. Every array is a unique block of memory. The sheer simplicity of the language makes compile time dependency analysis much more feasible.

    I have been away from this area for a while, but I believe this is still a problem in C, although pragmas can allow the user to give the compiler some hints. It also seems parallelism is more explicit these days at the thread level, compile time concurrency is not as much of a hot topic. Anyway, food for thought.

    1. Re:Data Dependency by MrEntropy · · Score: 1

      Also, my father still does some performance tuning occasioanlly. He still sees a lot of FORTRAN codes kicking around. They've been there a while, they work, and no one wants to take the effort to re-write them.

  241. fortran for other purposes by luminea · · Score: 1

    I started to work for an environmental engineering lab where my boss promptly put me to work debugging her (not too old) F90 code. She told me that a lot of the non-eecs engineers stuck to learning that for simple data-sampling-and-storing models, because it was simple to learn. If anything, learn Fortran if you're faced with it (or better - learn it, so you can translate to C/C++), but otherwise, it's pointless. Especially when there's very little available today to even learn the language...

  242. For Numerical Fetishists by magicianeer · · Score: 2, Interesting

    I did a bit of FORTRAN in the early 90's. IMO, its great strength is the ability to control the range and accuracy of numerical values as part of the language. No other programming language (that I know of) has comparable abilities. FORTRAN's control of numbers is analogous to the way Perl treats regular expressions as part of the language.

    Sure, you can get a math library for your favorite language that provides similar ability. You can get a regular expression library for other languages that gives you Perl-like abilities. But if you have ever used Perl, you know that the regex libraries of other languages cannot provide the flexibility-- the ease of expression-- the Awesome Power-- that Perl allows with regex. So it goes with numbers in FORTRAN. If you have a fetish for numbers, FORTRAN is for you.

    Yea, FORTRAN code is write-only, like Perl... such is the price of expressive-control.

    --
    You can have it good, fast, or cheap. Pick any two.
  243. Thoughts on Fortran by mysterious_mark · · Score: 1

    Used to use Fortran a lot, its good for crunching numbers, but the lack of OO is a big down-side its hard to write clean maintainable code. Also its hard to interface Fortran with other software. I see your point about C/C++ as error prone, especially if you're not used to it. My current preference for scientific stuff is to do it in Java and compile to native code, this allows the use of a very nice clean OO language, native code complilation can give simular performance to C code, best of both worlds. Mark

  244. Numerical Recipes considered harmful by jaoswald · · Score: 3, Informative

    Sure, the authors NR took on a big task (I wouldn't call it mammoth, because they only skim over things like PDEs), but they weren't up to it.

    The authors are scientists, not specialists in numerical computing. The appearance of "complete" does not equal accurate or correct. Writing robust and accurate numerical codes is difficult work, and there are journals dedicated to the topic.

    Even their code for special functions is pretty lousy, often just taken from Abramowitz & Stegun, which is a source from the 1950s!!!

    I'll freely admit that Netlib is not uniformly good; often, you have to find the most up-to-date solution to your particular problem from among the 3 or 4 solutions you find there. Also "old" does not mean "incorrect," or "untested," although it often does mean "probably inferior to some later work."

    Real production-quality matrix codes, for instance, are not easy-to-read like NR. They are total mazes of special cases and tests and branches, but all of those things were put in for very good reasons, and the stuff that survives in high-quality libraries has been throughly tested and peer-reviewed. Don't expect to read a few pages of chatty prose and a couple pages of Fortran and feel totally informed. Expect it to be a black box that you can use with confidence, but inside is basically incomprehensible without careful study.

    NR is a danger because it is not as good as readers think, and because it causes readers to not look any further for better solutions to their problems.

    1. Re:Numerical Recipes considered harmful by jaoswald · · Score: 4, Informative

      A nice guide to some other sources of mathematical software is NIST's GAMS for Guide to Available Mathematical Software.

    2. Re:Numerical Recipes considered harmful by SigmoidCurve · · Score: 1
      I will certainly agree that one should not pretend after reading a few chapters of NR to be ready to write even a small library that can perform anywhere close to an existing, stable, highly optimized code base. Furthermore, to rely on only one source (no matter how highly one thinks of it) is foolish.

      What I do like about NR is that it offers the opposite of the incomprehensible black box that robust and optimal numerical libraries must be. You are right to point out that most such libraries are awash with various tricks to deal with special cases - they are that way because reducing a problem to a known special subset can greatly improve efficiency by applying only those methods that are needed in that case. Unfortunately, as I'm sure you're aware, it is neither easy nor fun to attempt to learn anything by reading such code! I use NR to get a feel for the problem area and see what algorithms are popular. After that, then it's off to the library stacks to check the journals.


      In this way, NR is great as a survey text. It will give you ideas, show you the math so you can see what the algorithms are all about - a learning tool in an area where so much code is unreadable because of the intense specialization.

      czep

      --
      Dictionaries are for loosers.
  245. ADA? by ccoakley · · Score: 1

    Wasn't ADA developed by the DoD for use in all DoD applications? There are still some legacy applications that use ADA, but I hope that you are right and it is dead. Can anybody who does embedded programming for DoD verify this?

    Looking at ADA is painful. It looks like a language developed by a very large committee that wanted a language to do everything well. It acheives this, at the cost of being next to impossible to learn.

    --
    Network Security: It always comes down to a big guy with a gun.
    1. Re:ADA? by dvdeug · · Score: 3, Insightful

      Looking at ADA is painful. It looks like a language developed by a very large committee that wanted a language to do everything well. It acheives this, at the cost of being next to impossible to learn.

      What do you think of C++, then? Almost every feature maps one to one between C++ and Ada, except for threading, which Ada has and C++ doesn't, and various knobs and dials on templates and object orientation (template specialization, multiple inheritance) which C++ has and Ada doesn't. Furthermore, Ada doesn't have redundant funtions, like struct and class, or multiple ways to cast a value.

      Ada's not dead. There is considerable amount of embedded programming done in it, and some hobbist interest. Personally, I got tired of programming in a language where the first time I ran any program, its output consisted soley of "Segmentation fault". Most those programs, written in Ada, wouldn't pass the compiler; the other half would at least give me an exception with a line number for the problem.

    2. Re:ADA? by Cro+Magnon · · Score: 1

      Ada has a reputation of being hard to write and easy to read/modify. Since most programs are written once and maintained over years/decades, that sounds like a good trade-off.

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    3. Re:ADA? by Anonymous Coward · · Score: 0
      Can anybody who does embedded programming for DoD verify this?

      I don't do embedded programming in ADA but the guy 2 cubicles down from me does. And I have to read and analyze the data coming out of that code (flight software for a satellite-based meteorological sensor) so occasionally I have to look through it to figure out what the heck it's spitting out.

      The original flight software was written about 10 years ago in assembly for the particular processor on the sensor (1750?). But at that time, the DoD was big on ADA, so it was mandated that the code would be rewritten in ADA. According to the guy who originally wrote it, this was a really big pain, requiring a lot of trickery and ultimately a highly customized compiler to get the ADA-generated code to work more or less the same as the much cleaner assembly code. Although ADA is no longer a DoD requirement in general, the operational code for this sensor is still the ADA version (the assembly code is a couple versions behind by now).

      So now we have major legacy support issues for this code because the company that modified the compiler for us went out of business, and nobody's really left who knew anything about it. Oh, and it runs on an old Vax system for which we currently have no spare, and our last in-house Vax expert retired a couple years ago. We've looked at rehosting to a more modern platform, but the compiler customizations pretty much prevent that. Reverting to the assembly version may become an option at some point in the future to allow more flexibilityversion. I'm just glad it's not my problem! ;-)

    4. Re: ADA? by Black+Parrot · · Score: 2


      > Looking at ADA is painful.

      Much of beauty is in the eye of the beholder. I think Ada [sic] is much easier on the eyes than most of the other languages that are popular this week.

      > It looks like a language developed by a very large committee

      It was in fact designed by a team as part of a language-design competition. Is design by a team, or even a committee, a bad thing? I prefer to look at the resulting design rather than at the number of people involved. When I go shopping for a new car I don't give the least thought to how many people may have had a finger in the pie.

      > that wanted a language to do everything well.

      Sounds to me like a reasonable thing to want.

      > It acheives this, at the cost of being next to impossible to learn.

      Actually, it's really easy to learn because you only need to learn a small subset of it before you can start writing "real" programs. Then you can add knowledge (and use) of the sophisto stuff as you get more comfortable with it. (I would guess that 10% of the language does 90% of the work.)

      Just my experience. I think the biggest issue when evaluating new languages is the "not what I'm used to" effect.

      --
      Sheesh, evil *and* a jerk. -- Jade
    5. Re: ADA? by Edward+Kmett · · Score: 1

      The argument that you can learn a small subset to be productive tends to bite you when you start trying to ramp up to multi-developer projects.

      When you are provided with 20 different tools with which to accomplish a goal, developers are going to choose different ones, and if you eschew code ownership, each of them will have to be familiar with each other's favorite hammers to be able to make changes to each others code.

      If you go in for code ownership then you wind up with no redundancy and a single developer holds you hostage.

      In large scale development in such languages, if you have one high end programmer and several who are not so proficient with the language, the work-load gradually becomes unbalanced and you need an equally high-end programmer to replace your top guy when he leaves even if the code has devolved to maintenance and is not actively in production.

      In a perfect world he may have left you clean interfaces and functional documentation, but the variety of syntactic sugar available can make maintenance difficult and expensive.

      --
      Sanity is a sandbox. I prefer the swings.
    6. Re:ADA? by ccoakley · · Score: 2

      Don't give up on the code.

      You may want to look for some hard core CS students to hire. I have a student who wrote a reverse compiler for microsoft .net (because he could) that outputs C# code. He also wrote a .Net compiler for brainf*ck (because he could). He basically views it all as source code transformations, and while I agree with him at a conceptual level, I do not have the patience nor his expertice at writing such code to make any recommendations to him. The guy can write a parser for a language faster than anyone I've ever met. And he's an undergraduate.

      --
      Network Security: It always comes down to a big guy with a gun.
    7. Re: ADA? by Black+Parrot · · Score: 2


      > The argument that you can learn a small subset to be productive tends to bite you when you start trying to ramp up to multi-developer projects.

      Presumably anyone iterested in learning the language will go ahead and learn the rest of it, or at least most of it, after mastering the subset. My point was simply that you can bootstrap yourself into an admittedly "big" language by learning an easy Pascal-like subset, and then start mastering the additional features as time and motivation allow. The ability to learn a simple subset greatly reduces the frustration it would present you otherwise.

      No one wants to learn a language that requires you to read a thick book before writing your first Hello World program, but if you can master Hello World at your first sitting, and write at least some types of useful programs after a few days of playing with it, and then learn the more exotic properties of the language later, then even a big language will not scare you off.

      --
      Sheesh, evil *and* a jerk. -- Jade
    8. Re: ADA? by captnjameskirk · · Score: 1

      > Much of beauty is in the eye of the beholder. I think Ada [sic] is much easier on the eyes than most of the other languages that are popular this week.

      Excuse me, but why the "[sic]"? It actually is Ada. It is not ADA. Ada is named after Ada Lovelace, who is considered to be the first programmer. It is not an acronym for anything, and it is not spelled with all caps.

      And it is a wonderful language, despite all the "designed by committee" crap floating around, posted by people who have never programmed with it. After 15 years of using C then C++, I started searching for a new language. I had a hobby project I was working on for 2 years suddenly start crashing. I knew it was pointer-related, but I tried for two solid weeks, using all the debugging tools I could find, and I still couldn't track down the bug. In frustration I threw the towel in on C/C++.

      I had to have a compiled language that produced fast code (at least after debuggin). That ruled out Python and Ruby (which I would use in a heartbeat if it was compiled and produced fast code) and Java and any other byte-code language. My other requirement was that it had to be very secure in it's error checking, and easy for me to maintain. Look around. There's only one language that fits that bill: Ada95.

      Yes, there was a steeper learning curve than I bargained for (helped by the excellent online tutorial Lovelace [http://www.adahome.com/Tutorials/Lovelace/lovelac e.htm], but it has been well worth the effort. I just love the compiler finding errors before I crash something! And the speed is faster than the C/C++ code I used before.

    9. Re:ADA? by Anonymous Coward · · Score: 0
      Personally, I got tired of programming in a language where the first time I ran any program, its output consisted soley of "Segmentation fault".

      Don't blame the language for your mistakes.

    10. Re: ADA? by Black+Parrot · · Score: 2


      > Excuse me, but why the "[sic]"? It actually is Ada. It is not ADA.

      That's why I used "[sic]". I was responding to someone who used "ADA", and I wanted to indicate that my change to "Ada" was deliberate.

      > And it is a wonderful language, despite all the "designed by committee" crap floating around, posted by people who have never programmed with it.

      Such as ESR.

      Yes, I agree that it's a wonderful language. I use it for almost everything I do, when the choice is up to me.

      --
      Sheesh, evil *and* a jerk. -- Jade
  246. C# by Anonymous Coward · · Score: 0

    Just like the adds say at the top of slashdot.

    Try Visual Studio .net today.....

  247. PDL as an option by gizmo_mathboy · · Score: 2

    The Perl Data Language (PDL), found here, gives a fast backend for scientific and matrix computing.

    It is a tried and true extension to Perl that has been thoroughly abused by lots of folks.

    I would say FORTRAN is the way to go for scientific computing but PDL is something to give a look.

  248. FORTRAN...yep by fea · · Score: 1

    I am an 8-year long Linux user and contribute via bug reports, etc.
    I am a 30-year long FORTRAN user and am too old to
    change. I have tried several different "modern" languages. I do my best documentation in Latex. But, I still resort to FORTRAN to get any real work done that requires number crunching. Also, as many have stated, there is a wealth of existing code in FORTRAN that will never be converted to another language. So until something comes along that replaces these old codes that is written in a "modern" language, then you will always have FORTRAN.

    -professional engineer

  249. Old and well aged by u2mr2os2 · · Score: 2, Interesting

    Since most of my job involves maintaining Fortran code, I'm a bit biased. Most points are right: lots of old code that is very debugged by now and too much to port, compilers are well worn and dependable. Many people knock F77 for the limitations of the standard, but no one uses that, they use the common extensions (Vax and Unix) like long variable names, no case sensitivity, include files and some other items. F77 is very flexible since most compilers do F90 as well. I use Compaq Visual Fortran which uses the MS Developer Studio, so there's no lack of a modern development environment.

    I have to personally give it a lot of respect since many Fortran compilers have a switch to toggle F66 syntax rules - as in 1966 - the year I was born! And Fortran was already 9 or 10 by that time.

  250. WATFIV my boy, WATFIV by gelfling · · Score: 2

    It's like FORTRAN but it whips around character variables like buttah!

  251. Matlab by Anonymous Coward · · Score: 0

    If you are using loops in MATLAB you are doing it wrong. Go back and read the manual. VECTORIZE!!! Blazing speed!

  252. Fortran has evolved... by Anonymous Coward · · Score: 0

    Yes, the 25 year old languages tend to be best in many ways. Fortran, Lisp, and so on...and many of the old unix utilities. Fortran dates from circa 1957 so is a bit older than 25.

    The old 6 character variable limitations, lack of some structures, and some other bits tend not to exist in better Fortran compilers. However, Fortran remains the leading example of actual working shareable and reusable code. For all the hype that languages with inheritance and object orientation have, somehow they don't come close. Fortran's advantage is chiefly that its syntax closely resembles that of engineering math, though its I/O system is very easy to learn and use. The language does not have prominent pointers, but that tends to help its reliability. As for variable subscripts starting at 1, not zero, that is so, but newer compilers allow that to be changed too.

    Fortran is good for a learner, in much the way that putting together a flipflop or a trigger out of discrete components is: you learn how to do things and can see how they work at low level with very little effort. Knowing how these things work can be helpful in thinking OUT of the box in solving problems later...you get a sense of the possible that eliminates the temptation to treat supporting structures as magic.

    Go and learn.

  253. Army's around the world... by mabs · · Score: 1

    ... still use a simulation written in Fortran, that runs in Linux.

    Why?, you might ask... Mainly because it works, and they have a realistic stable software turnover time, and this simulation has been around for over 10 years now, it actually originally ran on VAX's, then Sun's, now PC's (Linux).

    --
    VK3TST
    -- "People aren't stupid. Usually." -- jd
  254. why bother to learn fortran? by Anonymous Coward · · Score: 0

    Ok, there are lot of old dinosaur libraries out there written in Fortran. There will be people who turn their noses up because these are old and, in their perspective, klunky. These, of course, are the same people who say C++ is an elegant and powerful language ( IMNHO C++ is a fine language, only most C++ programmers suck at writing clean simple C++ code ). Anyway, having kicked sand in the face of the C++ faithful, I will now point out that it's not hard to build wrappers around the Fortran dinosaur. I guess where I'm headed with this is "learn enough fortran to read it, but probably not enough to write it." You can leverage others work, fixing it if need be, but not wasting time becoming fluent.

  255. Cost/Performance of Matlab, etc. by TastySiliconWafers · · Score: 1

    The cost and somewhat slower performance of Matlab and other languages designed for scientific computation is a poor reason to go running away to code Fortran instead. If you're doing anything even remotely complex, any money you save by doing things in Fortran instead of buying Matlab, RSI's IDL, Maple, Mathematica, or some other appropriate tool will be eaten up by the huge productivity losses incurred by using such a low level tool as Fortran. Reinventing the wheel is inherently expensive in terms of opportunity cost. Do yourself a big favor and spend the money on a very high level, mathematically intuitive, interactive tool that is appropriate for the job and some badass hardware to achieve the performance you need. You'll get the job done in a jiffy without major debugging headaches and be able to move on to do other more productive things with your time that will add value to the company.

  256. If Fortran is so hot... by jwiegley · · Score: 1
    Why do Fortran creators expend so much effort and time duplicating efforts that other languages have already taken care of?

    I keeping reading in this thread over and over about how "large" the reusable code base is for Fortran and how reusing Fortran code is such an advantage. Then in these same posts the authors talk about how the newer versions such as Fortran 90 and 95 even have some implementation of advanced features found in newer languages.

    Well, as I see it. The Fortran people are just wasting time duplicating a different, larger set of efforts. If they spent the same effort helping to optimize C/C++ compilers as they do trying to reinvent their own language then C/C++ would give them the ONE advantage they are all looking for... Numerical speed. But instead they cling to "We use it cause its faster." When that doesn't have to be the case.

    --
    I will never live for sake of another man, nor ask another man to live for mine.
  257. What a blast from the past!!!!! by Nick+Driver · · Score: 1

    WATFIV was my very first programming language. At UTA, nearly a quarter century ago, I was a freshman EE major until I took my first programming class, FORTAN. Actually we used WATFIV in the class... and on punchcards. We lowly freshmen weren't privileged enough to get to use the DECWriter interactive terminals. Anyway, FORTRAN/WATFIV ruined my life because I fell in love with programming instantly and changed my major to computer science instead. I made a D in that class, barely passing it.... because I spent my entire computer account time doing my own programming creations on the IBM mainframe instead of doing the assigned classwork :-)

    If it weren't for WATFIV, I doubt I'd be in the career I'm in today.

  258. What about R + dynamic linking? by biostatman · · Score: 2, Interesting

    You mention something like Matlab as an alternative if it did not have poor performance. There is a very high quality free (beer, speech) program for Windows/Linux/OSX called R that is a matrix oriented language based on the S language, whose commercial analog is S-Plus. One of the really nice features is that you can write iteration or computation heavy routines in C or Fortran and dynamically load them into your R program/script.. The benefits are that you can take advantage of the high-level nature and easy scriptability of R (not to mention publication quality graphing capabilities), while taking advantage of the speed of Fortran/C.

    I am always shocked at how little attention R gets considering how good it is.

    --
    For the love of $DEITY, loose != not win!!!!!
  259. Any examples besides Quicksort? by Christopher+Thomas · · Score: 2

    And frankly, it is a language isssue. FORTRAN doesn't have recursion. You can't properly implement quicksort in a non-recursive language. And quicksort outperforms heapsort in most cases.

    If Quicksort is the most relevant example you can think of, then I'm afraid you're not making a very strong case.

    Both are O(n log n) in the best case, and I'll be extremely surprised if there's more than about a factor of two difference in running time for comparable best-case inputs. And yes, I've done the analysis.

    Quicksort, however, has a nasty habit of not guaranteeing anything better than O(n^2), which can be triggered by a variety of pathological cases (admittedly less likely for large sets being sorted). What you wind up with in practice, working through the analysis assuming randomly-distributed lists, is O(log n) average-case behavior with a nastier coefficient, degrading performance to a level closer to than of heapsort.

    You can use clever methods for selecting the pivot to reduce this problem, but this bites you back with the extra operations you have to perform. You don't gain a whole lot for the average case (though you make the pathological case far less likely).

    In summary, the quicksort-vs-heapsort argument is a red herring.

    Yes, there are problems for which recursive formulations are very elegant, but the majority of scientific problems that require brute force seem to be implemented adequately in Fortran-77. Do you have examples of important, computation-intensive problems for which the recursive formulation is far better than an iterative formulation?

    1. Re:Any examples besides Quicksort? by TMB · · Score: 2
      Do you have examples of important, computation-intensive problems for which the recursive formulation is far better than an iterative formulation?

      N-body tree codes leap to mind... admittedly, because that's what I do, but the idea of trying to implement one in FORTRAN would give me nightmares for years.

      [TMB]

    2. Re:Any examples besides Quicksort? by Tim · · Score: 1

      "In summary, the quicksort-vs-heapsort argument is a red herring."

      No, it isn't. It is an example of something that cannot be implemented properly in FORTRAN. I love that this thread is littered with the responses of "well, you don't need recursion because you can always implement your own stack!" Classic FORTRAN programmer-ese: "My language isn't deficient, you're just lazy!"

      The fact is, introsort (the variant of quicksort used in the C++ standard library) does guarantee O(n log n) performance, it has a lower constant than heapsort on many input sizes, and a constant on par with heapsort for many more. And you can't implement it in FORTRAN either -- it's a recursive algorithm. Sure, you could write your own stack, but A) you have to write your own frigging stack and B) try to do that in FORTRAN without imposing some artificial limit on stack size, input size, or something else. The authors of NR couldn't...their code breaks with inputs larger than a certain size....

      It may be a relatively minor example, but it was an easy one to come up with. Pick another -- let's talk about space-efficent random list insertion or deletion, or implementation of a balanced tree, or any of a number of other areas where data structures are critical to algorithm performance. FORTRAN is not made for these things. Unfortunately, not every scientific problem is so cleanly decomposed into the tight little loopy segments that FORTRAN is good at computing.

      --
      Let's try not to let fact interfere with our speculation here, OK?
    3. Re:Any examples besides Quicksort? by Christopher+Thomas · · Score: 2

      "In summary, the quicksort-vs-heapsort argument is a red herring."

      No, it isn't. It is an example of something that cannot be implemented properly in FORTRAN.

      Yes, it is, because it is something that does not need to be implemented, because heapsort works perfectly well for practical purposes.

      Pick another -- let's talk about space-efficent random list insertion or deletion, or implementation of a balanced tree, or any of a number of other areas where data structures are critical to algorithm performance. FORTRAN is not made for these things. Unfortunately, not every scientific problem is so cleanly decomposed into the tight little loopy segments that FORTRAN is good at computing.

      However, the majority of scientific computations _are_, as is demonstrated by the fact that FORTRAN remains so popular in the scientific community.

      By all means use C or some other language if that suits your problem best. But arguing that FORTRAN is bad because it doesn't work for a number of problems that aren't in its major workload is silly. It would be like, oh, saying that Perl is evil because it can't do matrix transformations as fast as C. In order for this to stick, I'd have to explain why people would be doing matrix transformations in Perl in the first place.

    4. Re:Any examples besides Quicksort? by Tim · · Score: 2

      "Yes, it is, because it is something that does not need to be implemented, because heapsort works perfectly well for practical purposes."

      Beautiful. You made my original point, proving the classic FORTRAN programmer mentality: "I can't implement something because my language is missing a feature necessary to do so. But, rather than admit that this is the case, I'll avoid the issue by pretending that another approach is better anyway." This doesn't make my argument a red herring, it makes your argument a straw man.

      "arguing that FORTRAN is bad because it doesn't work for a number of problems that aren't in its major workload is silly. It would be like, oh, saying that Perl is evil because it can't do matrix transformations as fast as C.

      Are you reading what I write? FORTRAN is good at what it does well -- loop iteration algorithms. However, when all you have is FORTRAN, everything starts to look like a loop iteration problem! This is the core of my argument; you're getting too caught up in the details to notice.

      --
      Let's try not to let fact interfere with our speculation here, OK?
  260. Some Old USENET Posts by cburley · · Score: 1
    A long rant on language design, highlighting the distinctions between Fortran, C, and C++. This post applies some of those concepts to specific concerns I had with the way Fortran 90 was extended over FORTRAN 77, as does this post. This post talks about the concepts vis-a-vis IF statements in FORTRAN, and this one talks about them with regards to GOTO, among other things. This one goes over lots of the same ground as the others, with the added advantage of a reference to the movie Jurassic Park.

    More to the point, I don't believe C is a great language even though it's a great tool and it's a language.

    My shot, circa 1990, at the well-known-by-now aliasing issues between FORTRAN and C.

    One of many complaints I made about the unfortunate disagreements among Fortran vendors regarding how to interpret numbers in Fortran programs. (You'd think "the best scientific/numeric programming language" would have a community that agreed on how to interpret constants in code, but no.) Another post on the same topic.

    An example of Fortran's distinction between subroutines and functions, a distinction not available in C (or, to my knowledge, C++).

    Fortran has a strange way for functions to return their value compared to C and PL/1, illustrated by this post.

    More about Fortran functions versus subroutines, including an aside about how C programmers trying to design interfaces to Fortran sometimes confuse themselves over what is really an inappropriate use of the term "function" in the C world. (I.e. it only looks like a function in terms of syntax; it's really a subroutine, that is, an imperative sequence of operations that must be performed as written.) See also this short post, unusual for me in that it's short!

    Fortran actually has more intelligent character concatenation than C, at least from the linguistic point of view. The compiler actually has to understand, in some cases, that the destination can hold only so much of the source in an assignment; in C, you have to string together tons of imperative calls to library functions, which can, at least theoretically, take much longer and more memory to perform at run time.

    (Though, in my experience, so few people use Fortran for "character" or string work that compiler authors don't work hard at such optimizations. But the language comes oh-so-close to providing a pretty decent character-manipulation environment in which pretty decent optimizations -- the sort C programmers must often resort to hand-coding to achieve -- can be straightforwardly implemented by the compiler.)

    A theoretical rant, of sorts, regarding Fortran 90's "RESULT()", and Fortran's weird, sometimes inscrutable, means of distinguish a reference to a function itself from an invocation of that function -- a probably C doesn't quite have in that specific case, though it has its own grody areas when it comes to types, declarations, casts, and such. Another such rant.

    Fortran has logical operators that C doesn't. Seriously, it's true: C doesn't have "AND" or "OR", for example. It has only a straightforward bitwise form of AND/OR and an IF/THEN/ELSE form of AND/OR, but not a more-general, compiler-can-do-what-it-wants-like-normal-people, AND/OR, which even "bare-metal" FORTRAN 77 has. The linked-to post contains one of my classic, old-style flames designed to bring this out, and is probably not the best way to understand the distinction, but, like people ruined by learning BASIC, C programmers often seem to have been ruined by thinking that "&" and "&&" contain, among them, all you ever need to express the concept "AND". (Of course, you can express C's and/or "operators" in FORTRAN, though it usually takes a bunch of extra typing. I take another crack at explaining this here, here, here, and here.)

    Jim Giles and Paul Havlak try to clue me in back around 1990 when I was still trying to understand how, in practice, Fortran was easier to optimize than C for its target "audience" of numerical codes.

    Stuff about named COMMON, which reminds me that while strict FORTRAN 77 doesn't offer dynamic memory allocation, that doesn't prevent a compiler from employing it under the hood, and a smart one from doing it in a way that reduces the working set (memory footprint) of the hot spots of the code -- something that is much harder for C compilers, given that the C coders have already "figured this stuff out" (perhaps for an older, differently-memory-architected machine) and hand-coded in their assumptions.

    I muse over the general issue of names reserved to language libraries vis-a-vis Fortran and C.

    I/O built in to the language has its advantages for portability, but unless designed with all sorts of "hooks", which FORTRAN isn't, it has disadvantages when it comes to redirecting old code's I/O through new filters without having to rewrite it substantially.

    The indivisible unit of a file from Fortran's vs. C's point of view, and the assumptions made by C programmers as a result of their worldview.

    On alternate ENTRY points, which FORTRAN 77 has, C doesn't, but....

    A VOLATILE issue I wrote about, regarding new features in Fortran 2000.

    How FORTRAN might have helped work around the lack of a universal end-of-file indicator on mainframe systems using punched cards. C programmers never had to deal with this legacy! ;-)

    The subtleties of FORTRAN DO versus C "for" loops are hinted at here.

    Why we should all be programming in BASIC instead (just kidding ;-).

    --
    Practice random senselessness and act kind of beautiful.
  261. My professors still use it by deadgoon42 · · Score: 1

    I have at least one Geology professor that uses Fortran. Although I'm completely unfamiliar with this language, it seems to serve his purposes very well. And so do the apps he writes because they still work 15+ years later. Plus, I can just get a copy of the source and use them at home on my Linux system with a minimum of fuss. Portability is a big plus in my opinion.

    --

    Smeghead every day of the week.
  262. Your favourite FORTRAN compiler... by Anonymous Coward · · Score: 0

    was almost certainly written in C. Think about this.

    (P.S. To my knowledge, there has never been a FORTRAN compiler written in FORTRAN. And thank bloody god for that, I say.)

  263. Best method by Empty+Sands · · Score: 1

    If its faster to write it in bash, then use bash. Optimise after you've got the thing producing correct results. Otherwise both C++ and Python have advanced numeric libraries that I know off.

    Personally I really dislike Fortan, and the advise above comes from a project where I had to pick up some Fortan code. After a month of wasted time trying to understand someone elses code I figured it would be better to write something clearer with something I knew.

  264. Comment removed by account_deleted · · Score: 2, Insightful

    Comment removed based on user account deletion

  265. Ada by Anonymous Coward · · Score: 0

    tried Ada?

  266. drop fortran. c is better. by Anonymous Coward · · Score: 0

    our company's software is 90% fortran77. we've
    been doing it for 15 years now. recently i was
    asked to check out if it's possible to use
    some kind of a converter (f2c?) to convert the
    whole big sh*t to c...

    the fortran code is ugly, the language is
    limited, and we even use c routines to do
    the dynamic memory management... so don't
    use fortran even it might compile to faster
    binaries than anything else. it just isn't
    worth it.

    but because we still have those guys working
    who started this whole thing and can't do
    anything else than f77 we are stuck to that...

  267. python 3 by OsamaBinLogin · · Score: 1

    > Lots of work being done on Python between 2.0 and 2.2 . . .

    then they ought to call it Python 3, so everybody gets a clue that it's a big change. Scoping is a big change.

    Don't make the mistake that the sun/java people are doing - after two api-doubling releases and lots of cleanup releases, it's up to what, 1.4 I think. It's the marketing people who called it Java 2 cuz they couldn't stand it.

    --
    Marketing-driven companies end up over-marketing their products. Engineering-driven companies end up over-engineering
  268. optimizing f77 by OsamaBinLogin · · Score: 1

    > If optimising fortran is so easy, why's gnu f77 such a pile of crap?

    my guess, it gets much less use than the C stuff. How much of the average Linux distro is in Fortran? probly 1%. They don't even fix all the C bugs.

    --
    Marketing-driven companies end up over-marketing their products. Engineering-driven companies end up over-engineering
  269. CERNLIB by bmfs · · Score: 2, Informative

    Fortran is still alive and well in the high energy physics (HEP) community... though it is fading away slowly (not as slowly as some people would like though). Up until very recently, FORTRAN was *THE* language for data analysis but is slowly being replaced by C++ in newer experiments such as BaBar at SLAC and is replacing FORTRAN for data analysis at a few older experiments such as H1 at DESY. The reason why FORTRAN is fading away so slowly is mainly because of CERNLIB which is a FORTRAN library that contains many useful functions (random numbers, matrix manipulation, data fitting etc...) As most particle physicists "grew up" using CERNLIB, it will be a while yet before FORTRAN well and truly disappears (in the HEP community anyway). Also of note, CERNLIB has now been released under the GPL, so anyone can use it. Nice.

  270. Fortran 90 by gurgel · · Score: 1

    >I know about Fortran 90 but it is not much
    >nicer than F77,

    Wether F90 is nicer than F77 or not is a matter of taste I guess, but I think it's much better. I really hate F77, while F90 is in my opinion one of the best programming languages ever. It is easy to learn, very high level, and fast.

    >and no one seems to use it

    ???

    I know lots of peaople who uses F90, no one who uses F77 for new development.

  271. FORTRAN is approx 46 years old! by kiwijohn · · Score: 1

    For all those people who don't seem to know just
    how old FORTRAN is, it was invented in 1956.

  272. Functional Languages by Anonymous Coward · · Score: 0

    Often functional languages have great support for doing numerical work (all of the below have free implemenations).

    R, this is a free version of S a stats language developed by AT&T, built on top of a scheme interpreter. You can also build C or F77 modules an access them from R.

    Haskell, lots functionality in not much code.

    Scheme.

  273. Reduce bugs by switching to fortran? No way! by rew · · Score: 2

    Whatever "bugs" you're chasing, fortran is not going to make you stop making those mistakes.

    Switching languages once or twice would allow you to combine the practises that one compiler enforces on the other language. However, switching to fortran is not going to have that effect.

    Fortran is a bit simpler than C. This allows the compiler to make more assumptions about what you're doing. This allows the compiler for example to find paralellism. A for-next loop that goes over 100 thousand elements can be split in fortran into two loops over 50 thousand elements, each of your two processors doing half the work. However, after this one loop that the compiler happened to optimize, the second CPU will become idle again until anohter optimization opportunity occurs.

    Humans are much better at finding parallelism than compilers. Thus if an optimizing compiler can find 50% "things to do" for a second CPU you should be able to find almost 100%.

    Thus if you have an OLD, debugged, program that you want to run on the new parallel machine, a fortran compiler can boost your performance better than a C compiler. But you shouldn't learn fortran just because it's often used in high perofrmance computing. It's just that those guys happen to have large patches of code lying around, they have the fortrna experience, and lack the incentive to learn anything else.

    Roger.

  274. IMSL Rules by Anonymous Coward · · Score: 0

    I perused the whole listing and no IMSL references?
    This library was fantastic for quickly developing filters and analyzing data and waveforms, performing matrix inversion, reduction, Karhunen-loeve, etc. This was what made Fortran so simple and powerful.
    Visual Numerics (www.vni.com) purchased them and now has JNL, and CNL, a subset of netlib. I used PV-Wave (also vni) years ago (VAX, military days) and it was a nice, tight package, similar to Matlab

  275. You can have pointer aliasing in FORTRAN by James+Youngman · · Score: 2

    ...but to do it you have to use EQUIVALENCE statements.

  276. Another visualisation option is ROOT by James+Youngman · · Score: 2

    ROOT is another option for visualisation (along with Octave and GNUPLOT). Interestingly, the ROOT system also includes a C++ interpreter (yes, interpreter!).

  277. Learn it, then do it by mnordstr · · Score: 2

    "C/C++ does not cut it for me - it is simply too easy to make mistakes and I find myself using half of my time hunting bugs unrelated to the problem at hand."

    If you know the language, you might maybe write code that isn't full of simple code related bugs. If you want simple, go with Visual Basic...

  278. You're crazy by Anonymous Coward · · Score: 0
    If you're talking about Fortran-77, aka "FORTRAN", then yeah, I'd agree with you. It's arcane and is missing many "conveniences" like the various types of looping that C/C++ has. It's an ugly language that's hard to read and hard to program if you're used to C.


    OTOH, if you've never seen F90/95, then you're in for a shock. At first glance, F90 is extremely C-like. To zeroth order, it looks exactly like C and has all the different types of looping, pointer and conditional operations that a C programmer uses. In fact, Fortran has more (as opposed to FORTRAN).



    F90 is a much better language for someone who wants to get things done without having to worry about issues like 4/9 being equal to 0. The array semantics just *beg* to be used in finite discretizations. Imagine being able to declare an array that starts from -100 and ends at +100. Wonderful!



    That being said, I don't use F90, just because I'm so comfortable with C and more people are using C these days. However, if I were to learn a new language and didn't care what other people use, F90 would be my language of choice.



    Forget what you know about FORTRAN. Fortran is a language made in heaven.

    Peter

  279. Only 25 years? Pah! Youngster! by Simon+Brooke · · Score: 2
    Can it really be true that the best tool we have for heavy duty computing is a 25 year old language, or have you found anything better - free or non-free?"

    Actually, the the best tool we have for heavy duty computing is a forty-seven year old language which, among other things, handles arbitrary size and arbitrary precision numbers transparently, handles memory allocation automatically, handles recursive functions naturally as a key part of the language. As for efficiency, I can code factorial in three lines (70 bytes) of code, and compute the factorial of 10000 in 2.08 seconds:

    * (defun fact (n)
    (cond ((= n 1) 1)
    (t (* n (fact (- n 1))))))

    FACT
    * (time (progn (fact 10000) nil))
    Evaluation took:
    2.08 seconds of real time
    1.91 seconds of user run time
    0.16 seconds of system run time
    [Run times include 1.66 seconds GC run time]
    0 page faults and
    70756080 bytes consed.
    NIL
    *

    Beat that in any language. Note: only core features of the language used, no special libraries, no special constructs. Note also: I didn't declare n as an integer, I didn't have to. I didn't declare n a bignum, I din't have to. The language handles all that sort of detail automatically, and if I wanted the imaginary part of the factorial of 1000 all I'd have to do is ask for (imagpart (fact 1000)). Not only are complex numbers supported in the core language, they're supported transparently too.

    People get put off by the fact that LISP looks different and has a slightly different vocabulary from the ALGOL-derived languages they're used to. Once you're over the initial hurdles it's a very natural and extremely powerful language to use.

    --
    I'm old enough to remember when discussions on Slashdot were well informed.
    1. Re:Only 25 years? Pah! Youngster! by hding · · Score: 2

      I love Common Lisp and do most of my heavy lifting in it, but let's not get _too_ carried away. In Lispworks for Windows 4.2.6, your example (or rather either a tail-recursive version of it that doesn't cause the stack to overflow or a natural direct iterative version such as by using loop) takes about 2.6s to run on my box. An equivalent program in Dolphin Smalltalk takes .629s on the same box, and as you can see, there are no special tricks and the code is as simple.

      Integer<<factorialIterative
      | factorial |
      factorial := 1.
      2 to: self asInteger do: [:i | factorial := i * factorial].
      ^factorial
  280. Still using Fortran by Anonymous Coward · · Score: 0


    I worked as a SysAdmin and programmer at the University of Connectuicut's Optical Fiber Research Manufacturing Labratory for two years. Our graduate students, some of which were programmers, wrote their numerical models exclusively in F77. Our reasons were:

    * The base model had been written in F77 and the majority of relevant literature was also written for F77

    * Easily understood by other researchers; increased chances of getting published

    * Trivial to port and run on a Cray, Sun Workstation, or a Linux cluster [which we had].

    * Variety of parallel programming packages available: HPF, MPI, PVM

    * The professor said it was The Way To Do It. ;)

    I personally spent almost a year writing F77 code with PVM. While F77 had some unpleasant limitations which have already been covered, I was glad to have the experience.

    We used The Portland Group's compilers exclusively, and my benchmarks against g77 showed significant preformance gain.

    As part of my continuing work with the lab I am developing a parallel version of an extremely long [5 days on a dual AMD 1900+ !] and CPU-intensive algorithm, using MPI and F77. I have no doubt that F77 and F90 will be around and it use for a long time.

    Joshua Thomas
    formerly University of Connecicut
    email: jthomas at poweronemedia dot com

  281. Embedded systems by yerricde · · Score: 1

    What's the advantage gained by the hand-coded stack approach? Smaller stack frame, you say? Why does that affect execution speed in this context?

    A smaller stack frame gives your code a better chance of running correctly on an embedded system whose processor architecture specifies a 256 byte stack, such as anything based on a 6502 processor. I've had to program for one of those (the NES). Heck, I've had to program on one of those (the Apple IIe).

    --
    Will I retire or break 10K?
  282. Got Goatse? by Anonymous Coward · · Score: 0

    http://www.goatse.cx

  283. Re: ... or IDL by mferrare · · Score: 1

    I worked for a while at a physics department in a University. They used IDL almost exclusively for number-crunching - especially the atmospheric physics guys. Apparently you could write code rather quickly and easily and it had excellent graphics capabilities. Check out Research Systems Inc.. Mind you it costs a stack. We got it cheaper coz we were a Uni but it still cost heaps.

    We had some Matlab around which the theoretical guys used more but IDL was the most prevalent.

    --
    Why would anyone want to use a text editor that is not vi?
  284. Another graphing option is gri by psgalbraith · · Score: 1

    http://gri.sourceforge.net

    Doesn't do 3-D, but very good on 2-D (including contours and colour-coded images).

  285. Golden age of ForTran. by FatFinger · · Score: 1

    ForTran (aka ForTran) had its place in the history of this discipline. It bothers me personnaly to see so many negative comments from so many that should know better. C may be older than F'77 but it is young compared to Fortran. In its age ForTran was used as a replacement for assembly language and found its way into use for writing almost every type of application imaginable: scientific codes, numeric codes, compilers, operating systems, system utilities, etc. The language is very old, and to trace it only to F'77 does not do it justice. For some of us, the introduction of F'77 was heresy, and we continued to code in F'66. But even F'66 was not the first standard ForTran. I remember coding in Fortran II, III and IV. Coding by the rules almost guarunteed portability. Many widely distributed (free) numeric codes were written independent of word length: 32, 36, 48, 60, 64 bit lengths were all supported. But there were a few quirky implementations that required non-standard statements to be added. Should one learn ForTran? Should one learn about history? If your interest is numeric or scientific computing than one should develop at least a reading knowledge of the language. As many have pointed out, there is a wealth of very good codes that exist written in ForTran. If it is your goal to re-invent the wheel, then ignore ForTran, if you want to leverage on top of the work of others, then learn the language. It is fortunate that the languages in common use have progressed beyond ForTran -- but they are far from problem free. But the capability of our computers has far surpassed the systems on which ForTran was developed. [the first computer I programmed was an IBM 1620 with 20,000 digits of core memory, no disk, and a purely hollerith card based system -- try running your C programs on that beast]. So keep it in perspective. Use the tools that are most appropriate for the job at hand.

  286. Always be willing to try something new by Xenophon+Fenderson, · · Score: 1

    I try to learn as many programming languages as possible. While programming languages such as FORTRAN, Common Lisp, and even COBOL are indeed very old, there are many implementations both commercial and non-commercial being actively maintained and used. Even if I find that the language doesn't provide the tools I need, as is the case with FORTRAN and COBOL, the process of exercising my mind through learning has made me a better computer scientist.

    --
    I'm proud of my Northern Tibetian Heritage
  287. Sorry, My Bad by gcondon · · Score: 2

    I was thinking of gnuplot which is almost always used with Octave but which, despite the "gnu" in the name, is not associated with the GNU project or the FSF and is not GPL'd.

    You are absolutely correct, Octave is GPL'd. My most sincere apologies to the Octave team for my inadvertent slander.

  288. No need to learn it up-front by Anonymous Coward · · Score: 0

    I don't think there's any point in learning FORTRAN in the absense of any explicit necessity of doing so, right now. Not when you could spend your time on something more didactically recommendable.

    Delay learning FORTRAN until you find an actual need for it --- the language is simple enough to learn it in a couple of days as the need arises, provided you already now how to code in any other, less outdated language. If the need to learn FORTRAN never arises at all, consider yourself a lucky guy.

  289. info: its a matter of style by LifesABeach · · Score: 1



    This sounds like you are realizing just how complex Programming can be. Unless you work at understanding how to program partial solutions, your frustration will only festor, more.

  290. two comments by strombrg · · Score: 1


    1) Fortran is fine, especially f90. It's as though you think there must be something wrong with a language that has stood the test of time. Fortran and lisp both are still impressive designs.

    2) It sounds to me like you didn't give numeric python a real chance. If you think it won't do loops and recursion well, you really ought to take another look.

  291. Re: LINPACK & Matrix Computations by rkit · · Score: 1

    The Golub/Van Loan book is certainly the best text on linear algebra I have ever seen. However, LINPACK has more or less been obsoleted by LAPACK (which is based on LINPACK). The main difference is that a lot of code has been rewritten to use level 3 BLAS in the inner loops, which will speed up things quite a lot.

    --
    sig intentionally left blank
  292. I'd use it by FuzzyDaddy · · Score: 1
    I've found over the course of my career that learning more than one computing language is never a bad thing. The difference between the structure and syntax of languages like C and FORTRAN are not that large for practical purposes.

    Libraries of existing code, particularly for scientific computing, are a huge incentive to switching. As long as you don't need to create a GUI for the application, or do bit level manipulation, or do extensive string parsing, FORTRAN and the existing libraries will probably suite you well.

    And the more languages you learn, the better programmer you will be in all of these languages. You will also start to view languages as tools - selecting the proper one for the job at hand - rather than trying to do everything in one language.

    I have written code for a variety of applications. And I've developed a repetoire of languages (Python, C/C++, FORTRAN) that covers most of the bases of what I need to do. But programming is easier if you don't think of yourself as a "FORTRAN Programmer", but rather as someone who looks at a problem and says "I can program a solution to that. It would make the most sense to program it in X.

    --
    It's not wasting time, I'm educating myself.
  293. Eta model not ETA Re:NOAA by n1vux · · Score: 1

    FYI, of all the models, "Eta" is not an acronym but is named for the Greek letter parameter that it included as it's breakthrough. So like modern Perl (which has disavoweed both retronums), it's spelled leading-cap and not full-cap.

    (Since I'm still only reprocessing sounding files from the models, I'm using Perl. Not sure if I'll be able to use PDL or C++ when I make the leap to GRIB files, might have to get a Fortran.)

    -- I'm Pedantic, not Pompous; there's a difference!

    1. Re:Eta model not ETA Re:NOAA by GuidoDEV · · Score: 1

      I am well aware of the meaning of the name, and simply use caps for the sake of consistency. Thanks for pointing that out, though, as I'm sure there are many others who may be wondering just what the three letters ETA stand for besides the obvious... ;-)

    2. Re:Eta model not ETA Re:NOAA by n1vux · · Score: 1

      Guido --

      Given how informative you've been on the rest of this thread, that's not surprising. ;-) Glad to be of service.

      It IS pretty odd having ONE of the TLA's not be a TLA.

      bill

  294. Old Joke updated ... Re:Use Fortran 90 by n1vux · · Score: 1

    Q. What will scientific programming look like in 2020?

    A. I don't know, but it will be called Fortran '05.

    (I heard this joke first as my Government IT shop was slowly preparing to adopt F77 in 1981; as told then it was right on target, in 2001 they probably were using F90 as predicted.)

    (Same jokes works for Business DP and Cobol; we're looking at porting legacy VMS Cobol to MicroFocus on AIX to consolidate platforms. Joke used to work for A.I. and Lisp, but Common Lisp has been subsumed by its leading dialect Scheme, which is /not/ named Lisp.)

    -- My .sig is backed up on tape somewhere.

  295. FORTRAN no longer taught at my local colleges by Cable · · Score: 0

    I just tried to transfer my 10 year old DP AAS Degree to a State College. They claim that my FORTRAN class will not transfer because they do not teach FORTRAN there anymore. I checked with other local colleges and got the same response.

    Oh yeah they also won't take my:

    Pascal, Ada, 8086 Assembly, C Language, or DOS/VSE JCL classes. What a bummer, eh? Looks like I'll be taking Intro to Programming over using C++ instead?

    In ten years time, your computer college courses will be obsolite. Three years and they already have a better version of the language or technology to learn. Ten years and it is practially useless and non-transferable. Sucks, don't it? Same thing does not happen to Math, English, Music, History, Business, Nursing, or Communication Majors.

  296. CPU's optimised to suit language. by sbaker · · Score: 1

    I'm very sceptical of the claim that FORTRAN is superior in speed to C/C++ on a modern CPU. The reason is that CPU's are optimised to suite the most prevelent programming languages. With the vast proportion of all recent software packages being written in C or C++, surely the Intel's and AMD's of this world are optimising their CPU's instruction sets to run C or C++ - and not something like FORTRAN.

    --
    www.sjbaker.org
  297. I've done RPG too by billstewart · · Score: 2
    and believe me, you'd have to pay me six figures to maintain that cruft, and the high-order figure wouldn't be a "1" or "0".... The best thing to do with almost anything written for that brain-limited environment is to reverse engineer it and replace it with a very small Perl script, or a medium-sized C/C++/Java program. It was essentially a set of input/ouput format statements with the ability to do primitive arithmetic (no expression parsing - one operation per line) and simple looping control structures. Our main projects would crunch a bunch of data through an RPG system, then feed that through a sorter because you couldn't possibly do decent sorting in RPG, then post-process in RPG.

    I've also done Fortran - easy to learn, a few really ugly contructs like array overlaps, lousy I/O and character handling, funky bug opportunities in call-by-reference, but f77 and newer versions could interact well enough with C, so you could do the complicated parts in C and hand off any big array-crynching jobs to Fortran subroutines.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  298. BOOOOYAH! by artsygeek · · Score: 1

    Now I've found the perfect language to write my next really cool art installation in!
    *eyes gleam with the possibilities*

  299. Re:FORTRAN? by IXI · · Score: 1

    You wouldn't program a website in C++ anyway, would you? And that's the only domain where PHP is of some use.

    As a beginners programming language for standalone apps I would rather recommend Java than C++ because it's easier to use and safer in the sense that those features most frequently leading to programming errors in C/C++ aren't available in Java.

    --
    He saw some dirty arabs and fired. Too bad it was just some friendly kurds, BBC reporters and his fellow cowboys.
  300. Re:FORTRAN? by B3ryllium · · Score: 1

    Actually, I did once use C++ to make a little tool for my webserver. It would allow me to use the web to stop and restart some services (MUSCLE, mainly). Worked great ... but I suspect it would've been easier to code in PHP :)

  301. Hunting for bugs? by vga_init · · Score: 0

    C/C++ is by no means a difficult language all by itself (without any extensions), and I don't see how any programmer who's worth anything can write C code and then spend hours trying to fix syntax errors. That's just stupid! When writing programs the only errors I tend to make are logic errors, and those, unlike syntax errors, are not language specific. If you don't know the right way to write your program you will be making the same bug whether it is C/C++ or FORTRAN. FORTRAN is a dead language! I discourage anyone in thier right mind from learning when they could better spend thier time learning something more useful like C, Java, Perl, Python, etc etc. Of course, if you get a job having to maintain/port legacy code originally written in FORTRAN then by all means learn it! As long as you have a use for it. :)

  302. Recursion in Fortran, and Fortran's persistence by grayhaired · · Score: 1

    Of course, you can't implement quicksort properly in FORTRAN because the language isn't recursive!

    Actually, most any "nonrecursive" language can implement recursion using a stack. I've never bothered to do it in Fortran, but I translated a Turbo Pascal recursive maze algorithm to C= 64 Basic doing exactly that.

    The thing that keeps getting missed is that the available base of Fortran programs were written by domain experts in the various physical sciences. And once you've written a several thousand line program that takes an expert of exceptional understanding to write, are you going to let Joe the Contractor or Fred the Grad Student rewrite it in C++/Java/Lisp/etc and break the code because he does something to the code he thinks is a good idea, but doesn't really work?

    Well, Fred the Grad Student is almost a disposable part, so maybe you let him futz on it a year or two, but in general, a scientist doesn't get many kudos spending several months to a year rewriting code that already works. He would be better off publishing science, rather than catering to the current fashion in languages.

    Gray

  303. CERNlib by Anonymous Coward · · Score: 0

    In the high energy experiment I'm working on at th e moment we use two languages: Fortran 77 and Perl. Perl glues together the conglomeration of Linux machines, Suns, DECs, and even a Cray in various parts of the country to manage the 120TB (yes, terabyte) data set. Fortran does all the number crunching (and since the runtimes of these programs are measured in hours, and a run through a part of the data might be a matter of a week even on a hundred machines this is a big point...the freedom of C translates into easier errors, whereas Fortran usually just chokes at compile time).

    However, the other reason it's still all Fortran is CERNlib. This takes care of histograms, dynamic data structures, user interface, the works. There are some folks trying to make a C++ version called ROOT. There are experiments trying to switch over to it. It's been a nightmare.

    Interestingly, the next experiment is supposed to use gtk+ for our interfaces. This makes me wonder if we're going to C, which surprises me. On the other hand, C was my first programming language.

    Someone above mentioned Pascal. Forget Pascal. It's dead, and thank god! We recount to each other the horrors of that language in my lab: some folks at CERN were really pushing it about fifteen or twenty years ago.

    Most physicists have never heard of BNF notation. The computer is simply the last part of an electronic apparatus. Its role is fairly simple; the data structures are usually fairly straightforward. Many physics students learn electronics before they learn programming, and the computer remains only a piece of their approach.

    On the other hand, I know a nuclear theorist who does all his programming in Forth. His gripe recently is that math coprocessors on x86 machines have less precision than the ones he had on a punch card machine in the early '80s. It's not much better elsewhere: an astrophysicist I know is ever cursing his UltraSPARC's limited precision in his simulations. The moral: the language doesn't matter. It's only an interface to the hardware, and it's more pleasant to write Fortran than assembly.

  304. Parsers and Cross Compiler by Anonymous Coward · · Score: 0

    Has anyone like him written a "something-other-than-Java-language" compiler for JavaVM? I'm interested in compiling (or building a compiler for) legacy code for JavaVM (an environment that is now the lingua-franca of the computing world).