- 3,306
- 2,529
If you are a real physicist, sooner or later you are going to have to link to Fortran.
If you are a mere programmer, you can probably get by without it.
If you are a mere programmer, you can probably get by without it.
Dr. Courtney said:... real physicist,...
... mere programmer...
Two comments:Dr. Courtney said:If you are a real physicist, sooner or later you are going to have to link to Fortran.
D H said:Two comments:
- Linking to Fortran is easy. Just compile and link. There's a vast difference between linking to an old, outdated Fortran function and updating that old, outdated function.
- I guess that makes the people working at CERN just wannabe physicists. Back in 2003, CERN dropped its massive Fortran library in favor of the C++ ROOT package. I'm sure there are still a few legacy Fortran applications around, but the maintenance costs have pushed a lot of CERN to convert their software to C++, using ROOT.
Seems like you were blaming the language for buggy compilers or sloppy programming technique.anorlunda said:I used FORTRAN for 20 years. I even contributed to the FORTRAN 77 standard. But in the 80s, I got UCSD Pascal on my Apple ][ and fell in love with it. I went from that to C to C++ to Visual Basic. VB was very productive, not because of the language but because of the development environment.
But in the process I became a FORTRAN hater. I hated the fact that 2/3 of all bugs were due to bugs in COMMON statements and abusive data overlay schemes in COMMON/EQUIVALENCE intended to save memory. I hated the fact that a typo like. DO 1 I=1 10 would compile without warning as DO1I = 110 rather than the intended DO 1 I=1,10 So many such bugs seemed unnecessary. I thought we should have machines that detect or prevent such bugs, not expensive engineers.
I tried to get my engineer friends to convert themselves from FORTRAN to C++, but I never convinced a single one of them. Once one learns a skill, one resists new things that deprecate the old skills. I remember one engineer in the early 90s who spent a whole year on a revision of his VAX program that saved 400 bytes. He was so proud of his memory shaving skills.
Thanks for reviving my memory of these things.
SteamKing said:Seems like you were blaming the language for buggy compilers or sloppy programming technique.
gsal said:So, I do not find it valid when people say that they don't like Fortran
Don't be sad! I like programmers.jedishrfu said:Hmm
yes, it does---to some degree. But even in this area skilled programmers can much benefit from the more powerful languages. There is nothing you can do in Fortran which you cannot do in C++ too, if you know what you are doing. And there are many things in C++ which you would not even try in Fortran (I am not even talking about the expressivity of Python or Common LISP or similar).SteamKing said:Fortran works well at what it was designed to do: Crunch Numbers, and lots of them.
That is certainly inadvisable. But security does not end there. For example, even in a number crunching engineering application one might very well be interested in processing user input, and in doing this, not having a program which is not filled to the brim with exploitable stack and heap overflow errors. Almost all Fortran applications I have seen are simply horrible in this regard.SteamKing said:Fortran was never designed for systems work; no one would want to use Fortran to write an operating system or set up security for one.
Do not get me wrong: There is some extremely clever software written in Fortran. And I have the utmost respect for it. This includes, for example, the LAPACK, but also various other "legacy" scientific applications. I myself work on a program with about 2 million lines of Fortran and 250k lines C++ code, which is widely used in chemistry, and a lot of the Fortran code is very well engineered and very well thought out.SteamKing said:Not bad for a language which is "ridiculously impotent".
This is not quite true in Fortran, because there is only so much you can do with the language. Many options you get with other languages are simply not there. Or they are formally there, but you can't use them because they are buggy across different compilers or outrightly unsupported (the last time I tried, in 2007, it was in practice impossible to put records in dynamic arrays or dynamic arrays in records, or do a number of other very basic things, because any of them would not work in at least one of the six different compilers the applications I had to work on was supposed to support. In 2007, compilers did not even fully the support Fortran 95 standard!).SteamKing said:In any event, computer languages are a lot like people languages: the more of them you know, the better off you'll be.![]()
This is not quite as bad in Fortran, because the pointers are not as flexible as in C/C++. You can't make pointers to arbitrary objects (only to objects which are declared as "target"), and you cannot freely pass them around.D H said:You sure about that? Fortran 95 added pointers to the language. There is a huge potential problem with pointers, which is aliasing.
I agree. Basically, developers have more or less given up on Fortran, and there are very few compiler developers left. What we get in the end is a quite unreliable mass of "stuff", with all compilers supporting different subsets of the standards. So in practice one is more or less forced into the least common denominator: Fortran 90 and only the three basic types (doubles, integers, characters, and arrays of such). And maybe a flat structure from time to time---if you feel brave.It's 2015, and there are modern Fortran compilers that are not yet Fortran 2003 compliant. From what I can tell, there is no such thing as a fully-compliant Fortran 2008 compiler.
Compiler developer has always been an extremely niche job market. Nowadays, Fortran programmer is even more niche than is being a compiler developer, at least per indeed.com: http://www.indeed.com/jobtrends/fortran%2C+compiler.html .cgk said:I agree. Basically, developers have more or less given up on Fortran, and there are very few compiler developers left.
Indeed.What we get in the end is a quite unreliable mass of "stuff", with all compilers supporting different subsets of the standards. So in practice one is more or less forced into the least common denominator: Fortran 90 and only the three basic types (doubles, integers, characters, and arrays of such). And maybe a flat structure from time to time---if you feel brave.
or "linux versus Windows" (although in the latter case, the answer is objectively obvious ;-)).
jedishrfu said:What was the Julia bug? I am curious to know if it finally got addressed. I was researching efforts needed to convert MATLAB to julia for performance.
DaleSpam said:A tool may be both outdated and also still useful.
bcrowell said:Inaccurate line numbers when syntax errors are reported: https://github.com/JuliaLang/julia/issues/1334
Re performance, julia is a JIT compiler. So it has terrible performance on a program that is expected to start up, do something, and then quit, but it may have good performance on something that is expected to run for a long time. There are some tricks for improving performance, such as IIRC not doing anything outside of a function.
jedishrfu said:Okay I see it was due to a macro expansion problem. I'll keep that in mind. Thanks.
I agree completely. My point was just that most of the posts supporting Fortran were arguing that it is still useful (because of backward-compatibility). In my mind that is a completely separate question from whether or not it is outdated.bcrowell said:They still drive cars with tail-fins in Havana, but the reason isn't that those cars are just as good as modern ones.
Fortran survives because of backward-compatibility, not because it's the best tool for the job.
FactChecker said:FORTRAN has some nice features for engineers and scientists that are not found in other languages. Namelist reads and writes are a good example. Computer science majors are usually not familiar with those things. Their first reaction is usually to think they can mimic it in other languages, but they can not.
If you say so. Be careful about flaunting your credentials to impress people that you don't know. I have done things similar to some of FORTRAN's namelist capabilities in interpreted languages that can 'eval' a string of code, but I have never seen anything that comes close in a compiled language. It would take a lot of tedious code to mimic FORTRAN's built-in, easy namelist. And the code would be specific to that one namelist.mgkii said:Lol :-) Oh yes we can. There's nothing unique in FORTRAN that can't be replicated in other languages.
Yours truly: Computer Science Major 25 years ago. One or two languages under belt since then (including FORTRAN of course!)
Ha! Another problem I have with new computers is that they finish a job so fast that I just know it aborted. So I start debugging. It's only after some time that I realize that it really did finish that fast.SteamKing said:That's one of the downsides to having fast computers everywhere now: you can't reasonably take a break from writing, debugging, testing, or running most programs, because they're done before you can turn around.