FORTRAN 2003 Accepted as Standard 59
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)."
Have they addressed any of the weirdnesses? (Score:5, Interesting)
if(flag.and.function(var)) then...
is undefined if flag is false and function() has side effects.
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.
Re:Have they addressed any of the weirdnesses? (Score:3, Interesting)
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 b
Re:Have they addressed any of the weirdnesses? (Score:1)
Re:Have they addressed any of the weirdnesses? (Score:2)
Though I had put it down to my comfort with C and the lead propeller head's comfort with Fortran...
Re:Have they addressed any of the weirdnesses? (Score:1)
if ( ptr && *ptr ) {...}
Most modern languages I know of support this.
Re:Have they addressed any of the weirdnesses? (Score:1)
I haven't done any Fortran-95 in a while, but I believe that most of this syntax is correct:
Later on, if you want to go back and change to some other precision (single, quad??), just change the parameter statement. Also, note that if you want to use literal constants, just append "_KREL", as in "1.0_KREL".
Re:Have they addressed any of the weirdnesses? (Score:1)
Re:Have they addressed any of the weirdnesses? (Score:2)
if(flag.and.function(var)) then...
is undefined if flag is false and function() has side effects.
You should be shot for trying something like that. In any language. An optimising compiler is supposed to evaluate 'flag' first.
If you want to pull a stunt like that, try
c
c *WARNING*: function has side-effects so we have to execute it!
c
funcres = function (var)
if (flag
Re:Have they addressed any of the weirdnesses? (Score:1)
But if flag is false should it evaluate function().
The C standard quite clearly states that it
if(a && func()) {block;}
is equivalent to
if(a) {
if(func()) {
block;
}}
Nothing is that clearly defined in Fortran
Deafening silence (Score:5, Funny)
Re:In other news (Score:2)
Be very much aware that there are lots which measure "efficient" in
development time, NOT execution time.
Re:In other news (Score:2)
Re:In other news (Score:3, Insightful)
Re:In other news (Score:3, Interesting)
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 dat
Re:In other news (Score:3, Informative)
I think the main reason is that Fortran can describe the problem space in ways that scientists can use well (and hence is maintainable) and C handles the rest fine.
I don't understand why some many younger people are so quick to put older languages down, my sister has made a small fortune maintaining
Re:In other news (Score:2)
I guess it's because they've never understood the various problem spaces to begin with and see the world in a web-centric sort of way.
No, we just hate legacy crap that exists for no other reason than no one wants to bite the bullet and develop something new in a non-crappy language like COBOL. Corporations are famous for short sightedness and continue to do things like maintain old COBOL programs for years and years where it'd probbably be cheaper in the long run to re-write the whole thing in an easie
Re:In other news (Score:1)
Re:In other news (Score:1)
MODERATION MADNESS STRIKES AGAIN (Score:3, Interesting)
Ok, I will start over:
dubious9: I challenge you do some complex multi-dimentional array calculation and manipulation
You mean like:
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 h
Re:MODERATION MADNESS STRIKES AGAIN (Score:2)
Re:MODERATION MADNESS STRIKES AGAIN (Score:2)
However, that still doesn't get around the primary advantages of FORTRAN.
First as was pointed out above, the lack of pointers (and a few other restrictions as well) enables optimizing compilers to produce extremely efficient code compared to C/C++.
The other is portability. While C/C++ are rather portable, FORTRAN guarantees that you'll get exctly the same precision no matter what platform you compile on. Integer, Real, and Double have never changed in definition. If it produced the correct results on th
FORTRAN vs. C++ (Score:2)
1 (wrong). Pointers: Partial Template Specialization enable at compile-time all the optimizations that the lax aliasing rules of C++ normally would disable. Good c++ numeric libraries are full of well-tought, well-defined PTSs that make the hard work for you.
2 (right). Portability: Yes, this is a plus for Fortran. But what I said in my original post is about New Code To Be Written. I really doubt any 21st century engineers n
Re:FORTRAN vs. C++ (Score:2)
But what I said in my original post is about New Code To Be Written. I really doubt any 21st century engineers need their code to run the the PDP11, so, to write new engineering code, I would surely go with C++ and a good numeric library.
I agree that nobody is likely to want to run any code on a PDP 11 anymore (though some DO run ancient code on PDP 11 compatible PCI cards in a PC now). That's not the issue. The issue is more that scientific and engineering code tends to last a LONG time, and can be ver
Re:FORTRAN vs. C++ (Score:2)
By using the right numeric library? 100%.
Re:Deafening silence (Score:5, Funny)
Re:Deafening silence (Score:2, Interesting)
They don't use card-punchers, but they might as well.
.
Re:Deafening silence (Score:1)
What future programming languages will be (Score:5, Insightful)
What we really care about: libraries. Being able to do things quickly, without fsking about.
That is why php is successful, people can just run phpnuke/postnuke etc.
Perl is also successful because of its roots and flexibility, and easy to get into, and you could just run slashdot on your site if needs be.
What really helps these, is foundations. php/mysql, perl/whatdoesslashdotuse? People will write in anything if they see an easy way to get something done. Tutorials and support material.
The point - except for people studying 'computer languages' (as someone woudl study the history of world languages) who will pick up fortran as an option for a new language?
I am first to admit I do not know the dissadvantages or advantages of it. Are there any? or is it just syntax?
Java is a language, but much more, it abstracts the whole idea of a language ( no it isn't correct to cite
So it isn't about the clean syntax OO language, but the process of programming. Through design and development and testing, it has all be rbought up with testing, this is true of almost all languages, but when I think of Java I have a view of all the testing frameworks, libraries and standards.
To be honest, Fortran now is just a syntax specification, that says, take this line, and make that byte code. That doesn't do it for me.
One mans syntax is another mans syntax error.
Error on line 1: Insert ; to complete statement
Re:What future programming languages will be (Score:5, Informative)
Disclaimer: I have an M.Sci in physics with a slant towards computational physics. I'm most familiar with F90 but its advantages should apply to the later revisions as well.
Fortran is a slightly higher-level language than C. It has lots of math capabilities built-in; particularly matrix types and operations meaning good potential for parallel processing. Decent compilers can produce multiprocessor and MMX/SSE code from Fortran, and probably the equivalent on non-x86 platforms. I'm not sure if you can do this in C portably.
Fortran has a fairly simple overall syntax where newlines matter. I found it very easy to learn, having some experience with Python and C. In some ways the syntax is rather arcane but at least it's quite clear (compared to C or Perl at least IMHO).
Fortran does have pointers, but they are unnecessary because of other memory handling methods (namespaces or 'modules'). Dynamic memory allocation is a bit quirky IMHO, but way simpler than in C.
The language feels well suited for physicists. It's not necessarily good for general programming, but I'd happily use it for many speed-critical sections instead of C.
One important reason for the persistence of Fortran is the number of libraries for computational sciences, for example LAPACK. They can be included in modern Fortran programs despite being written in F77. There have been a number of attempts to make a scripting front-end for these libraries; Matlab is one of them, even though its F77 roots are not very visible.
The common complaints about Fortran are mostly true for F77 and older revisions. F77 is a truly horrible language, and it has none of the nice features that make F90+ good for scientific computing.
Re:What future programming languages will be (Score:2, Interesting)
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 u
Re:What future programming languages will be (Score:2)
It has lost it's usage as a general purpose language, as yes you're right in that, and most people will never need to pick it up. But for scientists Fortran is an attractive option especially if know how to interface it with C (and it's not
Re:What future programming languages will be (Score:2)
how to interface it with C (and it's not that hard), you can use the best of both languages.
It is fairly easy, I just wish symbol underscoring and capitalization didn't cause so much trouble. A nice set of manditory linker flags to link libraries with different conventions would be nice :-)
Libraries and support tools (Score:3, Insightful)
You can think of it as being for scientific computing what php is for web development. Except, of course, that Fortran is far more dominating in the scientific computing field than PHP is for web development.
I know, I write scientific computing in C++, and I must occationally consider if it wouldn't have been more cost efficient to use Fortran, where most of the relevant libraries, support tools and exper
GFORTRAN != G95 (Score:4, Informative)
Re:GFORTRAN != G95 (Score:1)
Why not the front page? (Score:1, Interesting)
GNU Fortran 95 (Score:1)
Re:GNU Fortran 95 (Score:2)
Dependency analysis is not GCC's strong suit.
What sectors are people using this in? (Score:4, Interesting)
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?
Re:What sectors are people using this in? (Score:5, Interesting)
Re:What sectors are people using this in? (Score:2, Funny)
Re:What sectors are people using this in? (Score:2)
NWA for example.
There used to be two competing mainframe packages for airlines, one was essentially written in Fortran. I don't know the other one and have fogotten it's name.
afaik, people are now migrating away from the Fortran one towards Unix systems (?), but they ain't got thar yet. (it is not a conversion job, it is a complete rewrite)
Stop...the...nightmare (Score:3, Funny)
Re:Stop...the...nightmare (Score:1)
I have the same nightmares. I was an Aero and I remember having to model how heat dissipates from different fin shapes in color! I also remember praying that the program will finish running on my IBM PS2 before class started. I hated Fortran so much that it turned me off from computers for years and I have always loved them since I got my first VIC 20 when I was 9. I'm just writing about it and I need a towel for my cold sweat and half a bottle of Advil for my migraine!
Re:Fortran (and Cobol) (Score:2)
My problem is, you are half right. Eventually their use will die out. I reckon that I will have a big problem in about 10 years, but then again (quoting John Maynard Keynes): 'In the long run, we are all dead'.
Holding out. (Score:2, Funny)
Fortran lives in scientific research. (Score:3, Interesting)
I love F90 (Score:1)
For example you can move matrix blocks in one statement, or set them all to zero at once. It's almost like using a math package but fast.
This online manual is teh goodness:
http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90Cour seSlides.html [liv.ac.uk]
If they exist I want to buy a Fortran related T-Shirt. Also one about TI-994A's but not the ones in cafepress.