Is GNU g77 Killing Fortran? 195
goombah99 asks: "I've come to believe that the existence of GNU g77 (and f2c) is holding back Fortran development. You might think that a free-ware compiler would be good for promoting the language. But it's not because the GNU flavor does not implement the de-facto standard DEC extensions to the language that give it dynamic memory allocation, pointers, and data structures. Without these Fortran 77 is indeed barbaric, but with them it is quite pleasant to work with. The problem is everyone writing new code is now afraid to use these commands in because of the desire to have their applications compilable by the teeming masses who may not want to pay $500 to $1000 dollars for a professional Fortran compiler (all of which do implement the DEC extension). F95 is being held back by the same considerations. Do you agree? Does anyone have some library extensions or pre-compilers that provide these capabilities to g77?" Are the DEC extensions so widespread and common that language survival is dependent on their inclusion, as the submitter suggests, in "every professional compiler". Assuming there aren't comparable features already available in g77, are there plans on eventually implementing similar?
10 GOTO 20 (Score:5, Informative)
Wrong... (Score:2)
20 CONTINUE
25 C++ faster than Fortran [iu.edu]
Remember, jumping to a line number that's not on a CONTINUE statement can break things.
Re:Wrong... (Score:2, Funny)
I learned Emacs in that course as well. I haven't used that since, either.
Re:10 GOTO 20 (Score:4, Interesting)
You can do that with C++?!? And it's super-efficient!?! The article explains that this code actually expands automatically into this loop that traverses the arrays in a convoluted manner designed specifically to improve cache-hit performance. All this complexity is hidden inside the library. Now I see what all these people have been raving about with template metaprogramming and expression templates.
Seems to me that template metaprogramming is a rather awkward way to go about these things though. Couldn't you design a language that had features specifically designed to enable this type of in-line compile-time code expansion?
Re:10 GOTO 20 (Score:5, Insightful)
A decent Fortran compiler knows more about the original statement than the C++ compiler can, and also, a Fortran compiler's number one reason for existence is to optimize array accesses.
A C++ compiler is lucky to correctly compile all of the heinous complexity of the C++ language, much less aggressively optimize this type of array access.
I'd be much more impressed if the poster had shown the resulting machine code.
Re:10 GOTO 20 (Score:4, Interesting)
Re:OK, you asked... (Score:3, Informative)
The author of Blitz++ has proven, through these benchmarks, that his c
Re:10 GOTO 20 (Score:4, Informative)
There's something like that already, called ANSI Common Lisp. (Yes, I'm serious.)
Re:10 GOTO 20 (Score:2)
Re:10 GOTO 20 (Score:2, Informative)
const int N = rand();
Then see how fast it runs. All that uber special loop expanding trickery usually doesn't work when you don't know the sizes of your arrays beforehand.
Re:10 GOTO 20 (Score:2)
Re:10 GOTO 20 (Score:2)
In other words, in these 'most cases' each position in the vector is NOT a new sample in a dataset, but rather a new variable, or axis of variability, in an equation.
How about using Fortran 95? (Score:2)
Equivalent Fortran 95 code:
INTEGER, PARAMETER
INTEGER, PARAMETER
REAL(DBL)
A(2:N-1,2:N-1,2:N-1) = (B(2:N-1,2:N-1,2:N-1) + B(3:N,2:N-1,2:N-1) + B(2:N-1,2:N-1,2:N-1) + B(2:N-1,1:N-2,2:N-1) + B(2:N-1,3:N,2:N-1)
Re:How about using Fortran 95? (Score:2)
INTEGER, PARAMETER
INTEGER, PARAMETER
REAL(DBL)
FORALL(I=2,N-1, J=2,N-1, K=2,N-1)
A(I,J,K) = (B(I,J,K) + B(I+1,J,K) + B(I-1,J,K) + B(I,J+1,K) + B(I,J,K-1) + B(I,J,K-1) + B(I,J,K+1))/7.
But so what? I'm following up on an old story anyway...
Re:10 GOTO 20 (Score:2)
ANSI Common Lisp already satisfies that requirement.
Re:10 GOTO 20 (Score:2)
Re:10 GOTO 20 (Score:2)
Re:Bah! fortan95 does all this as intrinsics! (Score:2)
Did you even read the linked article? This statement beats optimized Fortran. Why? It uses a novel algorithm to traverse the 3D arrays that maximizes cache hits. To implement this in Fortran, you'd have to rewrite the compiler. In C++, this is simply a library feature. That's the difference. It's much easier to change a library than a compiler, so development of new features can happen much faster in a language that relies on libr
oops youre wrong (Score:2)
if you did then you would know the article was about optimzed fortran77. Fortan 95 indeed has all the functionality they were trying to re-invent as meta-templates right in the language definition. parallelism is assumed for array assignments, for loops and even for conditional tests. Looping is implicitly done by the complier.
There's no way a meta-template could ever out perform that because the level
Re:oops youre wrong (Score:2)
Want "modern" features? Don't use F77 (Score:5, Insightful)
But it's not because the GNU flavor does not implement the de-facto standard DEC extensions to the language that give it dynamic memory allocation, pointers, and data structures. Without these Fortran 77 is indeed barbaric, but with them it is quite pleasant to work with.
You can mock Fortran 77 all you want but the "barbaric" striped-down version can be highly optimized. And for a lot of the legacy scientific code out there, you just don't need dynamic memory allocations, etc. If you really do need all these fancy, modern features, why the hell are you using Fortran 77? Fortran 77 is a simple yet highly effective, stripped-down language that is appropriate for a limited number of applications. But it does those applications really damn well. Don't blame Fortran 77 if you're trying to use the wrong tool for the job.
GMD
Re:Want "modern" features? Don't use F77 (Score:2)
Re:Want "modern" features? Don't use F77 (Score:2)
Old age. (Score:2, Funny)
Of these, group (1) is all the old foggies who are retiring, leaving group (2) people to continue the work. Typically wh
Re:Old age. (Score:2)
Hey! I resemble that comment...
Fotran is still better for scientific numerics (Score:3, Informative)
Consider the following....
perhaps the biggest complaint in the cutting edge of computing is that no one knows how to effectively program for multi-processors for ad-ho
Re:Fotran is still better for scientific numerics (Score:2)
Is there any platform where this actually happens?
Small Science Vs Big Science (Score:2)
oh about 500 to $1000 dollars is what a fortran lic costs. we have one and share it with 40 people. its a compiler lic not a run time lic, not a per seat lic. it is a processor lic and you can share it.
also if g77 did not exist, I think the number of compilers sold would be at least 100 fold larger, making the price presumably 10 or more times smaller. (the cost of support would not allow it
Re:Old age. (Score:2)
And now they've stopped teaching C and started teaching Java. Does that mean C is dead? Also, at Oklahoma State, Fortran 77 is still offered as an easy credit in the CS department, and Fortran 90 (and no other computer language) is a requirement for any engineer. It's not like Fortran has disappeared completely.
Re:Old age. (Score:2)
And that somehow doesn't apply to Fortran?
But to be convincing you're going to have to come up with more than one example.
One example was all that given that schools were dropping Fortran. A complete survey of schools and the languages they teach might be interesting, but we don't have that.
Also, it seems that to secure their position they had to force Fortran 90 to be a requirement.
I don
Eventually? How about currently? (Score:5, Informative)
There's already a team of very capable -- and young, not ancient/retired/whatever -- programmers implementing the Fortran 9x language, which defines some really interesting constructs. The current plan is for an initial release as part of 3.5.
Fortran 2000 has a spec, but I don't know of any implementations for it.
As far as "why is it still being used at all" comments, two words for you: no aliasing. The same reason why numerical computation in Fortran continues to chew C's head off.
Re:Eventually? How about currently? (Score:1)
What is this "aliasing" all about? Can you go into more detail regarding why fortran is better than C for numerical computing?
Bare in mind that I have NO knowledge of fortran, but I do compile fortran code for people doing scientific computing. I can see that at some point in the future I will probably have to learn a bit about fortran. It would be nice to know why bother? :)
Steve
Re:Eventually? How about currently? (Score:4, Informative)
I think this page on aliasing [c2.com] should answer most of your good question.
Add to that page the fact that if a compiler can't be sure about something, the answer is typically to copy the thing it can't be sure about into a safe location, and either copy it back somewhere after the "unsafe" thing or explicitly check it for changes.
For instance, if you're calling a function and the compiler can't know what it's going to do to the caller's registers, the compiler must painstakingly copy the registers out to main memory (well, it'll probably land in L1 cache but still it could be very expensive compared to the function itself), call the function, and copy the registers back in, whereas if the compiler can know it's a little function that only uses registers X and Y, it can only save those. If you're calling lots of little functions, this can add up.
A real example of this? If you're making a static call in C to a function, the compiler can go look at the function and do this analysis. If you're calling through a pointer, a common operation (at least, I can't stand using C without it...), it can't, because that pointer could be pointing at anything, up to and including a dynamically constructed function (if you're brave). To maintain its promises to the programmer that a function call never changes the variables in the caller (which may be located in registers), it has to protect all the registers.
Aliasing is a nasty problem because it's completely opaque to the compiler; the compiler can't see through that indirect function call to the function beyond, not even in theory. As the page mentions, other techniques are being developed that don't involve that sort of opacity by working around aliasing, and the JIT compilers take a different, more dynamic tack that in theory lets them do this analysis dynamically. (The Transmeta processors can also do some of this stuff, which is one of the ways they can speed up code when they run it a lot; they can do this more expensive analysis and dynamically optimize the code.)
Aliasing, Fortran, C, and C++ (Score:5, Informative)
Yeah... I thought the CS community at large mostly knew about this. Okay:
Fortran specifies that Thou Shalt Not Alias, so in the example on the page that you linked to, the function-calling programmer, the function-implementing programmer, and the compiler can all assume that everything refers to non-overlapping memory, and can optimize the hell out of read/write memory accesses.
When Dennis Ritchie designed C, it was a deliberate decision to not prohibit aliasing. (C's ancestor languages may have allowed aliasing as well, and DMR just decided to continue that; I don't actually know. But the question was brought up and considered; it's not an accident.)
When C was first being standardized by ANSI, a really sloppy proposal was made to add a 'noalias' keyword. It was so bad that DMR sent a public letter to the ANSI committee stating, "noalias must go; this is non-negotiable [lysator.liu.se]." So C89 has no way of restricting aliasing.
C++98 and C99 do, sort of. C99 added the __restrict keyword to the language. C++98 left the core language alone and defined a library type, std::valarray, that is free of aliasing by definition, opening up a number of optimization possibilities.
Valarray didn't quite work out; its design is semi-broken. Far more hopeful is using expression templates to expose more of the numerical computations to the compiler, so that more optimizations can be done on visible numbers. Check out Blitz++ at oonumerics.org for an example.
Re:Aliasing, Fortran, C, and C++ (Score:2)
They do; my elaborations came from my compiler course. But there are a lot of people, both programmers who never took formal courses (and this is one of the examples of things that programmers very rarely learn on their own but can be very beneficial to know when you need to make that function go 20 times faster, and this is also why it's so hard to explain why a good education can still be helpful to all but the most dedicated self-learne
Re:Aliasing, Fortran, C, and C++ (Score:3, Informative)
C's ancestors were untyped, so I don't know if it would have been possible to prevent aliasing. At best you give hints when pointers were copied, and hope no one deref's anything else.
C99 added the __restrict keyword to the language.
It's restrict in C99. __restrict is a GNU C extension.
Re:Eventually? How about currently? (Score:2)
If that's the only reason, then it should be relatively easy to get similar performance in C99 simply by adding restrict's all over the place, no?
Re:Eventually? How about currently? (Score:2)
Of course, the extreme solution is to preprocess your code with s/int \*/restrict int \*/ s/float \*/restrict float \*/ and so on...
Re:Eventually? How about currently? (Score:3, Insightful)
Plus, how many C compilers are made to optimize for this case that is extremely common in Fortran, but extremely rare in C code?
Fortran compilers are the best compilers for Fortran programs. C compilers are best for C programs. Fortran compilers can be expected to perform poorly on "C-like" structures, and C compilers are likely to perform poorly with "Fortran-like" programs.
Fortran to C++ converter? (Score:1, Redundant)
Why doesn't someone make a Fortran to C++ converter and help everyone out of their misery?
Re:Fortran to C++ converter? (Score:2, Funny)
Re:Fortran to C++ converter? (Score:3, Informative)
IBM Scientific Subroutine Package? (Score:2)
Thanks. I have some routines in Fortran I would like to convert.
Do you happen to know if the IBM Scientific Subroutine Package is available on the Internet? This was a collection of math routines.
It's "free software" not "free-ware". (Score:5, Informative)
Haggle over the technical merit of g77 all you want, but free software is not the same as "free-ware" [gnu.org].
Re:It's "free software" not "free-ware". (Score:1)
Re:It's "free software" not "free-ware". (Score:2)
I've never seen anyone refer to zero price beer as "freeware": "We're having a party and there will be chips, salsa, and freeware at every table" sounds confusing to me--will there be beer or computer software at every table? Perhaps you were referring to "Free as in beer"?
What about typos :) ? (Score:2)
took me a while to understand what the heck was going on there.
Let it go... (Score:4, Insightful)
When I wanted structures and records and fields (oh my!) I went with PL/I or Pascal or C or C++ or Java (in roughly that chronological order). Let it go. If you want to do Fortranish things, use (standard) Fortran. If you want to do Pascalish or Cish or Adaish (etc) things, use that language.
There's probably a corollary of Henry Spencer's law about ignorant OS designers reinventing Unix (poorly) that applies to programming languages, although I haven't quite figured what the "target" language (the way Unix is the target OS) is. (Probably Algol68
Greenspun's 10th rule of programming (Score:2)
"Any sufficiently-complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
Re:Greenspun's 10th rule of programming (Score:3, Insightful)
But that's almost a tautology: any C or Fortran program that doesn't contain "an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp" is clearly not "sufficiently-complicated"
Re:Greenspun's 10th rule of programming (Score:2)
But that's almost a tautology: any C or Fortran program that doesn't contain "an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp" is clearly not "sufficiently-complicated" ;-)
Not really. Take P to be any program. As we know, most programs can be implemented with a variety of complexites, so we designate the complexity of a program as c, and P(c) is an implementation of P that has complexity c.
Now, Greenspuns's 10th states that for any P, there exists a program L, such
Well fix it (Score:2)
It is open source. It doesn't work if you sit there and cry about it not working the way you want. It works great if you decide it doesn't work so you fix it yourself.
I don't care how you fix it. You can write the code yourself, or you can hire someone to write the code for you.
Comment removed (Score:3, Informative)
Re:Fortran Standards (Score:2)
I am pretty sure that is not true. All of the g77 information I could find indicates that g77 is no longer being developed. There are two Fortran95 frontends to gcc out there: g95 [sourceforge.net] and gcc-g95 [sourceforge.net], but these really have nothing to do with g77.
Re: (Score:2)
So little logic from a programmer (Score:5, Insightful)
The answer is no. A free implementation of fortran makes it that much easier for the language to be taught. If there are people that know the language they will use it. If people use the language it will grow and develop.
If you wan't to know what's hurting fortran you might try readin Dijkstra's "Goto Considered Harmful".
Re:So little logic from a programmer (Score:3, Insightful)
Did you see much C++ code being written that took full advantage of the standard, and did not violate it in any way before GCC 3.0 was released? I certainly didn't. The two biggest C++ projects I can think of are KDE and Mozilla. KDE took work to get working with gcc 3.0. Mozilla's decision from the start was to only use a minimal subset of C++ to avoid compiler issues.
Or how about this one... how many
Re:So little logic from a programmer (Score:2)
Think "welfare."
Re:So little logic from a programmer (Score:2)
I don't know whether that's meant to be a criticism of Fortran as a language or merely the way in which it's used. I've never learned Fortran and therefore I've never read much Fortran code, so I can't say whether most Fortran programmers use too many Goto statements.
Still, if we're all supposed to regard Dijkstra's essay as gospel, then why have language designers continued to add Goto statements to l
77 = 1977 right?? (Score:2)
Re:77 = 1977 right?? (Score:2)
Re:77 = 1977 right?? (Score:2)
Re:77 = 1977 right?? (Score:2)
Sad but (mostly) true. (Score:2, Interesting)
The vendor compilers however had all the f90 options, which 'forced' us to pay for the expensive developer packages instead.
At the time, the two extensions we needed (IIRC) were STRUCT and POINTER, which were on g77's to-do
I do agree! (Score:2)
When realising that G77 lacked many features that my documentation said I should find in Fortran 77 I gave up and wrote everything in C.
Not blaming anyone, I was still a bit disappointed. The feature I lacked was the possibiliyt to pass structures as arguments to F77 functions.
But of course, if G77 did not exist, I would
This is Depressing (Score:4, Interesting)
However, 10 years ago, FORTRAN compilers were very much more advanced in terms of optimisation for numerical work than C (e.g. the Cray compiler could do automatic vectorisation.)
I would have thought that if you had a big, expensive supercomputer, you can afford the compiler. Not buying the compiler is silly, because you'll probably end up with an order of magnitude less performance out of it with a compiler whose primary goal is portability and has been designed to work well on totally different hardware architectures.
Having said that, though, if you've got a low end box, you probably want a cheap or free compiler. Why spend $1000+ on a compiler when the box probably cost less? The low end box can probably sustain 100+MFLOPS (easily) and peak well into the GFLOPS. That's a cheap Athlon we're talking about. So you probably don't want to buy a fancy FORTRAN compiler. Why not just stick to C or even C++ nowadays? Legacy code :-(
So you have a problem. The big supercomputer you bough 5 years ago probably has a "slow" C/C++ compiler. The nice cheap box you have on your desk has arubbishy FORTRAN compiler and a reasonable C/C++ compiler.
So, you can convert all your legacy code to C and C++, you can buy a commercial FORTRAN compiler or why don't you universities cough up some time and money to give to the GNU FORTRAN people to help them improve their compiler? Or is that too radical and lefty?
what about the intel compiler ? (Score:4, Informative)
The Intel Fortran compiler supports F90, dynamical allocation, works better than Absoft or Portland Fortran, and is free for Linux...and for all of you complaining about Fortran, do you have a job ? I know someone who ended with a very nice job just because he had mentioned "Fortran" on his resume, and had spent maybe 1 week of work on " Numerical Recipes in Fortran" and the Intel/g77 compiler.
Free Intel F95 Linux Compiler (for non commerical) (Score:2)
http://www.intel.com/software/products/compilers/ f lin/noncom.htm [intel.com]
However, it's listed as non-commercial only - which means (extracting from the license agreement) "If you are using the Materials under the control of a Noncommercial-Use license, you as an individual may use the Materials for only personal, noncommercial and research purposes"
But to a commercial entity, the fees aren't really tha
In other news (Score:5, Insightful)
Yeah, there's a lot of that going around in the open source world. I've heard of this other project that's stifling growth in a major segment of industry by not implementing the de-facto standard extensions that its commercial competitor uses. You might have heard of it, it's called Mozilla.
I admit that I haven't touch FORTRAN since about 1985, so forgive me if I'm not exactly up on the state of the art. From a little googling, it looks to me like g77 is pretty much an orphaned project. This is free software, man, developed and supported by the community. Have you considered volunteering to fix the parts you think are broken? Or volunteering to work on the f95 compiler effort?
Wrong conclusion (Score:2, Insightful)
Troll question (Score:2)
You can easily link modules of different languages. Why do you still work with a language which was long time obsolete when punch cards went out of fashion?
I mean, of course you can bloat the language with structures it originally didn't dream of, but you can't expect every compiler author implement the newest expansion, for free. Just because he wrote parts of an existing compiler years ago.
I'd say, like the old saying, if you don't find a softwar
Re:Troll question (Score:2)
If you know the language and the language can do what you want to do, then why not?
Another good reason is if you are supporting existing software you might want to keep the code consistent.
I'm not sure you can claim obsolescence for Fortran, especially at the time when punch cards went out (mid- to late-70's). The gold standard, F77, was used everywhere, and it remained the gold standard at least until F90 came out. While C was being used for taking care of OS issues (networking,
what is killing fortran (Score:4, Interesting)
in fortran, and they immediately think of old,ugly f77.
I write code (both reasearch and commercial vibration analysis) in fortran90/95 every day - I
use modules, I use pointers, and I get great performance. A few things I also get:
1) clean, neat code that is easy to read by non-programmers.
2) Array bounds checking by the compiler - try that with C++. Array bounds checking saves me
huge amounts of time in development.
3) Compiler checking of function calls, via encapsulation of functions in modules.
4) Easy use of BLAS and LAPACK routines for real computational work.
5) The actual function definition used for the function prototype - I don't have to maintain a
separate prototype for my functions to get the advantages of prototyping!
Fortran isn't perfect (yet). It still lacks the ability to make a function part of a data
structure (ie, classes). It current i/o abilities still suck. It's ability to handle characters and
character strings is terrible. But it does have advantages other than producing fast code, and it
isn't your father's fortran77.
Re:what is killing fortran (Score:3, Interesting)
*snort* I'll believe that when I see it.
2) Array bounds checking by the compiler - try that with C++. Array bounds checking saves me huge amounts of time in development.
I use the STL and not think about bounds ever again.
3) Compiler checking of function calls, via encapsulation of functions in modules.
Unless you're badly describing another feature, that was one of the first features of C++ and ANSI C.
4) Easy use of BLAS and LAPACK routi
Computer "sceintist" != Real Sceintist (Score:4, Informative)
1) clean, neat code that is easy to read by non-programmers.
>*snort* I'll believe that when I see it.
double snort. Did you know its not possible to make a typo type syntax error in fortran 77 that will compile? hard to believe I know but its true. ( You cant misplace a plus sign or comma or leave off a [] and have it compile.
when I try to debug faulty c-code and see something like
i = --j
I have to try to figure out if they could have meant to write
i = -j or i = j-- or i = --j
yuck.
2) Array bounds checking by the compiler - try that with C++. Array bounds checking saves me huge amounts of time in development.
I use the STL and not think about bounds ever again.
SLOOOOW. And unparallelizable. and it kills multi-processing dead. and loss of control over memory management. loss of memory mapped sub arrays, strides etc.... Sure you can do strides in c++ but now they are function calls not direct-to-memory. In fortran you can often pull contionals outside of loops using the WHERE syntax. Its much better to have a good syntax in the language than make up for it with a bunch of function calls and object instantiation. e.g. both languages can write
A = B*C where A,B and C are matricies but C has to do it with objects and overloads. fortran does not. which do you think is going to be faster.
3) Compiler checking of function calls, via encapsulation of functions in modules.
Unless you're badly describing another feature, that was one of the first features of C++ and ANSI C.
So fortran steals a good thing from C and you complain? In fact fortran 95 implemented headers much better than the asanine way C does it. If fortran you can declare the headers for the called functions right in the code that will call the function so fewere prototype mismatches occur. and fortran also lets you specify the not just the type defs but also whether the subroutine will change the arguments or not (without having to pass by value or declate things final). Thus the compiler can know for example if a cache will need to be written back or how to share memeory between two processors. or if it can multi-thread past a subroutine call.
4) Easy use of BLAS and LAPACK routines for real computational work.
>Two words: C wrapper.
whoopee. I can say it in reverse: take the STL and put a fortran wrapper on it. now fortran has the STL.
5) The actual function definition used for the function prototype - I don't have to maintain a separate prototype for my functions to get the advantages of prototyping!
>Some argue that having a separate prototype prevents the implementor from arbitrarily changing the interface without warning their other team member.
well fortran90 can either derive its prototype or you can specify them your call. its nice to have it both ways and not pay any price.
>Fortran isn't perfect (yet). It still lacks the ability to make a function part of a data
structure (ie, classes).
not really true. You can program in an object oriented fashion if you wish. but its more like perl-objects where the data is explicitly passed rahter than C where its hidden from the user.
in C++ you would say
myobject->hash_get(key)
in fortran you would say:
hash_get(myObjectStructure, key)
is there any important difference?
It current i/o abilities still suck. It's ability to handle characters and
character strings is terrible.
Well fortran90 does have nice string handling. and of course it lacks the C string terminator problems that account for so many buffer overflow issues. But I w
Re:Computer "sceintist" != Real Sceintist (Score:2)
Did it many, many times in F77.
Real Scientist != Computer Scientist. What C++ compiler are you using? Even VC++ makes those calls in-line and optimized the heck
Is this really a bad thing? (Score:3, Insightful)
1) People don't want to pay $500-$1000 for a compiler.
2) The existance of g77 means that they don't have to.
What's the problem again? Shouldn't people be able to make a ``less featureful, less money'' decision? (..and that totally ignores the other values of having a free-as-in-speach compiler).
Fortran 77 is just fine. (Score:2, Insightful)
there is no good reason to develop a new application on fortran today.
well, except for massively parrallel calcuations using parallel optimizing compilers.
but write it in F77 anyway, it's all you need.
if you really need dynamic memory or pointers, write it in C. it's faster, easier to optimize with plain gcc, and also from the 70s.
or just buy frea
G95 Project (Score:2)
Oh come on (Score:5, Insightful)
99% of the problem is the programmer not the language. Every language has an advantage in its specific area. VB/Delphi Quick & Dirty Interface or Prototype (quick development time). C/C++ Portability & Speed of Program. Assembly True low level programming. Wait what is fortran used for again? (lol just kidding). Excellent math modeling for quick and dirty precision calculations (I'd still use C because I've never used Fortran).
I guess g77 is holding it back because that is one of the reasons I've never used it. I thought there was a Fortran 85 or 90 spec as well?
Boomer Sooner (way to choke one off early Tejas)
Re:Oh come on (Score:2)
I'd still use C because I've never used Fortran
FORTRAN, especially in its older incarnations e.g. FORTRAN-77, reall is that bad. Having learned C as a teenager (K&R then ANSI) and then being forced to write some F-77, I can assure you it was no picnic. If you remember the BASIC interpreters that used to come on 8-bit micros in the early 80s, without the user-friendly error messages, with fixed-format 80-column source geared towards old punch cards
Re:Oh come on (Score:2, Insightful)
You said it yourself. If you learned C as a teenager, you would not have been forced to spend the time with Fortran that it takes to get proficient enough with it to appreciate its elegance, power and simplicity.
I'm not going to get on the tired old hobbyhorse of "Real Programmers Don't Use Pascal" (if you're not following me, google for the title), but if you cut your teeth on mainframe assemb
Re:Oh come on (Score:2)
Re:Oh come on (Score:2)
The question now is are you from the extreme right and hate my sig because I said Evolution was true or the extreme left that hates my sig because I said there is a God?
The Answer:
It doesn't matter a biggot is a biggot.
Re:Oh come on (Score:2)
I have no problem with someone disagreeing with me. However you said that you could not take my comment on a technical issue seriously based on my beliefs. If the subject had was someone claiming that they could or disprove that there is a God you might have a reason to say that my sig was some kind of proof that I was biased. My comment was on Fortran. I even suggested some alternatives to Fortran. No
Re:Oh come on (Score:2)
FORTH can pass compiled and uncompiled closures on the stack, with either static or dynamic binding within them as you choose. That's more advanced than... well... any other language I know of.
Re:Oh come on (Score:2)
Older??? WTF??
Lessee, FORTRAN 66 superceded FORTRAN IV which superceded FORTRAN II...
Old FORTRAN is where you had to be careful how you used Hollerith constants which would be 10 characters of 6 bits each on a CDC-6400.
Old FORTRAN compilers would barf at IF(...)THEN lines and give errors messages for ENDIF.
Old FORTRAN is where the unit numbers for I/O actually connected to physical devices.
Old FORTRAN is where the senseswitch actually
Re:Oh come on (Score:2)
Not quite, but at my old power station the primary reactor temperature monitoring computer was a Honeywell 316 with a teletype terminal, two green-screen displays (one for each reactor operator), a built in 160k disk and 32k-16bit words of ram. It has multitasking, and a paper tape drive for booting the operating system. There was no file system on the disk. Temp
Re:Oh come on (Score:2)
I was born 1954 - was first exposed to FORTRAN in January 1971 on a CDC-1700 (at CDC's La Jolla facility) - compilation speed for a real simple program was maybe one line every 3 to 5 seconds. The CDC plant is no longer there, but it was about two to three blocks from Sun's new San Diego facility is now located.
Curious about the old power station - would be fun to look it up in one the "World List of Nuclear Power Plants" that showed up in Nuclear News twice a year.
I seem t
Lol (Score:2)
Re:I'm serious (Score:3, Insightful)
I call bullshit on you. There is <b>nothing</b> about fortran that makes GOTOs any more necessary than they are in C (which is an argument in and of itself... however I come down on the side of "never use them").
I taught two beginner's programming classes between 1995 to 1999, one in F77 and one in C (with the last week talking about C++). Apart from the lack of pointers and structures, F77 has (essentially) all
Re:I'm serious (Score:2)
You do realize, of course, that once your compiler gets its scruffy mitts on your code, that it all gets turned into GOTOs and JUMP statements at the assembly & machine code level, right?
GOTO is a perfectly necessary construct, and i
Re:I'm serious (Score:2)
That being said: lets take your goto/toaster analogy. That's crap. A better analogy would be comparing block constructs (loops, branches, subroutines) to toasters and comparing exposed 120V heating coils to GOTOs. I mean, sure loops are implemented using "GOTO"-like assembly instructions, but with a loop (or a whatever) you have certain guarantees and warantees on state consistency and the like. Do you toast your bread with a coil
Re:I'm serious (Score:2)
:-)
I'm really not trying to troll, honest. I just think that the "$foo considered harmful" meme is frequently taken much too far.
The original points behind essays such as Dijkstra's "GOTO considered harmful" or Tom Christensen's "CSH considered harmful" may be valid, but IMO this kind of polemic argument often goes out of its way to ignore any of the redeeming qualities in the harmful thing being considered. This kind of thinking, in my opinion, can lead to "forbidden knowledge" and, ultimately, a sense o
Re:Flame on! -- wrong perspective (Score:4, Insightful)
You are looking at the issue from the wrong perspective. Unlike a software engineer, scientists does not consider the software they write a final product. Their product is the result of the computation performed using the software. That's what brings them grant money. Thus, they would like to spend as little time as possible writing software and dedicate most of their time to interpreting those results. Since most of the numerical libraries out there are written in FORTRAN and that they are already familiar with the language, I think FORTRAN will remain their darling for a long time. It's a fact of life, not a matter of policy.
By the way, most of them use commercial compilers rather than g77, because they need the optimizing features which g77 does not provide (think parallel computing).
Re:Flame on! -- wrong perspective (Score:2)
Most engineering places I've seen have used tools like Matlab, Matematica and Maple for computational stuff. And in my experience it's a lot nicer to do it in Matlab. (Though that lan
Re:Flame on! (Score:3, Informative)
Fortran is the language used in the communication terminals the Navy uses to send and receive data through the Milstar satellite communication network.
These devices are used in ground stations, ships, and boomers. That's a pretty major application.
Fortran 95. (Score:3, Interesting)
Re:Fortran 95. (Score:2)
Re:Why not use gfortran ? (Score:2, Informative)
Well, I think it's still a bit early for production use. In its current state, it may be fine to play around with and help the developers, but I don't think it is good enough yet for real world programming.
Marcel