Slashdot Mirror


FORTRAN 2003 Accepted as Standard

GraWil writes "Despite the nay sayers citing its death in 1965, the FORTRAN standards committee has now released the final FORTRAN 2003 specification. In an announcement to the comp.lang.fortran group, Michael Metcalf annouced that 'Fortran 2003 has passed its ballot with flying colours: 20 yeses, 0 noes, 8 abstains.' Strictly speaking, the 2003 and past standards are not freely available but drafts can be found online. FORTRAN 2003 is an upwardly-compatible extension of the current standard, FORTRAN 95, adding and extending support for exception handling, object-oriented programming, and improved interoperability with the C language. In other FORTRAN news, the GNU FORTRAN 95 compiler has made amazing progress over the past year. Gfortran will be part of gcc-4.0 when released (probably in 2005)."

10 of 59 comments (clear)

  1. Have they addressed any of the weirdnesses? by gowen · · Score: 5, Interesting
    Three things bug me about F95, which I use every day
    1. No standardised/portable method for handling command line parameters.
    2. Undefined behaviour for short-cutting logical ors. e.g. the behaviour of
      if(flag.and.function(var)) then...
      is undefined if flag is false and function() has side effects.
    3. The things you *can't* use parameters for (like fixing lengths in format statements) without running fpp/cpp on the code first
    4. No standardised meanings for

      real(kind=8) x

      Does that mean an 8 byte real? Or a 8 bit real? It depends on the compiler... (and yes, I know the portable solution is

      real (kind=kind(0.0d0)) x

      and the such like, but *thats* really ugly, compared to

      double precision x.


    --
    Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
    1. Re:Have they addressed any of the weirdnesses? by dubious9 · · Score: 2, Interesting

      I find Fortran (especially old fortran like 77) is most easily worked when you do the setup and application logic in C/C++. Once you've got the type conversions down (ie, when passing Fortran strings, their lenth is appended as an argument, or that array subscripts are reverse and start from 1), it's quite easy to call C from Fortran and Fortran from C.

      Since C is much more standard and cross platfrom, you can get that stuff out of the way and do the heavy lifting in Fortran. Data types, yes, those can be inconvenient cross-platfrom wise, (though I've never had to worry about them much on HPUX or Sun) but otherwise use the right tool for the job.

      --
      Why, o why must the sky fall when I've learned to fly?
  2. Re:In other news by dubious9 · · Score: 2, Interesting

    Then I challenge you do some complex multi-dimentional array calculation and manipulation. Most applications, yes, but why would scientists still use it if *everything* was better in c++? Not everything is maintaining applications from the 70's; there *is* new development.

    There's a language for every problem domain and when that problem domain includes heavy lifting with math, it's often fortran. Besides you can quite easily compile C and Fortan together, Fortran for the math, C for the application data and GUI.

    --
    Why, o why must the sky fall when I've learned to fly?
  3. Re:What future programming languages will be by gowen · · Score: 2, Interesting
    Dynamic memory allocation is a bit quirky IMHO, but way simpler than in C
    Quirky? I really like it.

    i) Declare a variable allocatable.
    ii) Allocate it, and check IFAIL
    iii) Deallocate it when you're done.
    iv) Profit!

    The real paradigm shift you need for a C programmer moving to fortran, is that nothing is passed by value and side effects are used so much. But the intent(in) and intent(out) directives are your friends for that sort of thing.

    Function overloading is pretty straightforward too, once you start using modules with well defined interfaces.
    --
    Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
  4. Why not the front page? by Anonymous Coward · · Score: 1, Interesting

    Why isn't this on the front page? Here I am, bustin' my ass writing Fortran code all day. I mean, the new spec is really important to me and my work. I've been waiting for the ability to natively handle command line arguments (i.e. without a STDIN/STOUT tricks) since moving from cards.

  5. What sectors are people using this in? by SLiK812 · · Score: 4, Interesting

    When I was a young lad in college (all of 10 years ago), I had to learn Fortran for one of my Chem Eng classes. We were learning Fortran77, mostly cause my profressor didn't think we would need it in the future, and didn't want us to be concerned with some of the new structures in more current versions.

    The Aero's also had to learn it (I know cause I taught it to them, since their prof sucked). So what sectors of industry are people working in with Fortran? Is it still just the Chemical and Aeronautical fields, are other places (where a different language might be more beneficial, say) still using it, cause no one wanted to convert systems?

    1. Re:What sectors are people using this in? by j_cavera · · Score: 5, Interesting

      The nuclear engineering communitiy is (still) standardized on F77. The reasons: 1) many great neutronics codes were written in the 60's (often for weapons research) using F77 and are still valuable today and 2) the NRC has some strange requirements concerning foward and backward compatability - almost anything from a DEC PDP-3 to a new G5 iMac can compile F77 code. Maybe someday they'll let us use F95...

      --
      #include "humorous_pop_culture_reference.h"
  6. Re:Deafening silence by traveyes · · Score: 2, Interesting

    You joke.... Seriously, where I work there's 2 people that still write in Fortran/66. No kidding.

    They don't use card-punchers, but they might as well.

    .

  7. MODERATION MADNESS STRIKES AGAIN by hummassa · · Score: 2, Interesting
    Moderators: the grandparent was not flamebait, I was serious.

    Ok, I will start over:

    dubious9: I challenge you do some complex multi-dimentional array calculation and manipulation

    You mean like:
    Matrix a, b, c, d;
    a = b * b / c + d.dot(a);

    unh? easy answer: use the right lib.

    dubious9: why would scientists still use it if *everything* was better in c++? Not everything is maintaining applications from the 70's; there *is* new development

    I don't know!? Because they don't know C++? Because they would have to put a C++ course in Engineering School? Because they don't know the whole awful lot of ultra efficient, STL-based, highly-parallelized numeric/scientific computation libraries available for C++? (an initial search of freshmeat returns at least seven interesting, relevant results)

    bhima: see the world in a web-centric sort of way

    what does a web-centric way has to do with c++?

    noselasd: Be very much aware that there are lots which measure "efficient" in development time, NOT execution time.

    See below :-)

    tigersh: That would hardly make Fortran efficient, but then in comparison to C++

    I am really more comfortable -- and efficient -- with c++'s features and quirks than with fortran's. But as I answered to dubious9, this is not what I said in the grandparent post. It was: Everything that can be done in FORTRAN can be done more efficiently and just as expressively in c++. So, it kind of lost its raison d'etre. And I stand for it. I can do things like the matrix manipulation of the first question in c++ and have the compiler parallelize what it can, use SSE or whatchmacallit, using templates (and more on this in the last answer) and operator overloading.

    noselasd: It seems you think of Fortran as a general purpose language, such as e.g. C and C++ it really is not. Fortran is strong at numerical computing, and in many areas there it is way better than C++

    No, it is not. That was my point to begin with.

    gowen: Really? How do you get around the fact that the flexibility of C/C++ pointers make it almost impossible to completely optimise/parallelise code is a safe manner?

    Answer: Partial Template Specialization. It works.
    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  8. Fortran lives in scientific research. by CharAznable · · Score: 2, Interesting

    Back in college, a couple of years ago, I worked as a research assitant for an astronomer. He made me learn Fortran77, and then Fortran 90. F77 is horribly stiff, no different from punching stuff into a card. But F90 was really great, easy, straight forward syntax, and very, very fast. My job was basically working with 15 year old f77 code and writing new f90 code used to calculate IR emissions from protoplanetary disks around stars. I leared a lot and made me a better programmer, I think.

    --
    The perfect sig is a lot like silence, only louder