Is FORTRAN Still Kicking? 745
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?"
Yes (Score:2, Informative)
Re:Yes (Score:5, Informative)
"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.)
Dijkstra (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. [acm.org]
Re:Dijkstra (Score:3, Informative)
Re:Dijkstra (Score:3, Informative)
Re:Yes (Score:4, Insightful)
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.
Re:Yes (Score:3, Insightful)
Re:Yes (Score:5, Informative)
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
Re:Yes (Score:3, Insightful)
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.
Re:Yes (Score:5, Interesting)
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...
Re:Yes (Score:4, 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.
Re:ADA? (Score:3, Insightful)
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.
Design and Structure (Score:3, Informative)
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.
Re:Bullshit (Score:3, Interesting)
It will be nice when the finaly do.
Use Fortran 90 (Score:5, Informative)
Re:Use Fortran 90 (Score:3, Informative)
http://slashdot.org/comments.pl?sid=3041&cid=14
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/compiler
Don't use Fortran 90. (Score:5, Informative)
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:
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....
Re:Don't use Fortran 90. (Score:4, Informative)
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 [lahey.com]. 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 [pgroup.com]
Here is some recommended links from them that all of the "Fortran sucks" crowd should read: prentice [lahey.com]
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.
Re:Use Fortran 90 (Score:5, Informative)
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
Re:Use Fortran 90 (Score:3, Funny)
Well, it is Turing Complete.
Re:Use Fortran 90 (Score:3, Funny)
100% slower? That means it didn't run at all!
What you probaly meant was that Fortran was 100% faster than C++.
FORTRAN lives (Score:2)
Alas, for the rest of the question, I'm not a mathematician/number cruncher. The only floating point numbers I deal with are currency...
Re:FORTRAN lives (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 [inet-one.com] 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.
Re:FORTRAN lives (Score:3, Informative)
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.
A beauty all its own (Score:2)
I'm a Java convert now thought.
Re:A beauty all its own (Score:3, Funny)
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!
I still shudder... (Score:4, Funny)
You can leave FORTRAN behind, but you can never forget it. Sometimes, I wake up at night, thinking about it -- wishing I didn't.
NOAA (Score:4, Insightful)
Re:NOAA (Score:5, Informative)
Re:NOAA (Score:3, Informative)
of course it's still kicking (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.
Re:of course it's still kicking (Score:3, Informative)
Not to take away from Fortran. Language in general means far less to performance than an experienced programmer and good algorithms.
Re:of course it's still kicking (Score:2)
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?
Re:of course it's still kicking (Score:2)
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.
Re:of course it's still kicking (Score:3, Informative)
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.
FORTRAN is easy (Score:2, Informative)
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).
It's still kicking... (Score:5, Insightful)
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
One significant disadvantage to FORTRAN (Score:4, Insightful)
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.
Numerical Recipes considered harmful (Score:3, Informative)
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.
Re:Numerical Recipes considered harmful (Score:4, Informative)
hear hear for portability (Score:4, Informative)
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.
Re:It's still kicking... (Score:3, Informative)
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.
Re:It's still kicking... (Score:3, Interesting)
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...).
Re:It's still kicking... (Score:3, Informative)
The poster says:
This isn't true, and I don't think has ever been true. Below is a quote from a g77 page [std.com]:
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.
Extra ints on unformatted writes (Score:3, Informative)
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.
Fortran is definitely still in use (Score:2)
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.
Just link your FORTRAN libs (Score:2, Informative)
What else do you want? (Score:2)
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.
Re:What else do you want? (Score:3, Insightful)
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.
I used F77 for a while (Score:4, Insightful)
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.
FORTRAN is a must learn language! (Score:5, Funny)
Approximately 8000 years from now, when the date flips on December 31, 9999, I predict widespread panic and failure of computer systems all over the world. Since these 8040± year old systems will run on FORTRAN, it is imperitive that we all learn FORTRAN and teach it to our children. This oral tradition will save the human race when these systems fail to roll over the date on December 31, 9999.
You must act now! Only YOU can prevent Y10K!
Re:FORTRAN is a must learn language! (Score:4, Funny)
FORTRAN is alive and well in HPC space (Score:5, Interesting)
Saddly, there's no GNU (or other Free) FORTRAN 90 compiler that competes well (or at all) with the commercial ones.
Still Alive. (Score:2)
My beef with Fortran 90 is that it is very unportable. Every compiler follows the standard to some extent, and then has its own extensions. Many, but not all, support some obsolescent Fortran 77 syntax. Your best bet, if you want to achieve portability, is to use Intel's Fortran 90 compiler; it is the strictest.
As for Fortran 90's use, it is used very much by scientific and mathematical types who do parallel programming. I'm working this summer at a ``high-performance computing'' lab, and of three scientific applications I've looked at, all three have been written in Fortran 90. I can understand why. Dynamic matrices are *so* much easier. But if you write or find a good C++ class for dynamic matrices, then you might not need Fotran 90.
On languages and Fortran. (Score:5, Informative)
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
Use Maple (Score:2)
Re:Use Maple (Score:2)
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.
This is a really ignorant/uninformed question. (Score:3, Insightful)
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.
why not C? (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.
Matlab and Octave (Score:2)
Physics and other legacy code (Score:2)
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.
I'm glad I'm not the only one..... (Score:2)
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
Fortran optimizes well because... (Score:5, Insightful)
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.)
High Performance Fortran (Score:5, Informative)
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 [rice.edu]. 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
FORTRAN is the common denominator. (Score:2, Informative)
Tools (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?
matlab (Score:3, Informative)
There is Matlab www.matlab.com or the GPL version www.octave.org
Matlab doesn't give arcane error messages. Matlab has piles of built in functions for every basic math thing you could want. Matlab has many toolboxe's etc etc. Almost every university has a Matlab license and companies can afford a license.
Now the reason I am so pro-Matlab is it makes me much more productive for the simulations and experiments I run. Matlab is slower than raw compiled code (c,fortran,etc), but the productivity gains more than make up for it. If you are writing on fortran simulation that is going to run for a year on a super-computer don't use matlab. If you are writing many smaller simulations and ones that can use Matlabs tool-boxes than give it a shot.
When Matlab is slow you can always write a bit of c or fortran code and put it in with the Matlab. I've done this for a few long simulations. Also have Matlab and Labview (www.ni.com) integrated is fantastic.
It all depends on the usage (Score:2, Interesting)
If you want something that is strongly typed and does recursion extremely well, I would recommend ML. Yeah its a bit funky if you've never used functional languages before, but its pretty damn powerful (I even wrote a compiler in it..) And its one of those languages that has almost been proved "safe".
I, myself, have never used FORTRAN. I guess I've never happened on an occasion to use it, so I'm not that familiar with its optimizations. However, gcc optimizations are pretty damn good at producing assembly that is just about as fast as someone hand-coding the assembly. Also, Intel has some optimized libraries (I know they have some for Image Processing...not sure about general math...) so that might be something to look into. And I"m sure its possible to rewrite the FORTRAN libs in C (or something that provides an extremely easy interface).
About to teach a numerical class... (Score:5, Interesting)
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 [netlib.org] (BLAS) into their codes. Then they were allowed to use LAPACK [netlib.org] 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 [octave.org], where possible.
For reference, the class website (which will soon be updated for the new semester) is here: Math 224 [duke.edu].
Well, it's not a nice language, but... (Score:2, Interesting)
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.
Err, big deal (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.
Ratfor at least makes it look better (Score:2, Informative)
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.
Languages have very long lives (Score:2)
With enough production code, you can essentially push a language's lifespan out to infinity.
Try SciPy (Score:3, Interesting)
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/
The right tool... (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.
The right tool for the job. (Score:4, Insightful)
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.
F**k is a swear word even in Fortran (Score:2, Funny)
Perl is a good option for this sort of thing (Score:2)
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.
Say what you will about old languages... (Score:3, Interesting)
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.
Forgive the old timer. (Score:5, Insightful)
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!
Re: Ok, you are forgiven (Score:3, Insightful)
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
Right Tool for the Job (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.
Matlab? (Score:3, Insightful)
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.
Try O'Caml (Score:3, Informative)
Thoughts on Fortran Non-Obsolescence (Score:3, Insightful)
Will Python take over FORTRAN's niche? (Score:5, Interesting)
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
Re:Will Python take over FORTRAN's niche? (Score:3, Informative)
There are also some modules which allow the linking of FORTRAN subroutines into Python code.
25 year old language-wrong (Score:3, Informative)
FORTAN 77 had control structures like IF-THEN-ELSE, WHILE, etc., so you didn't have to write GOTO line number. It smoothed various other issues out, but to make it backwards compatible it kept much of the peculiar look of F-64: all caps, lines actually starting in column seven to leave room for up to five digit line numbers and a continuation mark in column six, I think even the reservation of columns 72-80 for sequence numbers so you could have a card sorter straighten out a dropped deck (not that anyone I knew ever used this feature - it made it kind of difficult to swap the cards around for debugging.)
Anyway, FORTRAN was primarily designed for number crunching, and AFAIK it still compiles the fastest straight number crunching code. Part of this is due to the many "advanced" features that hadn't been invented in 195x when it was first written. For instance, functions and subroutines have their own name spaces (like most languages since, except the first releases of BASIC), but the storage is static by default. So it doesn't spend time creating and destroying local variables on the stack, but OTOH you tend to use more RAM and recursive code was out of the question at least until F-77. There are (or were) no data structures (aka records). There are no pointers - you must use arrays anywhere a C programmer would use pointers. This vast loss of flexibility has the payoff that for the general run of numeric array operations, the compiler can tell what you are trying to accomplish and optimize it better than C compilers can, and even use parallel processors where available.
Still, IMHO, programming in FORTRAN sucks once you learn real progrsamming. But it is easier for mathematicians/engineers/physical scientists to use FORTRAN's arrays than C's pointers and structures, and the compiled code really zips.
Re:Don't complain about C! (Score:2, Informative)
Re:Don't complain about C! (Score:2)
Re:Don't complain about C! (Score:2)
Machine language was the first programming language. Then Assembly language.
The first Fortran compiler was not written in Fortran.
Re:Try Common Lisp (Score:3, Informative)
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.
Re:Try Common Lisp (Score:3, Informative)
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.
Re:Try Common Lisp (Score:2, Insightful)
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"
Re:Try Common Lisp (Score:5, Interesting)
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
* 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.
Re:Welcome to Legacy Land (Score:2)
TAPE OPER RES MKC500
INIT MKC500 TAP007
TAPE OPER AVAIL MKC500
*sob*....
the truth hurts (Score:2)
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
Re:Right Tool for the Job (Score:2, Insightful)
Re:Fortran vs. C/C++ (Score:2)
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).
Re:problems with loops? (Score:3, Insightful)
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 [scipy.org] and Pyrex [canterbury.ac.nz], 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 [cens.ioc.ee].
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.