Why Scientists Are Still Using FORTRAN in 2014
New submitter InfoJunkie777 (1435969) writes "When you go to any place where 'cutting edge' scientific research is going on, strangely the computer language of choice is FORTRAN, the first computer language commonly used, invented in the 1950s. Meaning FORmula TRANslation, no language since has been able to match its speed. But three new contenders are explored here. Your thoughts?"
A: Legacy code.
Scientists work in formulas. Fortran was designed to do things naturally that don't fit into C/C++, Python, whatever.
Why not?
Actually that is a serious question, for these sorts of applications there seems to be no significant downside.
At work in the recent past (2000's) we were still supporting FORTRAN on the SGI machines we had running. The SGI compilers would optimize the hell out of the code and get it all parallized up, ready to eat up all the CPUs.
Newer isn't always better.
Trolling is a art,
1) Modern Fortran is not all uppercase ....
2) Modern Fortran does not have to start on column 7
3) Modern Fortran has dynamic memory allocation
4) Modern Fortran can use the same types as C (maximizes interoperability), hence can be called where C might be called
5) Modern Fortran has an objects, polymorphism, etc.
6) Modern Fortran has (a limited form of) pointers
7) Modern Fortran has concise array/vector/matrix operations
8) Modern Fortran has dynamically allocatable, multidimensional arrays that can be indexed starting with any integer
8) Modern Fortran supports the complex type without higgery-jiggery
9) Modern Fortran doesn't *need *pointers *in *all *the *places *that &C does, pass by reference is the norm
10) Modern Fortran is blazingly fast and designed for sciene
Some folks still write in Fortran 77, and the tired tales of woe that are bound to come from a language specification that is many decades old.
But, that code/style still works, and who am I to judge how you want to get your work done?
When you go to any place where 'cutting edge' scientific research is going on, strangely the computer language of choice is FORTRAN, the first computer language commonly used, invented in the 1950s.
Perhaps it's still the best tool for the job. Why is that strange? Old(er) doesn't necessarily mean obsolete -- and new(er) doesn't necessarily mean better.
It must have been something you assimilated. . . .
It's not a dead language. It still changes with the times. And there's a vast reservoir of code already written in it. Why cast all that away and start from scratch with new languages.
Of course, if you could make the new language recognize the old code and incorporate or interface with the new code then you could do a transition rather than a plain break with the past.
There are languages with worse syntax and clunkier to use -- I'd rather know why people are still willingly using COBOL. "Too lazy/expensive to upgrade legacy infrastructure" isn't a valid reason, it's just a popular and convenient excuse.
No, not just "legacy code." Fortran (yes, that's how it's spelt now, not "FORTRAN") was designed to be highly optimizable. Because of the way Fortran handles such things as aliasing, it's compilers can optimize expressions a lot better than other languages.
B: CUDA adaptations of legacy code.
I have a PhD in engineering, and my dissertation involved writing lots of code. Now I work at a national lab in the US, and I and nearly all of my coworkers work on scientific or engineering codes of some sort. Although there is significant amounts of legacy code that was written in Fortran lying around (a project I work on uses a fortran library written in 1973), very little development is done in that language. It's all C++ or Python.
When will they ruin Fortran, like they are ruining everything else?
When will Fortran lose half its funtionality?
When will Fortran get a touchscreen interface?
When will Fortran do a forced upgrade to continue being supported?
At least Slashdot seems to encourage re-use of commonly used responses when a question is asked.
Have gnu, will travel.
The biggest reason of interest is that it helps non-computer-science scientists write up computational codes, neither having to devote excessive amount of time in memory management, nor deviate from the classic imperative programming model. And, it is also important for a purely non-technical reason: a generation of domain experts in engineering and scientific domains where trained in FORTRAN codes.
... there is a reason :)
As managers of High Performance Computing platforms, we generally take an a-religious approach and deliver to the users all possible permutations of language types that a given community may need. The following is a very common setup, containing both GNU & Intel compilers: https://hpc.uni.lu/users/softw...
btw. I'm not defending Fortran in any kind of way; ask any Fortran-fun, in which language his compilers are written in
After all, it was "For Tran".
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
This. I have many friends in the physics dept and the reason they're doing Fortran at all is that they're basing their own stuff off of existing Fortran stuff.
What amused me about the article was actually the Fortran versions they spoke about. F95? F03? F08? Let's be real: just about every Fortran code I've heard of is still limited to F77 (with some F90 if you're lucky). It just won't work on later versions, and it's deemed not worth porting over, so the entire codebase is stuck on almost 40 years old code.
If the language accomplishes the task efficiently and effectively with no apparent downside then why attempt to switch languages simply for the sake of switching?
Furthermore, an ability to run legacy code should be sustained especially in science where being able to use that code again after many years might save scientists from having to reverse engineer past discoveries.
I've decided to stop wasting my time responding to AC trolls/sockpuppets... so if you want a response from me... login.
Seconded. And the legacy isn't necessarily just the source code. Many of the engineering industries using such codes have a relatively low turnover rate, meaning an older group of engineers and researchers with the most experience stick around for decades. Most of these folks used Fortran since college. It works for them, and they aren't concerned with any "new-fangled" languages that offer more features. Another reason I hear from these folks is that Fortran has powerful array slicing and indexing syntax not found in C, making big data manipulation simpler. Newer programming languages like Python have packages like NumPy which offer similar capabilities, but it's often a nightmare to translate hundreds of thousands of legacy code lines simply to "escape" Fortran. And there are decent bindings to Fortran that can be leveraged for many parallel computing packages (MPI), which means even less incentive to move up.
Newer folks entering the field often work under the tutelage or mentoring of these folks, and Fortran sticks around. Python is gaining usage in the scientific communities, and it's often coupled with mixed-language wrapping code like f2py or SWIG to access any legacy Fortran code for heavy number-crunching work. I've seen this recipe used successfully in parallel computing to detach some of the "administrative" aspects of scientific code into newer languages.
They also use integrals and derivatives which first were used in the 17th century. Oh wait, that's OK! Software is mostly fashion these days.
Fortran is the best at numbers, and not so good at other things (Try downloading a webpage with it, or even bind to Curl without the command prompt). The only language that can approach Fortran's niche is C, which is pretty good at everything, but you have to know a lot of programming tricks to get the same performance with numbers.
Why replace Fortran? I think it's great that a technology is still being used that spans back to vacuum tube machines and that those programmers' skills are not abandoned by industry (i.e. Visual Basic).
A: Legacy code, and because Fortran 2003+ is a very good modern language for scientific computation and maps very naturally to problems. As it turns out, the language semantics (both legacy and modern constructs) make it very good to parallelize. And it runs fast, as in, equalling C++ level of performance is considered a weak showing.
If you haven't seen or used modern Fortran and think it's anything like Fortran 66/77 then you're mistaken. Except for I/O, which still tends to suck.
In addition there are still some seemingly trivial but actually important features which make it better than many alternatives (starting from Fortran 90).
There's some boneheaded clunkers in other languages which Fortran does right: obviously, built-in multi-dimensional arrays, AND, arrays whose indices can start at 0, 1 (or any other value) and of course know their size. Some algorithms are written (on paper) with 0-based indexing and others with 1-based and allowing either one to be expressed naturally lowers chance of bugs.
Another one is that Fortran distinguishes between dynamically allocatable, and pointers/references. The history of C has constrained/brain-damaged people to think that to get the first, you must necessarily take the second. That doesn't happen in Fortran, you have ALLOCATABLE arrays (or other things) for run-time allocation of storage, and if you need a pointer (rarer) you can get that too. And Fortran provides the "TARGET" attribute to indicate that something *may be pointed to/referenced*, and by default this is not allowed. No making pointers/references to things which aren't designed to be referred to multiple times. This also means that the aliasing potential is highly controlled & language semantics constructed to make Fortran able to make very aggressive, and safe, optimization assumptions.
The more parallel you want, the more of these assumptions you need to get fast code, and naturally written Fortran code comes this way out of the box than most other languages.
Legacy code that has been carefully checked to give correct results under a wide range of conditions.
If it ain't broke - don't fix it.
#DeleteChrome
I working in scientific computing and almost all new software is written in c++. Two huge parallel solver libraries petsc and trilinos are c and c++, ditto for many, many other codes. LAPACK is the one fortran code that you might find yourself using. There are legacy codes written in Fortran, but it's always a mistake to start something new in Fortran, particularly if you want your developers to be able to get jobs outside of science (when the funding goes south).
Huge libraries of FORTRAN code have been formally proven. New FORTRAN code can be formally proven. Due the limitations of the language, it is possible to put the code through formal processes to prove the code is correct. In addition, again, as a benefit of those limitations, it is very easy to auto-parallelize FORTRAN code.
"To those who are overly cautious, everything is impossible. "
A: Legacy code.
AKA battle hardened libraries that work as advertised.
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
Not to put too fine a point on the matter, Fortran is still used to bust the n00bs.
It's academia, for God's sake! This is where Doctorae Philosophiae held forth discourse in Latin, as recently as 150 years ago, fully 1600 years after that language fell into conversational extinction.
"Flyin' in just a sweet place,
Never been known to fail..."
Large scale models handling huge arrays, though - like climate or weather modeling - I think that's where Fortran has always been king of the roost.
The whole point is speed. No one's working in Python if they're interested in speed.
#DeleteChrome
This may be especially important if the testing method is ISO acredited. Getting a new test accredited may just not be worth the hassle, so if it ain't broke...
Sorry folks, I've spent a lot of time in HPC environments and I just don't see Fortran being the GOTO language any more. The differences that use to allow Fortran to be better compiled are fading away, the only thing hiding this fact is the bloated uber-templated unintelligible over-abstracted C++ doesn't necessarily compile well. Take a modern compiler, write code that is numeric heavy in Fortran and C -- then actually look at what ends up being created and there isn't a hill of beans difference, most of the instructions are in COMMON. WHILE Fortran used to be easier to compile, that is nearing its END. DO you not think so?
FORTRAN is all about math. Math functions are trivially easy to define because the language was built do deal with math functions.
Also, there is an enormous library of established, proven, dependable libraries for the most important math functions in most industries. LINPACK, LAPACK, etc..
Doing math in C/C++ or whatever other language - you just never know what results you're going to get.
no, used because Fortran is the high level language that produces the fastest code for numeric computation, it is by far the most optimizable. Yes, it blows away C.
Precision is important in scientific discourse. Latin isn't a language with creeping grammar and jargon. It's sorta what Esperanto only wished it could ever be.
haha, maybe you better look at what language huge parts of the cores of your petc and trillinos are written in. hint, starts with an F
A: Legacy code.
Most people who learned FORTRAN did so in a class intended to teach FORTRAN.
Most people these days aren't learning FORTRAN, they're learning other languages, and they're doing them in a context that teaches them about apply the tool, rather than making them really, really good with the tool itself.
To use an analogy, it's the difference between learning how to use all the tools in the wood shop before being sent in to make a chair (learn the tools) vs. being taught all about "chairness", and then being sent in to make a chair, without a great knowledge of the tools themselves. Someone is going to lose a finger, in the second case.
So it might be "legacy", but the legacy they want is the teaching methods which were in use when most of the FORTRAN programmers came into existence in the first place.
I saw this link bait the other day...
We're NOT using Fortran anymore...
Many of us at the National Labs do modern, object-oriented C/C++... Like the project I'm in charge of: http://www.mooseframework.org/
There are whole labs that have completely expunged Fortran in favor of C++... Like Sandia (http://trilinos.sandia.gov) who actually went through a period in the late 90s and early 2000s where they systematically replaced all of their largest Fortan computational science codes with C++.
Those places that don't use C++ use C like the awesome PETSc library from Argonne ( http://www.mcs.anl.gov/petsc/ ) which actually employs an object-oriented scheme in C.
The big name modern codes that are getting run on the biggest machines are generally done in C and C++.
I don't see that situation changing anytime soon as there is simply a massive amount of C and C++ libraries that will continue to provide the engine for tomorrows codes. The trend i see happening most often is utilizing C and C++ libraries with Python glue for everything doesn't need raw speed.... I think that trend will continue.
Today someone told me about how he once wasn't allowed to disturb a printer - because someone was using it to run a job doing an FFT written in Postscript. Apparently the large amount of memory available in the printer was paramount.
Forget Fortran, I want to know why anybody in their right mind is still using the obtuse juggernaut mongrel of a language known as C++ in 2014. (Even with the 11 and 14 versions don't make things any better, they only wallpaper over obtuse features with other obtuse features... very few people alive truly know all the weird quirks of C++ inside and out.)
Latin was the one language that all academics shared. To them, it was a convenience. The dominance of English in international communication is a very recent phenomenon...
I am sticking with Visual Basic 6
A big problem is that C and C++ don't have real multidimensional arrays. There are arrays of arrays, and fixed-sized multidimensional arrays, but not general multidimensional arrays.
FORTRAN was designed from the beginning to support multidimensional arrays efficiently. They can be declared, passed to subroutines, and iterated over efficiently along any axis. The compilers know a lot about the properties of arrays, allowing efficient vectorization, parallization, and subscript optimization.
C people do not get this. There have been a few attempts to bolt multidimensional arrays as parameters or local variables onto C, (mostly in C99) but they were incompatible with C++, Microsoft refused to implement them, and they're deprecated in the latest revision of C.
Go isn't any better. I spent some time trying to convince the Go crowd to support multdimensional arrays properly. But the idea got talked to death and lost under a pile of little-used nice features.
The headline is not a question but a statement. The explanation is in TFS where it says, "no language since has been able to match its speed."
The business world is still using COBOL. Sometimes you do get it right the first time...
It was VERY easy to learn, loaded with libraries out the wazoo for just about anything imagineable in the sciences, & very strongly reminded me of BASIC (from what I recall of it).
* I didn't mind using it @ all...
APK
P.S.=> I never once used it professionally on the job though (though I had just about everything else language-wise I'd learned, which is around a dozen or so over time)... apk
Because it works and it is good enough. FORTRAN is not a good language for "scientific research".
Don't need fortran due to Petc? Take a look at how it is installed: ./configure --with-cc=gcc --with-fc=gfortran --download-f-blas-lapack --download-mpich
http://www.mcs.anl.gov/petsc/documentation/installation.html
Especially note the:
Is that enough to tell you that the Petc libraries contain fortran?
APL-style languages should be even more optimizable, since they use higher-order array operators that make the control flow and data flow highly explicit without the need to recover information from loopy code using auto-vectorizers, and easily yield parallel code. By this logic, in our era of cheap vector/GPU hardware, APL-family languages should be even more popular than Fortran!
Ezekiel 23:20
Also "legacy training". Student learns from prof. Student becomes prof. Cycle repeats.
Also Fortran didn't stagnate in the 60s, it's been evolving over time.
Other languages are highly optimizable too. However most of the new and "cool" languages I've seen in the last ten years are all basic scripting languages, great for the web or It work but awful for doing lots of work in a short period of time. It's no mystery why Fortran, C/C++, and Ada are still surviving in areas where no just-in-time wannabe will flourish.
That may be but most of the code I saw written was Fortran77 although some was Fortran 95. Some of the code was mocked in python first, but there was a HUGE performance difference so all the actual research code was fortran.
They both generate machine code. But they get there in different ways and produce very different output. It would be more correct to say FORTRAN (compilers) blows away any C compilers. (esp. gcc)
F77+extensions, usually DEC extensions. Very very few people ever used strict F77 with no extensions.
Some of the issues this causes are irritating bordering on unnerving. This we we discovered that g77 didn't care for treating INTEGER as LOGICAL. Used to be that there was no other way to specify bit operations, now it is precluded. Everybody's code has that, and there's really nothing intrinsically wrong or difficult to understand about it, but it was technically non-standard (although everyone's extensions permitted it) and it won't work on g77 - maybe only with the infamous -fugly flag.
I am OP: Sorry I had it down as all caps.
Don't explain computers to laymen. Simpler to explain sex to a virgin. -- Robert A. Heinlein
Yeah, I used to hear that argument a lot in 1978...
you are spouting off about a field in which you do not work, against a well-known fact.
Doing the quite common operations of numeric analysis, machine output of the C compiler will be worse, less optimized, slower than that of Fortran.
Yes there is a legacy to FORTRAN.
I had my first introduction to FORTRAN, FORTRAN 77, in the Fall Quarter 1978. HOT ! And it was taught in a class from the Electrical Engineering Department ! A Computer Science "Department" came along soon enough in 1980 but the quality and rigor were not there.
Psst.
When I write Bourne shell scripts to do arithmetic and trend surfaces in ANOVA and geophysical inverse, the base functions are FORTRAN 77.
Ha ha
OP here. This is what the article said. Compilers are the key. They have been around a long time. Another key is that commercial compilers (like Intel for example) further increase the speed, as the manufacturers know how to optomize the code for the specific CPU at hand.
Don't explain computers to laymen. Simpler to explain sex to a virgin. -- Robert A. Heinlein
When will they ruin Fortran, like they are ruining everything else?
The did, f2c. :-)
Well, we live in a somewhat different world today, given that suitable HW for that is virtually everywhere. But just to be clear, I'm not suggesting anyone should adopt APL's "syntax". It's more about the array language design principles. Syntax-wise, I'd personally like something along the lines of Nile, with math operators where suitable, and with some type inference and general "in-language intelligence" thrown into the mix to make it concise. I realize that depriving people of their beloved imperative loops might seem cruel, but designing the language in a way that would make obvious coding styles easily executed on vector machines seems a bit saner to me than allowing people to write random loops and then either hope that the vectorizer will sort it out (they're still very finicky about their input) or provide people with examples what they should and shouldn't be writing if they want it to run fast.
Ezekiel 23:20
This. I have many friends in the physics dept and the reason they're doing Fortran at all is that they're basing their own stuff off of existing Fortran stuff.
The types of people who haven't head about collaborative development or, dare I say, version control.
I've been there. You end up with a zillion diverging (and never merging) forks, people reinventing various wheels over and over, and of course adding their own bugs.
This is a terribly unproductive and sad way of developing code. Unfortunately most scientists I know (knew) don't give a crap because they are _completely_ oblivious to what they are missing out on.
...because tying your code to a single HW platform is such a great idea.
Ezekiel 23:20
> it's[sic] compilers can optimize expressions a lot better than other languages.
No. Wrong. C has had similar aliasing rules for a very long time. It's only recently that they got turned on in GCC by default. This is what all the -f(no-)strict-aliasing nonsense is all about. The problem is, people know that once, before C89, Fortran was faster. So of course it's still faster. Why would anyone ever modify C to be faster? That's just dumb.
Also Blitz++ uses template metaprogramming and a DSL (that looks just like normal c-vector math) to optimize BLAS far beyond what fortran can do. A fairly minor example is rewriting the expression tree for (A+B)[2] to (A[2]+B[2]) at compile time.
People using existing Fortran code are interested in the RESULTS of the computation, not whether the code is modern or has the latest bells and whistles. Programmers forget that the ultimate goal is for someone to USE the program. I wrote a program in CDC Fortran 77 in 1978 that's still being used, Why? Because it does the job.
Since you're mentioning Intel....doesn't Intel Fortran and Intel C++ share the same optimizer and the same code generator? I wonder what the *real* performance difference would be between those two. Latest Fortran revisions give you some extra array intrinsic operations, but C++ gives you SIMD intrinsics for tuning in some added boost in critical spots. Sounds like a draw to me.
Ezekiel 23:20
The only reason no language since matches its speed is because all of the focus on optimization in modern languages is to increase speed while still focusing on producing correct output from whatever inputs are given, while Fortran optimization does not concern itself with the latter. In practice, this is only an issue when pointers to different types of objects could possibly have overlapping content... Fortran compilers would not necessarily produce the correct output from a given input when this is the case.
Disabling the requirement for correctness, the output of a modern C or C++ compiler with appropriate optimizations can very easily match the speed of what is produced by any Fortran compiler.
File under 'M' for 'Manic ranting'
My thought at reading the summary was "Do older languages have some sort of expiration date I don't know about?"
That is because you aren't a hipster or fad brogrammer. These idiots probably expect them to be using Node.js or some such bullshit.
In some cases, the client side is language-limited, and everything has to be translated to one language before it can be deployed. In the case of iPhone OS (now iOS) during the second quarter of 2010, this was Objective-C++. In the case of Windows Phone 7 apps and Xbox Live Indie Games, this is the subset of verifiably type-safe CIL accepted by the .NET Compact Framework (which in practice means C#). In the case of web applications, this is JavaScript. In order to ensure that the client-side prevalidation in your web application has provably the same behavior as the validation in the server side, they need to be written in the same language in the same source code files. If your client is in JavaScript, having a server also in JavaScript will let you write the application logic once and not repeat yourself. Hence Node.js.
A: Legacy code, and because Fortran 2003+ is a very good modern language for scientific computation and maps very naturally to problems
See.... Fortran 2003 is more modern than ISO 1999 C.... Now that that's settled... How come people are still programming in languages like C/C++/Java, when Fortran2003 is available?
For years and years and years the Gnu G95 compiler was only a partial implementation of the language. This made it impossible to use without buying a complier from intel or absoft or some other vendor. It chokes the life out of it for casual use.
Personallyt I really like a combination of F77 and python. Whats cool a bout it is that F77 compiles so damn fast that you can have python spit out optimized F77 for your specific case sizes. Then for the human interface and dynamic memory allocation and glue to other libraries you can use python.
Some drink at the fountain of knowledge. Others just gargle.
This, plus:
1) C/C++ isn't viable for a scientist to just 'pick up' and be productive with, short of a massive loss in productivity.
2) A lot of the people I've worked with in this field (CSIRO and Geoscience Australia, personally) literally grew up with Fortran (they're in their late 40s to early 50s, they've been in the industry for decades, Fortran works, Fortran is what they were taught, Fortran is what they use).
3) IDL/etc are commercial (node based licensing), you might think "you've got money to burn, just do it!" until you realise we run these algorithms literally on hundreds to tens of thousands of nodes concurrently. Not everyone can afford half a million dollars on top of what's already hitting close to 1m on storage/compute costs. (ammendum: No, GDL isn't applicable to a lot of fields, it's lacking a lot of modules/libraries or non-conformant even in the core)
4) The next set of serious contenders (which is something we actually use, in production environments) is Python w/ NumExpr or Cython or some other set of optimization frameworks that we can use to make our numpy/scipy - but you get back to point #1 - scientists (who aren't great programmers) + dynamic language w/ poor lint tools and no 'compile' time validity analysis = headaches.
All of that said and done, there's a bit of a shift in the industry (or at least in GIS/geophysical analysis/remote sensing) where people are recognizing the science/math, and the implementation are equally important, and require separate skill sets - most modern projects now days don't have scientists writing production code, they've got real developers taking the math or prototype Fortran/etc implementations and porting them to codebases that are more maintainable by their larger development resources (and not those few scientists who still know Fortran).
The reason this is true is that Fortran compiler output, when appropriate optimizations are turned on, is not actually concerned with producing correct output... and although it is certainly faster, the resulting code will be less robust than code output by a modern most modern C compilers. Modern compilers generally focus on producing correct output at all times, and may make compromises in efficiency for correctness.
The main differences involve pointer aliasing... and a C or C++ compiler with the appropriate optimizations switches to ignore pointer aliasing possibilities, as Fortran does, will produce code that is just as fast as that which a Fortran compiler can produce.
File under 'M' for 'Manic ranting'
Back when I was in school, the consensus seemed to be that C was "about as fast" as FORTRAN. And when FORTRAN was really faster you could just write most of your code in C and link to FORTRAN libs. BLAS, LAPACK, etc. Just had to store your arrays in column-major order. If you look at the benchmarks at the Julia site, linked in the article, you'll see that FORTRAN beats C by a large margin in one benchmark, loses by a large margin in another benchmark, and is slightly faster in all the others. They state that they used gcc 4.8.1 as their C compiler but don't mention what compiler they used for FORTRAN. Also gcc 4.8.1? Kinda matters.
When I was in college (1968-72) the big contest was between FORTRAN and ALGOL. ALGOL was supposed to be more logical, readable and humane, but it certainly was more verbose, and FORTRAN won out with its brutal efficiency, telling the machine what to do, in the minimum possible number of characters. I remember being particularly fond of the Arithmetic IF (a legacy feature even then): IF (X/Y*Z) 100,300,50, which would go to statements 100, 300 or 50, depending on whether (X/Y*Z) was negative, zero or positive. I haven't written a FORTRAN program in decades, but I'm still saddened to hear that feature is now obsolete. (http://stackoverflow.com/questions/10758935/fortran-compiler-warning-obsolete-arithmetic-if-statement)
I would also hazard a guess that Fortran tends to be a tad easier to read than C... Especially for scientists...
Blitz++ is hardly the pinnacle of what should be possible with proper array languages. Think of what you could do with higher-order operators - for example, interprocedural loop fusion becomes trivial, and one could probably come up with many other operations optimizable accross procedure/function/subroutine (whatever you want to call it) boundaries as well. Blitz++ was neat but it can't beat a dedicated compiler for an array language (by which I most certainly don't mean stateful loopy Fortran). Although I agree that the C++/C interoperability is a huge plus.
Ezekiel 23:20
The three "contenders" are currently only so in the minds of the CS people that're fans of the languages and don't "get" the above concepts.
Of the three, the one with the most potential is Haskell. It can compile to reasonable speeds compared to C/C++, but gets beat for most expressions in Fortran by a factor of 2-3 times faster. Will it replace Fortran? Not likely. Not until it can match Fortran's speed and can convince people to port their stuff over because of the expressiveness available with Haskell. As it stands...Haskell's a distant possible in the space.
The others? Heh...don't make me laugh. Still wondering what crack the article author was smoking to think that Clojure and Julia are replacements for Fortran. Not even close.
Latin is less ambiguous than English, which is why we still use it in science today (pay attention to medicine and pharmacology). You are ignorant about both Fortan and Latin, but you just had to spout off anyway.
Or you are explaining the use of a well defined library in a peer reviewed journal. Using a new untested library would be suspect.
love is just extroverted narcissism
Since you're mentioning Intel....doesn't Intel Fortran and Intel C++ share the same optimizer and the same code generator? I wonder what the *real* performance difference would be between those two. Latest Fortran revisions give you some extra array intrinsic operations, but C++ gives you SIMD intrinsics for tuning in some added boost in critical spots. Sounds like a draw to me.
You very well could be right K.S. I am not a programmer. Wanted to be. Too late to start I think. I was just going by what was in the article. I had hoped others would comment on the the "3 modern condenters" but the bulk of comments are in line with the article: "it just works and it is fast and has HUGE libraries and legacy code." From what I could follow Julie seemed the most interesting, but the bugs not out of it yet.
Don't explain computers to laymen. Simpler to explain sex to a virgin. -- Robert A. Heinlein
It's not just that it was the only language shared, it was that the language is capable of precision other languages lack. Doctors still use Latin for just this reason.
This is absolutely right. It's also easier to write, in many cases. Most scientific applications don't need things like lambda expressions or derived classes. Many people who write applications as tools in their research don't want to spend time learning esoteric aspects of languages.
First you have to convince people they want to use a language, regardless of how good it is for anything, any new language will have to compete with the existing code base and programmers' (reasonable) reluctance to learn new things.
Part of why fortran is so easily optimizable is because of all the practice that people have optimizing it, and man-centuries spent developing it.
Please... it's spelt "c" now.
Dark Reflection
From the still clever, still humourous, and still applicable 1983 Letter to the Editor in Datamation Real Programmers Don't Use Pascal. Just replace "Pascal" with your language of choice. Enjoy.
Oh like BLAS?
When will people learn that BLAS is an API, and OpenBLAS and MKL or whatever you find isn't actually written in Fortran. It's C and assembly for the most part.
Also, I haven't seen any sparse solvers written in Fortran ever (there might be one, but they are not the ones I'm using).
Just like writing something complex like, say, ParMETIS or Netgen, in Fortran wouldn't be something you wished upon your worst enemy.
The stuff you find at NETLIB is a reference implementation. It's meant to be easy to read, not to be actually USED in serious applications. Sheesh.
No, you are wrong by being terribly incomplete. People who use Fortran (or any language for that matter) are interested in getting the correct answer, in the fastest reasonable time, with the shortest amount of developer work (and perhaps cost matters). In the scientific domain, Fortran remains competitive. The precise cost function that balances these considerations depends on many variables and is precisely why we have so many languages today.
blah blah... allowing people to write random loops and then...blah blah
This comment is either an ad hominem or completely ignorant. It's math, and there are no random loops. Loops are intentionally designed and required, or perhaps you missed out on several years of Calculus and Linear Algebra.
The reason Fortran is still around is that it's exceptional for math. Both ease of writing code to solve equations and it's precision when code is run.
Sure, Pascal had some advantage in certain expressions. Pascal was also horrible for I/O so great if you never wanted to do anything but solve an equation in memory. C is easier for some things too, but not when the equations get massive or require repetition.
Blabbing on and on about vector based GPUs is idiocy, because not everything uses trig where vector based processing is beneficial. I have no confidence you have ever seen math intensive code based on what you are talking about. Nile from their own page is # The Nile Programming Language ## Declarative Stream Processing for Media Applications and NOT a language for Math.
I think it's quite simple: climate scientists will be using Fortran for the next hundred years, because that's what dozens of humongously complex climate models have been written in, and these people will absolutely need to perform meta-studies and aggregate studies comparing dozens of independent models, including comparisons of their newest models to all the models that have been devised from 1970s or so until the point of their current research. This is, after all, where IPCC gets their "best predictions/worst predictions" charts. So even if many people were willing to switch to something else (those with smaller codebases, independent scientific programmers and engineers etc.), there will still be huge bodies of code that will absolutely need to stay untouched to support reproducible research in the future at least in some very important scientific fields.
Ezekiel 23:20
Missing out on what, the wonders and simplicity of using git? (/sarcasm)
Many Fortran programmers are academics, and academics are often times (not always) concerned with one-off programs that demonstrate a computer-based solution to a novel phenomenon. Often times, the investigator works alone. Once that is done, sometimes the code is never visited again. In these cases, anything more than VMS-style versioning is total overkill.
I agree that version control is important and often ignored. But this is not specific to Fortran -- but rather that the fact that version control adds overhead both in using and learning -- and academics are often putting all of their efforts into the science.
APL-family languages should be even more popular than Fortran!
Probably would be if it wasn't a write only language.
When our name is on the back of your car, we're behind you all the way!
Why program in Perl if Python is here, or Ruby, or Shell scripts, or Java, or hell even Cobol. Every language has a purpose and feature set, which was designed to make something easy. I would not write a pop-up window in Fortran any more than I would try and write a physics equation in TCL. The languages are not designed or suited for the same thing. This is not some hard to get concept, it's basic fucking history.
...and i would like to see statistics on how many git branches are created, yet never merged back in.
Please... spelt is a grain.
When our name is on the back of your car, we're behind you all the way!
Doing the quite common operations of numeric analysis, machine output of the C compiler will be worse, less optimized, slower than that of Fortran.
Badly written Fortran will run faster than badly written C. Since most scientists are poor coders, it makes sense for them to use Fortran when optimization is important. Someone that understands how compilers work, and understands issues like pointer aliasing (and how to avoid it), can write equally fast code in either language.
You don't know what you're talking about.
Blabbing on and on about vector based GPUs is idiocy, because not everything uses trig where vector based processing is beneficial. I have no confidence you have ever seen math intensive code based on what you are talking about. Nile from their own page is # The Nile Programming Language ## Declarative Stream Processing for Media Applications and NOT a language for Math.
I find this view quite amusing, given that the whole scope of the VPRI project (of which Nile has been of the intermediate results) is to reduce everything in common personal computing into mathematics. And Nile in particular was designed precisely and explicitly to allow the VPRI people to express as wide an array of graphical operations using as short a high-level description as possible - a mathematical description, in equational form, to allow them to express the majority of Cairo (or any other Cairo-like 2D library) in a few hundred lines of these equations. Furthermore, nowhere have I made the claim that the semantics of Nile in its current form is a perfect replacement for any language for scientific computation, as opposed to the thought that there could be some lessons to be learned.
And why don't you log in? There seem to be quite a few anonymous psychotic individuals running around here recently. It makes the conversation feel quite disingenuous.
Ezekiel 23:20
You may not like Fortran's I/O, but for the subject matter (tables of numbers), IMPLIED DO loops work a lot nicer than repeated printf() calls in `c`. Contrary to n00b whining, FORMAT statements can be your friend.
Of course Fortran is horrible with strings, mostly because it is older than strings!
Latin was the one language that all academics shared.
...you mean, those who didn't speak Hebrew, Greek, or Arabic?
Ezekiel 23:20
Most people learned Fortran in a class intended to teach scientific programming. I have never, ever, ever seen a course catalog that lists CS 201 FORTRAN PROGRAMMING. It has always been about getting the scientific result -- it just so happens that Fortran has been pretty good at it and actually pretty simple -- and so it has often times been used.
That being said, C almost killed Fortran (77) because they waited so damned long to bring out Fortran 90. People were sick and tired of waiting for dynamic memory allocation and free form input, and so many people who were past entry-level programming started jumping to C (...which I would never relish to teach to a beginner who has no solid interest in computer programming).
Several years ago (in 1992) I was involved in the rewrite of a large fortran program, which had been around for decades and had become unmaintainable and slow. The physicists who had been working with the program were absolutely convinced that no software could replace fortran for speed. I did not believe that. Operating systems at the time were written in C, and the only thing that beats C for speed is assembly. I made several tests with bare scientific calculations, using fortran, C, and C++, and fortran came up (surprise surprise!) the slowest. Then, the physicists rewrote the fortran application in C++, with some help from me with the object-oriented design. Not only the replacement program was faster, more maintainable, and easier to read. But we found out that the main problem of the program (written in times where RAM was scarce and never updated) used files instead of in-memory arrays or any more modern data structure, or a database, which would be the first choice nowadays. The application was slow because it was designed with constraints that were not realistic anymore. In the end, the replacement program was slightly faster in the number crunching, but immensely faster in the data handling. While the original program required one day or more of very expensive supercomputer time to complete its work, the new program ran in just a few hours. The sad truth is that, even now, many fortran programs are fossils of an era where hardware constraints made the choice of data structure and algorithm, and they were never reviewed.
> Fortran (yes, that's how it's spelt now, not "FORTRAN")
Pedantic much?
"Capable of precision other languages lack"? There's nothing to support that claim in modern linguistics. If Latin has an upper hand, for example in medicine, it's because most, if not all of the terminology was developed in that language, but nothing prevents you from saying "medulla oblongata" in English with zero loss in meaning. If doctors still use Latin today, it's because writing the remaining 20% of non-teminology in a medical text in the same language that the terminology is written in makes it international, not because it magically gets some "extra precision". (Do purely Latin longer texts get still published in medical journals anyway?)
Ezekiel 23:20
Also "legacy training". Student learns from prof. Student becomes prof. Cycle repeats.
Not really - even when I was a student we ditched F77 whenever we possibly could and used C or C++. The issue is more legacy programmers. Often the person in charge of a project is a older person who knows FORTRAN and does not want to spend the time to learn a new language like C (or even C++!). Hence they fall back into something more comfortable.
However by now even this is not the case. The software in particle physics is almost exclusively C++ and/or Python. The only things that I am aware of which are still FORTRAN are some Monte-Carlo event generators which are written by theorists. My guess is that as experimentalists even older colleagues have to learn C++ and Python to use and program modern hardware. Theorists can get by using any language they want and so are slower to change. Certainly it has probably been at least 15 years since I wrote any FORTRAN myself and even then what I wrote was the code needed to test the F77 interface to a rapid C I/O framework for events which was ~1-200 times faster than the F77 code it replaced.
I think the problem is the keyboard. They don't make 'em anymore.
"First they came for the slanderers and i said nothing."
However most of the new and "cool" languages I've seen in the last ten years are all basic scripting languages
True point.
"First they came for the slanderers and i said nothing."
Same sig since 2003....
Favorite
Why is most analysis software Fortran based, if C/C++ is so much more accurate? Hint, it's not. Linear and non-linear analysis applications use Fortran and Fortran libraries not just because they are faster, but because they are more accurate.
With this comment and everything else you wrote in the thread, you are simply wrong and speaking from complete ignorance.
Actually, you can get one for mere $35! ;) But no, the surface syntax is definitely something I didn't have in mind.
Ezekiel 23:20
Perhaps it's still the best tool for the job. Why is that strange?
It's not strange it's just wrong. Particle physics does not use FORTRAN except in very limited places usually associated with theorists who have not yet migrated to C++ which is a small and diminishing number. As far as I am aware the astrophysicists down the hall from us don't seem to use it much either and the experimental condensed matter guys don't either as far as I am aware. So either things like physics research in general is not cutting edge or the OP doesn't know what s/he is talking about.
Naturally, since Slashdot also encourages re-use articles!
Fortran is still in use in heavy industry.
When I did my internship, I worked for a company involved in heavy industry and despite the language du jour devotion of the business people, the industrial part still relied heavily on Fortran. It's more cost effective to train new people to maintain the Fortran than it is to re-write and debug mammoth Fortran programs that still work just fine.
LK
"Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
Check out the 2008 version. OO and support for parallel processing. Why use anything else?
putting the 'B' in LGBTQ+
Scientists prefer:
1.1 + 1.1 = 2.2
instead of
1.1 + 1.1 = 2.19999999999999999999999999999999999999999999999999999999999999999999999
Then don't compile FORTRAN on an Intel Pentium...
Being in the industry, I can safely say C and Fortran codebases tend to be equivalent in speed, Fortan can do some implicit optimizations C can't, but you rarely hit those cases if both codebases are well written - this is assuming comparing gcc to gfortran or icc to ifort with identical flags (-O3/4 etc, eg: apples to apples).
Newer Fortran dialects 'can' get implicit parallel optimizations, for sure - but you're not longer comparing apples to apples there, you're comparing single core C to multi-core Fortran - and that's nothing a bit of OpenMP can't fix.
At the assembler level (on x86_64) - we find near optimal register allocation and code generation from both langauges. So you're either doing something very wrong w/ C, or you're full of it.
(note: my industry = remote sensing, working on - in the smallest case, images w/ 60+ channels of 16 or 32bit data at resolutions around 19,000^2 - yes, 60GB images are about as small as we get - although you tend to work on individual channels at a time, so you're often only dealing with a few hundred MB at a time if you're not in a part of the algorithm you can segment/tile)
Student learns from prof. Student becomes prof. Cycle repeats.
I've actually seen the exact opposite most of the time. Students, and a lot of people, find it easier to write new code than to read old code, especially if they have some language preference. So a lot of students come in thinking they will rewrite the code in a new language. This is usually at least fruitful because it makes sure they know the internals of the code assuming they get anywhere with it. But at some point, they either realize their code is slower, or they didn't realize how much effort it is to rewrite something, or that they over-extended it into a redesign that fails, or they have trouble getting other people to change to something unproven. Sometimes it does actually go through, and you get something better, faster or easier to maintain. But most of the times you end up with a bunch of students each with their own partial rewrite of something that still works solidly in the first place.
Because its the right fucking tool for the job.
Why instead? Why not add other languages to the distros as well as FORTRAN? What is wrong with leaving the f77 standard alone if you don't use it? That's what I want to know
The purpose of existence is to make money.
Calling all ac's psychotic. Ok. Care to show us your license to practice psychiatric sciences with a degree in them plus years of professional practice along with a formal examination of said ac's given in a professional psychiatric environment? Oh, you don't have ANY of that?? Figures. See subject-line and quit trying to play "the SiDeWaLk-ShRinK of /." since it's about as convincing as your trying to play programmer.
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
I disagree. There are several "irregular" English verbs that have become regular but the irrgular use is not incorrect (burnt works as well as burned, dreamt instead of dreamed, etc.).
Cheers,
Dave
They that can give up essential liberty to obtain a little temporary safety deserve neither safety nor liberty.
Ben
My previous supervisor decided to fork our Fortran code for performing quantum mechanical calculations. We'd worked on it for more than half a decade and it was world-class.
.xml .xml), and it only compiles after a lot of work
... and I feel the same way about CS graduates and Fortran. They have no idea about the physics or maths involved (which is the difficult part), so the do the only thing they know which is to 'modernize' everything, making it into an incomprehensible, ungodly mess.
He handed it over to a computer science graduate (i.e. a non-physicist) who really liked all the modern trends in CS. Now, five years later:
1. the tarball is an order of magnitude larger
2. the input files are now all impenetrable
3. the code requires access to the outside (not possible on many superclusters)
4. he re-indented everything for no apparent reason
5. the variable names were changed, made into combined types and are much longer
6. as a result, the code is basically unreadable and nearly impossible to compare to the original formulae
7. code is duplicated all over the place
8. it now depends on unnecessary libraries (like the ones required to parse
9. it's about four times slower and crashes randomly
10. it generates wrong results in basic cases
To quote Linus Torvalds: "I've come to the conclusion that any programmer that would prefer the project to be in C++ over C is likely a programmer that I really *would* prefer to piss off, so that he doesn't come and screw up any project I'm involved with."
Fortran, apart from being a brilliant language for numerical math, has the added benefit of keeping CS graduates at bay. I'd rather have a physicist who can't program, than a CS type who can.
(Apologies to any mathematically competent computer scientists out there)
Fortran is 40% QBasic and 60% OMFG ALL CAPS. Ideal for folks who are fundamentally ignorant of software development. You think I jest... SUBROUTINE SUB1(X,DUMSUB) INTEGER N, X EXTERNAL DUMSUB COMMON /GLOBALS/ N
IF(X .LT. N)THEN
X = X + 1
PRINT *, 'x = ', X
CALL DUMSUB(X,DUMSUB)
END IF
END
Speed claims are B.S. all it has going for it is efficient array access and that's questionable these days.
C Anthony "Tony" Hoare: "I don't know what the programming language of the year 2000 will look like, but I know it will be called FORTRAN."
He was conservative on the date.
Cheers,
Dave
They that can give up essential liberty to obtain a little temporary safety deserve neither safety nor liberty.
Ben
Systemd
I have never, ever, ever seen a course catalog that lists CS 201 FORTRAN PROGRAMMING.
I guess it's "bear in the woods" time...
That is because you are a kid who learned after 1986 in the U.S., after they changed the accreditation standards, and caused the next crop of CS graduates to not have learned programming languages specifically (i.e. caused then to learn their tools, as opposed to "learn the tools on your own and apply them to a problem domain"). That change is one of the reasons it's frequently more useful to hire people graduating from European Universities than U.S. Universities, and why we need so many H1-B visas for those folks: U.S. Students know theory, but can't code, because they don't know how to use their tools, unless they come out of a college or university that offers non-acreddited language courses on top of the rest of the curriculum - e.g. Rice University, Brown University, and so on, or they otherwise mastered (not just learned) them on their own.
https://archive.org/details/co...
Illinois State University course catalog, 1982 - Pg 53 - Applied Computer Science Courses
164 INTRODUCTION TO FORTRAN PROGRAMMING
169 INFORMATION PROCESSING USING PL/1
265 JOB CONTROL LANGUAGE
272 COBOL AS A SECOND LANGUAGE
274 PL/1 AS A SECOND LANGUAGE
283 ASSEMBLER LANGUAGE PROGRAMMING
288 ADVANCED ASSEMBLER LANGUAGE PROGRAMMING
CS Used to be taught very differently than it is today. Today, ABET Accreditation requires that you implement "Outcome Based Courses", which means that it's really not about coding any more, it's about documenting a process, and then documenting that you followed that process. See also:
ABET - Criteria for Accrediting Computing Programs, 2012 - 2013
http://www.abet.org/DisplayTem...
Anyone worth hiring today that graduated with a U.S. CS degree in the last two and a half decades graduated from one of a handful of universities with "Extra requirements" that include actually learning specific computer languages, or included self-directed programs, where one of the options was learning one or more specific computer languages. Or they have been involved in one or more large Open Source projects where participation required that they learn one or more specific computer languages, and that they actually participated more than tangentially in the project.
I've seen many outstanding U.S. candidates, as an interviewer, and either they graduated before 1986-1988, OR they went to one of those universities, OR they participated heavily in an Open Source project. Very few not in one (or more) of those buckets were what I would call "top tier candidates".
Example: I pick a random POSIX-2001 function (let's not worry about all the large file cruft and other APIs that came about because some OS vendors were to lazy to implement per-thread working directories or credentials; we'll make it easy). Can you describe it's parameters and return values without looking at the man page? OK, that might not be entirely fair; random might get me something like "poll", with structure inputs, etc. -- how about if I picked 8 of them; could you describe the parameters and outputs of at least 8 of them?
I think the answer for most people on that question will be "no" - because they don't know the libraries in the UNIX Programming Environment, which are one of their most important tools. These are the people most likely to implement their own version of strncmp(3) because they don't realize that there's an existing function that solves the problem. They are the people who aren't going to realize that asprintf(3) allocated memory which they are responsible for freeing later, intil the memory leak in their code bites them in the butt.
If you want to say "But I don't program a UNIX system, I program Windows!", I invite you to explain CoCreateFreeThreadedMarshaler(
the whole scope of the VPRI project (of which Nile has been of the intermediate results) is to reduce everything in common personal computing into mathematics.
Bwahahahahahahahahaha.
"I don't know, therefore Aliens" Wafflebox1
Geebus, FORTRAN is a great language well suited for a specific job. Just deal with it and practice your FORTRAN programming.
Wow, faster AND more accurate. They must use some mystical floating-point instructions that only Fortran compiler writers know about.
A: Legacy code.
B: It is good enough for the purpose.
A lot of the features that general progrmmers regard as essential parts of any program, are simply unecessary distrations. I remember one course in "Chemistry for Physicists" - all about calculating molecular orbitals - where the central data processing tool was a FORTRAN program (this was before they invented lower-case, apparently). You started the program. You input data in CSV format. You input an empty line. You got the results back. No prompts, no explanatory textx, no error messages if one of the lines contained an typo. FORTRAN was designed for the sort of mindset that finds this kind of interface desirable. Strings were originally only allowed as constants in FORMAT statements used for output.
Most people want I/O in their language.
Do these scientists develop friendly graphical user interfaces for their Fortran programs?
Do these programs have robust and secure handling of all input?
How about configuration: are there dialogs for setting up preferences, which are persisted somewhere?
Do they package up user-friendly installers?
How much of their stuff runs on new platforms like tablets and smartphones?
What non-Fortran-stuff do these programs integrate with? Anything over a network?
Where can I download a scientific Fortran program to evaluate its quality?
Has anyone written a viable program of the following in any dialect of Fortran, new or old?
- operating system kernel
- device driver
- web browser
- web server
- instant messenger
- audio/video telephony client
- etc
Scientists use Fortran because it's fast and well suited to numerical computing.
Haskell and Clojure are bloated, slow, and have lousy numerical support.
Julia is a good try, but it's at best experimental at this point.
The big thing Fortran has over C is proper support for multidimensional arrays, with powerful slicing operations built into the language. It was the inspiration for numpy arrays. My first languages were C++ and C, but when I do scientific programming, my languages of choice are now python and fortran (with f2py making it very easy to glue them together). Fortran is horrible at text processing, and has an almost absent standard library, but for scientific use, good arrays make up for that - especially when you can use python in the non-performance-critical parts.
C++ has some multidimensional array classes, but none of them are as convenient as fortran arrays. Especially when it comes to slicing. At least that's how it was the last time I checked.
None of that is good programming, is the thing.
I really wish people would stop blaming the tools when the problem is people who are tools. Maybe that's endemic to "CS types"? But those of use who code for a living in the real world recognize what you describe as a noob stunt, not a language problem.
The main reason stuff stays in fortran is the general best practice of not messing with working shipped code. If the code needs regular work, for goodness sake use a maintainable language. But lots of fortran code has been stable for decades, and only a madman would go changing it.
Socialism: a lie told by totalitarians and believed by fools.
I keep hearing this "academics who will be programming their whole loves are too fucking stupid to learn new tools" stuff. Somehow I doubt it.
Socialism: a lie told by totalitarians and believed by fools.
*lives
Socialism: a lie told by totalitarians and believed by fools.
Reproducibility is part of science. So is identifying and fixing errors. But perhaps the most important aspect of science is being able to continue it.
I've worked in science labs where non-software engineers write code. They fall victim to the same problem software engineers fall victim to when they work without version control: the lose it, they overwrite it, they make mistakes and want to go backwards, they end up with 50 copies and can't remember which one was used to compile their postdoc work. And when it comes time to publish, they (may) archive it and never look at it again - despite the fact that good science should necessitate they release the code, if for no other reason than to reproduce results and ensure they are error free.
Version control is a tool. When used properly, it solves many of the above problems, all which sap productivity. In an academic setting, particularly where peer reviewed papers are being released about computationally intensive science, version control almost certainly saves more time than it creates. People just aren't willing to put the initial investment it takes to learn to use the tool.
Fortran has been an "APL style language" since Fortran 95, with most of the APL operations present. That was done both for optimization and for convenience. And other APL-style languages are very popular as well, foremost MATLAB.
Feel free to laugh.
Ezekiel 23:20
Mod parent up!
A: Legacy code, and because Fortran 2003+ is a very good modern language for scientific computation and maps very naturally to problems
See.... Fortran 2003 is more modern than ISO 1999 C.... Now that that's settled... How come people are still programming in languages like C/C++/Java, when Fortran2003 is available?
The GP did write for scientific computation. Fortran maps naturally to scientific calculcation, and doing linear algebra in Fortran rather than C is faster to develop, easier to read and faster to run. That doesn't meant that Fortran is a good fit for everything, I pity the developer trying to implement an SQL database or an operating system in Fortran. But for scientific computation, it's often extremely competetive.
ALL CAPS has been optional since 1990, at least.
Fortran has had modularisation, structured code since 1990, Classes and object-orientated since 2003. Please update your prejudices.
Anyone who believes exponential growth can go on forever in a finite world is either a madman or an economist
There is a wealth of well optimized library out there, for which the mathematical result and the "error bars" are known. Porting such library and checking everything again would cost a lot of money, for what exactely ? FORTRAN is doing the job.
C. Sagan : A demon haunted world:
http://www.amazon.com/gp/product/0345409469/
visit randi.org
Latin is even more terse than English and the words can be placed where the fuck you want. It can be well ambiguous enough!, but that's because I studied poetic latin a bit in high school. Declensions on every word save it, but mean you can really abuse it. Then being a dead language noone knows how to say "yes", "no", "hello", "thanks", "how are you doing?" and such little things.
In 17th/18th century French replaced it, with less declensions and more grammar. (and you had other such artifical national languages such as German, Italian and English)
English goes a bit too far, it's a pain to write a sentence with the word "could" which can both be read as being in the past tense or in present conditional, and no way to tell between the two (similar thing with "would". And you can't even write "I will can")
Wow, faster AND more accurate. They must use some mystical floating-point instructions that only Fortran compiler writers know about.
On PPC implementations, head-tail floating point is typically used for "long double"; this leads to inaccuracies in calculations. 80 bit Intel floating point is also inaccurate. So are SSE "vector" instructions, since denormals, NaNs, INFs, and -0 are always suspect unless you compiler emits an extra instruction in order to trigger the "next instruction after" signalling of the condition, and for NaNs, you are still somewhat suspect there.
If it isn't IEEE-754 compliant, you pretty much can't trust it. FORTRAN goes way the heck out of its way, including issuing additional instructions and introducing pipeline stalls, in order to force IEE-754 compliance.
Pretty much this accuracy only matters if you are doing Science(tm); if you are doing graphics, you are generally willing to eat the occasional FP induced artifact, because what you typically care about is the frame rate in your game, rather than being 100% accurate.
So, in closing, they're not using "some mystical floating-point instructions", they are just using accurate floating point, rather than approximate floating point.
Starting off with an opinion, not a fact mind you, like, "When you go to any place where 'cutting edge' scientific research is going on, strangely the computer language of choice is FORTRAN,"
Then smart people realize you don't know what you are talking about and we lose their insight....
FORTRAN is used in BLAS, CBLAS, LAPACK, CLAPACK, ATLAS on Linux systems...as a start....
Some of the ideas that came out of the early computing times make much more sense than the current range of 'innovations'. Most pay-ware is legacy stuff on shipping, and eventually you move from dedicated programs for doing X to well-thought-out programs that use some sort of open idiom (like spreadsheets).
I use REXX. My tendency is to use cross-platform stuff because the operating system could change from DOS to OS/2 to Windows, or whatever. Regina REXX is to be had on all platforms. Code i wrote back in the 1990's still work reliably today. Programs i used back in the 1990s have to be ever updated. A number of utilities do not have to be compiled. You can have a fancy program that factorises numbers, and then construct the number to factorise in rexx, and run the command from inside rexx, eg 'factor' me You can even have factor set to a variable, as in factor="c:\utils\factor.exe" and then write the line "factor me" without the quotes, and it will string these strings together, and run "c:\utils\factor.exe 1727999" at the prompt.
Essentially, one is going to find examples of printed code, like fortran or rexx, which one can import without modification. My recollection is that fortran does not require one to think too hard about variable kinds. A chemist is a chemist, not a computer science graduate. He's more interested in formalderhides than data type declarations.
OS/2 - because choice is a terrible thing to waste.
The PROPER definition of "legacy" code is not "old code" it is "untested code".
If code is not actively being tested, it is considered legacy, this is the real world definition.
What is the fascination with replacing something just for the sake of it?
No. The main reason we program in fortran is because the lirbary are known, have known error bars, known comportment , and are "provable". We *DO* reprogram every time we come up to a new problem which need to be translated. Chance is there is no standard code for what you want to simulate for your own specific problem. There are some rare case, like QM program (Gaussian, Molpro etc...) or some engineering program, but those are the exception not the rule.
C. Sagan : A demon haunted world:
http://www.amazon.com/gp/product/0345409469/
visit randi.org
legacy coders.
and scientists who really believe that it produces the absolutely fastest code because the book said so. just like ada coders who use it because it is MILSPEC because the first 10 pages of the book they learned it from were devoted to it being about military spec.
world was created 5 seconds before this post as it is.
While a lot of numerical specialists who aren't computer scientists still code in FORTRAN (or MATLAB or Python with NumPy), most cutting-edge research for large scale parallelism, heterogeneous computing and high performance computing is done in C or C++.
Even the new LAPACK replacements are written in C.
CERN is also known for using C++ extensively.
Sure, C compilers aren't always capable of performing some simple optimizations, but with C you can manually optimize as much as you want.
It is used because it works and is extended to do the job load of the day. It evolves as necessary.
There is an enormous body of existing FORTRAN code that just keeps going. Why change when one doesn't need to ?
The problems the FORTRAN programmer works on today are expressed the same way in a computer program as the previous problems so there is no need to change the language, just extend it as necessary.
Why not change Mathematics or any of the (applied) sciences ? because it all still applies. One simply extends it.
I've done a lot of work with it and if one asks a Physicist or Statistician about using another language you'll just get blank looks.
Pretty much all scientific computing benefits from vectorization. All that's needed to use it is that the code performs the same operation on multiple values of data (SIMD).
Esperanto isn't intended to be a language without creeping grammar and jargon and never has been. I'd like a reputable source for your nonsense. There are slang words and non standard grammar gradually changing the language (key words: 'mojosa', 'na'). Words gradually change meaning ('komputilo'). Esperanto is and has been a living, changing language for 100 years.
My personal experience with large projects:
a) flexible index bases may make it easier to write new code but they are a nightmare to maintain code that was written by multiple scientists over time
b) 1-based arrays may seem natural to mathematicians, but they lead to a significanly larger number of "-1"s and "+1"s within the code. Typically, modifying a 1-based array into a 0-based array reduces the clutter of "-1" and "+1" offsets and enhances readability.
I'd argue that if you're programming in processor-specific intrinsics, you're not really programming in C++ any more. Standard C and C++ semantics for pointers and arrays really get in the way of autovectorization. So, you have to go to language extensions and kludges (like C99's restrict keyword) to throw the compiler a bone.
Sure, tricks such as whole-program analysis and run-time alias tests can help the compiler find the guarantees it needs to have in order to vectorize. The fact of the matter (and I heard this straight from the mouths of my employer's vectorizing compiler team members) is that stock FORTRAN is simply much friendlier than stock C/C++ for this due to those semantic differences.
Our compiler will autovectorize C code if you pass it enough hints such as minimum loop trip counts, pointer alignment, pointer aliasing guarantees (aka. restrict) and so forth. Even then, there are limits to what it can do. We offer processor specific intrinsics so you can vectorize the code yourself.
Once you start coding in vector intrinsics, you're taking the vectorization out of the compiler's hands and doing it yourself. Each of those intrinsics usually maps directly to an instruction or small sequence of instructions, so there's little left for the compiler to figure out. The compiler then just schedules and register-allocates the code, and handles the non-vector bits around the edges. Sure, you still compile with the C++ compiler, but the C++ compiler is no longer providing the vectorization: You are.
Program Intellivision!
Missing out on what, the wonders and simplicity of using git? (/sarcasm)
...and i would like to see statistics on how many git branches are created, yet never merged back in.
which also doesn't necessarily mean anything...
I was contributing to a project and had a branch in my fork. Upstream liked the changes but wanted it split into two separate pull requests. So I made two new branches and cherry picked from my original branch. Then upstream merged in both branches by rebasing. So now I have three branches that are officially not merged back in (because not of the commits are merged, they are all cherry picked / rebased), but all changes from the three branches are in upstream and I can delete the three branches.)
Fortunately, (1) more and more scientists (also non-CS) are using github repo's for development, as most of our stuff is public anyway; and (2) It is becoming quite common to release a github page as part of a publication and is also a selling point to the editors/reviewers.
Speaking as a scientist with 20+ years of experience in programming: we are unlikely to choose a programming language based on its elegance, ideas behind etc. Two primary factors are (i) who else is using a given language and (ii) what libraries for that language are out there. For example, exactly 0 of the languages mentioned in the original article are used by statisticians. Haskell might be cute to write a generic program with, but in R or SPSS I have all the cutting-edge statistical tools I need for my work.
So one hipster CS graduate who probably thought his degree made him world champion ends up making an over-complicated cluster fuck, don't get me wrong it must be very frustrating for you but it's still very anecdotal. Particularly when it involves XML, re-indenting, renaming, copy-paste programming and all sorts of bad things that obviously is no fault of the language it was written in.
I love OOP when there's lots and lots of state and it's not going anywhere, you're constantly waiting for some event that'll trigger change like user input or network traffic or you have some kind of database or file system watcher. Using global state or dragging the whole old state over into a new state because you make a tiny little change seems horribly awkward to me, it's like passing every object's state as function parameters just to make it functional. And trying to fake OOP in non-OOP languages like C the result is simply horrible, it's like agreeing that a hammer would be the best tool to pound in this nail but insisting on using a flat rock instead for religious reasons.
What I miss in imperative programming is a good way of saying that these odd, different things can be done in parallel. Like if I want to set the table I want to add a plate, fork and knife but the order is really irrelevant. Now maybe I want to add a napkin on top of that plate, but it depends only on the plate. It's more like a gantt diagram with dependencies than a straight start-to-finish order. Still, on the micro level most things are imperative - I have to open the drawer before I can grab a fork, not the other way around so I don't want to program through dependencies, also because of resource contentions and race conditions that you don't realize. I'd rather try to specify some degree of parallelism than specify all forms of non-parallelism.
One of the great weaknesses of imperative programming is that you often want to leave it in a known state. For example imagine I have to grab the fork and knife from the same kitchen drawer. Very often the "grabFork()" will open the drawer, grab the fork and close the drawer. So will the "grabKnife()" function. Obviously there's optimization potential here, really you'd only need to open the drawer once. But if you want it to close again, you'd need some kind of refcounting to know when we've grabbed all we need and can close it again. Obviously in this simple case we can implement a "grabForkKnife()", but what if others are preparing a coffee table with spoons from the same drawer in an entirely different process? I find expressing heterogeneous parallelism hard in all the current tools I've seen, it's not that hard in real life.
Live today, because you never know what tomorrow brings
They may well share the same optimizer, but the optimizer can only do so much, and the tighter you constrain the memory model (in particular, aliasing), the better the optimizer can work. Fortran constrains its memory model much tighter than C and C++ by default. In particular, all pointers in C and C++ have to be assumed to be aliased by default; C99 added 'restrict' to work around that, but you have to not forget to use it, and C++ doesn't have anything equivalent at all.
Fortran has had "higher-order array operators" for _many_ years now (see FORTRAN 90), but even without this most Fortran code is written using simple iterative operations over arrays, with explicit multi-dimension indexing. This tends to make the auto-vectorizers job much simpler.
As the AC noted, Fortran has pretty much no aliasing issues at all, unless you go out of your way with COMMON blocks, this makes it far easier to optimize the code.
Terje
"almost all programming can be viewed as an exercise in caching"
What?
No that's incorrect.
Both types of compilers attempt to produce *correct* code. Any code written to the standard should come out correct. The C standard specifies strict aliasing in that a float* cannot alias an int*. In C if you violate the standard and pull such aliasing tricks, the compiler is allowed to make your code do funny things, just as if you break other rules like using a poiter after a free, or returning a pointer to a stack allocated variable.
In C, the compiler cannot in general assume that two float*s do not alias without being incorrect. Fortran to a much larger extent can, hence it's faster performance.
C99, and not standard C++11 also has type annotation, restrict which can tell the compiler that two arbitrary pointers do not alias (and woe betide you if they do) and this recovers some of the speed against FORTRAN.
This has nothing to do with compilres sacraficing correctness at all.
SJW n. One who posts facts.
...Fortran 90, if you avoid all the old Fortran 77 cruft, is a really nice language. It is clear, concise, and great for writing high performance scientific code. Its array language is second to none.
Fortran (yes, that's how it's spelt now, not "FORTRAN")
Actually, FORTRAN -- the original -- is an acronym derived from Formula Translating System, so I'm sure all upper case is still also acceptable, unless you have a bug up your butt.
It must have been something you assimilated. . . .
I fail to see the point of requiring someone to register an account or identify himself just to express an opinion.
Unless you wish to shoot the messenger, which makes the conversation feel quite repressive.
A previous comment suggests that the lifetime of most FORTRAN code is not necessarily that long (requiring scientists to publish their code might change that). If this is indeed the case, you have a point. However, most programs live very long indeed (several decades is not at all exceptional), so the productivity of the original author is not that important. If we would look at the cost over the lifetime of the code (including testing, debugging and operational cost of bugs), I think there are significant differences between languages.
There is more to that. Semantic side effects prevent many optimizations or make them very hard so the speed of the assembly generated can depend on the language.
This is why there are benchmarks where Java is faster than C.
Also:
I don not buy the legacy code argument as you can use Fortran libraries in other languages.
I have some experience with this, so I'll chip in about performance.
Modern Fortran produces rather tight machine code, however so does C++. I haven't seen a case so far where Fortran produces measurably faster code, and of course you pay a price in that Fortran is less readable.
Most Fortran code is not modern Fortran, but Fortran 77 or even older and won't compile on modern Fortran compilers. Most new scientific software is written in C++ or even in Java or Python for example, since performance doesn't always matter that much and ease of maintenance is also important, especially for people who'd rather spent their days thinking about physics than debugging software. Fortran code is almost always legacy. I've seen Fortran IV in the late nineties, believe it or not.
Most of the time the real performance bottlenecks are either I/O which you can do fuck all about, or the kind of nested loops that happen inside Fourier transforms and such things. For the latter you almost always use a library, which tends to contain better optimised code than you could ever write yourself.
I find it curious that the summary stresses speed as the advantage of Fortran, not just because in practise C++ is just as fast or sometimes faster, but because nowadays performance of modern languages is generally good enough. When selecting a language you care more about readability, maintainability, does it interface with our discrete maths library, will it allow us to slap together a GUI in an hour so our intern can use it to take measurements on the Big Machine, will the next generation of graduates be able to work with code without retraining, and so on. Practical questions, not theoretical ones like which is faster.
I am not a programmer. Wanted to be. Too late to start I think.
Garbage! You can start programming in any age just fine. :)
So, Fortran issues extra instructions and pipeline stalls for accuracy, yet manages to be faster.
That is amazing!
That's wrong. Aliasing in FORTRAN is exactly the feature that can make optimization very difficult or impossible. Aliasing was invented because computers had small memories.
I've just finished a project in FORTRAN in geophysics, so I have some experience with this language. Why it is still in use? The answer is: scientists know it. No other reason. Projects in FORTRAN are very hard to maintain. Refactoring is also difficult. Half of the project was in FORTRAN, other half in C++. On any feature request we had a meeting to decide whether we are going to implement it in C++ or in FORTRAN and how the interface will look like.
FORTRAN _may_ have better efficiency in some cases. For really simple programs with no memory management and no hardware interaction.
I think that FORTRAN is a good language, but it is also an old language.
He handed it over to a computer science graduate (i.e. a non-physicist) who really liked all the modern trends in CS.
Why was a graduate fresh out of university put in charge of architecture decisions? You wouldn't put an apprentice in charge of a mechanical workshop and expect them to keep it tidy and efficient, this is no different.
It's my general experience that it takes 5-10 years of commercial experience before someone is capable of making wise architecture choices about small standalone apps, and 15+ before they'll have a hope in hell of doing anything non-destructive with a large legacy application.
Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
Doctors don't use Latin. They use their native languages and a bunch of proper nouns that happen to be Latin (or Greek) words or phrases.
Latin (or Greek) used to be the language of academia because it's what the Greeks used and the Romans translated the Greeks into. And the church loved Aristotle and ironically, the church pretty much defined western academia.
Interesting. In my experience, rewriting the code is almost always a better approach than making the old stuff work. The old stuff was likely written by a grad student who didn't know much about writing code, to function just well enough to perform his experiment. Perhaps it won't even compile on modern hardware and you need to keep that G3 or SGI running.
There IS some very good, quite old code, mostly written in Fortran, that's been optimized by people who know what they're doing over the years and isn't worth messing with. But it's very different from the spaghetti that grad student wrote ten years ago so he could publish a paper and get a degree.
This may have been true decades ago and may still be true in special circumstances. As a general asumption it is wrong. The boost math for C++ clearly show that. Also high performance scientific computing in Java is pretty close to C and FORTRAN. ;)
There is absolutely no reason a simple matrix multiplication should yield different machine code if coded in C versus FORTRAN.
Traditionally however FORTRAN usually recognized vectorization versus scalar operations and used vector operations if the platform supported that and also changed the memory laout of matrices e.g. to take advantage from vector ops. C on the other hand was only needed to compile the fortran compiler etc.
That gcc is creating rather slow code is not surprising considering its history and the amount of platforms it supports. Lets see in what direction LLVM is moving and if they can avoid those pitfalls.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
you are spouting off about a field in which you do not work, against a well-known fact.
This "well known fact" is decades old and outdated. C++ with booth math libraries is as fast as FORTRAN and often faster. In our days where most computers use general purpose processors (versus vector processors) with a few added simd instructions the difference is mot really existing.
Doing the quite common operations of numeric analysis, machine output of the C compiler will be worse, less optimized, slower than that of Fortran.
That is nonsense in two ways: first there is no reason at all that a simple loop over floats is faster in one _language_ that means: is compiled to different machine code, than in the other. Second optimization is exactly the same, at least on machine code level. I doubt there is any optimiization a fortran compiler can make versus a C compiler as long as we only look at math operations in loops over vectors or matrices. There is definitely no fundamental reason for one being faster than the other. Only perhaps that C compiler vendors don't care for maximum math performance.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
I just find it silly when C programmers question why one use Fortran in 2014. The more interresting question is why anyone use C in 2014. It's a language with 3 main design requirements:
- be easily compileable by a compiler that had only 2k of memory
- be able to make PDP11 assembly cross-compileable
- otherwise, delegate most of the work from the compiler to the developers, since developer time was cheaper than CPU time.
None of those requirements are valid in 2014, and it's insanely far behind other languages and current theory on all areas.
Legacy code is one part. Non-Computer Scientists in general do not like to write code they much rather adjust an existing program and go on. .NET, Python, Perl... Are all interpreted languages and run slower. If you are going to be doing a bunch of number crunching you really want your computer to be focusing on running the program. Not interpreting your command then running what you said.
Performance is the next part. The newer languages that are considered easy to code: Java,
If something is so important that you feel the need to post it on the internet... It probably isn't that important.
The article mentions strict aliasing as an advantage of Fortran, but C has had strict aliasing optimizations by default since forever ago.
Everything Fortran does, C can do better.
so what you're saying is that FORTRAN's mutlidimensional arrays allow the compiler to beat your crude attempts at optimization with SIMD. Use your cute toys for web pages, use a real language for a real computer.
Oh, and when you really want deterministic performance, FORTRAN doesn't need a virtual memory machine.
No shit, moron. That doesn't change the fact that the standard now spells it "Fortran."
Yes, too bad. I suppose there are a lot of things that went into this. I suppose we can't even blame you; only pity you. I'm guessing you have no friends out in the real world. It must be hard, doubly hard, to learn some basic programming skills, work hard on writing stuff only to have the world tell you why it's useless. Most of us could fall back on friends, learn to do better, but you - all you can do is scream and yell impotently on the reddits and the slashdots of the internet. Tell me, do you suffer from some physical disability? The level of vitriol you bring to the boards tells me you probably are helpless to defend yourself in the real world. It must be terrible to be almost as impotent here in the online world, the one place where you actually had a chance at being a peer, an equal; only to be relegated even here to the status of a punchline. They took your lunch money and beat you up in school. College was even worse - watching guys with more muscles or more money or just better looks get all the girls, everyone laughing at the geek. Worst was the real world - nobody even pretending that you belonged, nobody ever willing to let you prove that you could actually be important.
How am I doing so far? Tell ya what - log in as a registered user here at Slashdot before you post replies, I'm sure people here will respect that act by itself. Just don't expect us to fall all over ourselves showering you with praise because your magnum opus software project is of no value to the vast majority of the other registered users her at Slashdot. Be ready to read a lot of unpleasant posts. Behave like an adult, you'll be treated like one. Behave like a child, you'll be marginalized and ignored just like you have been all your life.
I am embarrassed. You cited my alma mater's course catalog and proved me wrong (a decade ahead of my time, though) :-)
Most scientists like to use tools that work, and they are proficient in.
FORTRAN falls under both categories.
---- Booth was a patriot ----
FORTRAN was -- for some still is-- the 'Perl' of scientific computing. Get it in and get it done... and it doesn't always compile down very tight, but always fast because for mainframe developers getting this language optimized for a new architecture was first priority.
At 15, the first real structured program I ever de-constructed completely while teaching myself the language, was the FORTRAN IV source for Crowther and Woods Colossal Cave Adventure, widely regarded as 'the' original interactive text adventure, a genre which would later go multi-user to become the MUD. Read about it here, or play it in Javascript.
Crowther's PDP-11 version was running on the 36-bit GE-600 mainframes of GEISCO (General Electric Information Services) Mark III Foreground timesharing system... this is in the golden age of timesharing and no one did it better than GE. It took HOURS at 300bps and two rolls of thermal paper to print out the source and data files, and I laid it out on the floor and traced the program mentally, keeping a notebook of what was stored in what variable... I had far more fun doing this than playing the game itself.
FORTRAN IV and Dartmouth BASIC (I'll toss in RPG II also) were the 'flat' GOTO-based languages, an era of explicit rather than implicit nesting -- a time in which high level functions were available to use or define but humans needed to plan and implement the actual structure in programs mentally by using conditional statements and numeric labels to JUMP over blocks of code. Sort of "assembly language with benefits".
When real conditional nesting and completely symbolic labeling appeared on the scene, with good string handling, it was a walk in the park.
<blink>down the rabbit hole</blink>
Legacy coders.
The real reason is science is filled with tons of old men that refuse to learn anything new.
optional since at least Fortran-77
In the cutting edge world of biological research scientists are still using the ancient language latin to name, classify and describe species of organism. The thing is why would they change?
Korma: Good
Thank you. This is VERY WELL SAID. If it ain't broke, don't fix it. All the "improvements" lack the elegance and clarity of FORTRAN. It is one of several languages for which no worthy successors have yet emerged.
Let's be real: just about every Fortran code I've heard of is still limited to F77 (with some F90 if you're lucky). It just won't work on later versions, and it's deemed not worth porting over, so the entire codebase is stuck on almost 40 years old code.
Then you have no idea of how to do anything in Fortran. All (except two things no one really needs) Fortran 77 code is still valid in modern Fortran 2008. (Yes, even Fortran 90 is freaking obsolete.) There is no problem of combining fixed and free form code, just put them in separate files and voila, it works just fine.
A programming language expressly designed for numerical calculation is better at numerical calculations that a language designed for systems programming.
> where 'cutting edge' scientific research is going on, strangely the computer language of choice is FORTRAN
What an absolutely moronic statement. Strange indeed, maybe because scientists aren't interested in the latest fashionable language, and fortran is the best tool for the job?
Jesus, submitter is an ignorant fool.
Because that correctness comes at a cost... a small loss of speed.
Fortran code ignores the very possibility that pointer content can overlap. Modern compilers do not.
File under 'M' for 'Manic ranting'
Huh ? ... why would you write the same application logic on both the client and server ? ... isn't that, by definition, repeating yourself ?
The point of DRY is that you don't write the same application logic twice. You write it once and then use it twice. For example, you'd write validation logic, and then you'd use the same logic to validate on the client before POST that you use to validate on the server after POST.
The 'front-end', on the client, cares about fundamentally different things than the 'back-end', on the server.
For a large part, this is true. But end users have come to expect input validation to happen in part locally before submission, in order to avoid a round trip possibly longer than a second after every submitted change.
In C, if I am using a float variable, and then write some other content into the memory occupied by the float without using the variable (possibly a bit pattern that corresponds to a specific float value) and then try to use the float again, its content will have changed... which is the correct behavior, because that's what was instructed. In Fortran, with appropriate speed optimizations enabled, the compiler does not assume this is possible, and the float variable may not necessarily appear to be changed when it is used after the memory it supposedly occupied was overwritten (in Fortran, you'd generally have to do some weird tricks to even make this happen without explicitly using a union type which would disable such optimizations in the first place, while in C all you would have to do is cast a pointer to a different type).
File under 'M' for 'Manic ranting'
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
This is the same reason they write math formulae as a jumbled mess of greek characters. Legacy code.
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
I would also hazard a guess that Fortran tends to be a tad easier to read than C... Especially for scientists...
The way scientists write code, it doesn't matter what language they use it will still come out an undecipherable mess. You'll have a quintuply nested loop populating an array call tlnb1 in a function called abn that takes 8 arguments named t1 to t8. The only documentation will be a single comment just before the loop that says "This should work now".
If you're going to be working with scientific code you'll need at least a Master's degree in software archaeology and software anthropology.
~X~
They don't exist either. I googled that mere talker. No action or programs.(like you mmell). Quit projecting your own issues.You BOTH RAN like scared little wenches when challenged by apk (a real programmer who has actual wares out there commercially).
ALL CAPS has been optional since 1990, at least.
Fortran has had modularisation, structured code since 1990, Classes and object-orientated since 2003. Please update your prejudices.
And the scientific community is a good 20 years away from effectively utilizing such goodies the steering committee has accepted because software maintainability is often a secondary concern. Scientists aren't software engineers and very few of them I've worked with want to bother becoming one. If the code works, that's enough for them.
~X~
Ask him to show he's coded a program that did well enough to become commercially sold. Go on, ask. You'll get back zero from that zero. Look on Google. You get zero. He's a wannabe!
You can prove you wrote. There isn't any, is there? Big talker wannabe = K.S. Kyosuke, nothing more.
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
We're using up to F95 in our code (~500000 lines IIRC) with only the solver (which we didn't develop ourselves but only modify existing code) being F77 (a nightmare to read). Many of the F03 features would come in handy but, alas, the compilers on some of our target architectures don't support it.
IMO Fortran is quite OK, still I prefer C/C++.
Mmell: Yer bein' called out. Why ya runnin', "forrest" http://tech.slashdot.org/comme... ?
That you can prove YOU wrote: There is none. Big talking wannabe = K.S. Kyosuke, nothing more.
Your problem began when you turned the code over to an inexperienced CS graduate. You don't need to be a good software engineer or even a good programmer to get a degree in computer science. I wish people would stop conflating the two, especially the people in the HR department. :P
You needed a SOFTWARE ENGINEER. Worse, you needed an experienced software engineer familiar with the domain. Instead you handed it over to a fresh graduate who maybe had one or two courses on engineering. What exactly did you expect to have happen?
And what about you? Did you give them a good set of requirements? Did you have frequent reviews? Or did you just drop it in his/her lap and say "make it better"? There's a lot of missing details on exactly how you participated in the process. Again, if you weren't actively giving feedback into the process then you shouldn't be surprised when it isn't what you wanted.
The failure in this case is yours. Next time you need work done, I suggest actually getting the right person for the job and not some cheap fresh grad who happens to have "computer" in their degree description.
~X~
That's just for the keycaps. You have to buy the rest of the keyboard separately (for something like $100).
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
... although it is certainly faster, the resulting code will be less robust than code output by a modern most modern C compilers.
This is the best you've got? That some how C is more correct than Fortran? Doesn't seem that way to me. Last I checked, there were very few differences in Fortran or C's numeric operations, both mapping almost directly to whatever the underlying architecture wants to do with the operands, both silently ignoring integer over-/underflow. Both have language primitives (or extensions) that allow you to manufacture a raw pointer to anywhere in memory and allow you to write anything to that address. Any language that lets you do those things without great angst cannot be called "robust" in any normal sense of that word. "Adherent to the spec" is about all you can say of it.
That is all.
Yes, FORTRAN sucks, but it is stable, fast and well understood. It runs on a number of supercomputer architectures. It is way easier to program in FORTRAN than in C for non-CS people. So what is the issue? Oh, maybe that this is not a "modern" language? Here is news for you: Java sucks a lot more than FORTRAN.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
No one knows how to spell it. In these threads I've seen Fortran, FORTRAN, ForTran, etc. Who the hell can keep track? That's why C is winning! One letter, upper case, C. No muss no fuss. Not to worry, PL\I had the same issue (Forward or backward slash? Better go look it up!) Same with LISP, LisP, Lisp, (or, these days, scheme, Racket, Clojure).- too many letters, too many ways to misspell them. D avoided falling into this trap, but which would you rather have on a paper? A D or a C? And C++ doesn't even look like a real grade? Python? Are we naming a language or a comedy troupe? Same with Ruby - I don't need a bunch of freaking geologists telling how to use a computer.
Jeez, everyone, C just got it right where it counted - its name. Now can we just all agree to use that and move on?
That is all.
Thanks
Dave Barnes 9 breweries within walking distance of my house
I refuse to spell it Fortran.
It was FORTRAN when I learned it as my first computer language in 1965 in high school.
Dave Barnes 9 breweries within walking distance of my house
Language semantics are the real difference. To get comparable semantics in a C program and a Fortran program solving the same problem, the C program has to use the "restrict" keyword everywhere (or nearly everywhere/or where it counts). Fortran by default disallows aliasing (the purpose of restrict) in contrast to C.
Location aliasing inhibits intermediate code[1] optimization as the optimizer cannot assume that two pointers point to difference locations. If the optimizer can safely make that assumption it can do more with the code.
Aside: during my compiler design class, the lecturer spent time going over some optimizations (obviously). Towards the end of the lecture: "oh but if p aliases q, you cannot use that optimization".
[1] Any compiler worth its use translates input files into some form of intermediate representation for optimization purposes.
... many programmers still communicate in English, (or German, French, etc.), as well. Of course, English has changed over the last fifty years, but then, so has FORTRAN. The time really is ripe for the Esperanto/Haskell movement to take the world by storm.
> Fortran code ignores the very possibility that pointer content can overlap. Modern compilers do not.
Fortran's language specification doesn't allow pointers to overlap. Inhibiting programmer freedom in this way ironically gives the compiler greater freedom to perform optimizations.
In contrast C & co, give the programmer this freedom, resulting in the compiler having to be more conservative.
Eh, the original works too (especially for robotics)!
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
> No making pointers/references to things which aren't designed to be referred to multiple times
C++ works best IMHO if you use C++, STL, passing by reference to avoid implicit copies (or reference counting), and suitable matrix and other numerical libraries as well so you can minimise the use of pointers in your own code. But then optimisation of this code by the compiler may not be as easy. If the matrix and linear algorithm code is ultimately using hardware optimised BLAS, LAPACK, ATLAS and so on then that shouldn't be too bad, though. You can abstract things with C too, but you have to work a bit harder.
If you alias one type of object to another through pointer casting in C, and change what is there through the other pointer, when you access the original, the value will have changed. This is the correct behavior (however implementation-defined) because those are the steps that were given. Fortran, when producing optimized code, will not do this unless you use a union type, which explicitly disables such optimizations in the first place.
Using the restrict keyword causes modern C and C++ compilers to produce code no slower than Fortran.... but the side effect of using the keyword is that pointer aliasing will have unexpected side effects, just as it would in Fortran.
The fact that the side effects of pointer aliasing are often not what a programmer may have intended does not change the fact that those effects are still what the computer was instructed to do, and therefore the correct behavior. Compensating for such side effects is what makes more recent compilers produce slower code without the usage of optimizing that allows such side effects to remain unaccounted for.
File under 'M' for 'Manic ranting'
LMAO & how it can reverse dns ping sites to determine their IP address as was asked of you http://slashdot.org/comments.p...
In C, if I am using a float variable, and then write some other content into the memory occupied by the float without using the variable (possibly a bit pattern that corresponds to a specific float value) and then try to use the float again, its content will have changed... which is the correct behavior, because that's what was instructed.
No. If you write to that location using a float* (or char* which is allowed to alias anything) then the compiler must not assume that the value has not changed. If you write to that location through an int*, it is entirely legal for the compiler to not bother re-reading the memory and to instead use a cached value.
This is known as strict aliasing and is speified by the standard. With -O3, gcc will perform optimizations under the asusmption that the user is not breaking strict aliasing. If you do, your program is not legal C code, and so the compiler is free to give you anything it wants to.
SJW n. One who posts facts.
To be fair, you basically set this kid up for failure. What you describe is a significant engineering challenge, and you gave it to a computer science graduate, with no experience. If you gave this to someone with 10 years under their belt, I'm sure they could create a lovely maintainable package; but as it is, you should start over. You may as well have asked him/her to design the Golden Gate Bridge. Computer science does not teach engineering, there is no way this kid could have had the necessary skills.
A case in point would be that with boost's ublas implementation, for example, you can specify in an equation A = B * C that the A has no other alias to give the compiler more of a chance by changing the code semantics in the template library.
Exactly.
File under 'M' for 'Manic ranting'
Fortran is still used because it works. Becuase it is fast. Because libraries are optimized and well understood. Fortran is still used because gasp it has evolved since FORTRAN 66 and FORTRAN IV. Maybe you and the other language nannies always forcing latest greatest buzz on the rest of us should take the time to actually read about some of the most recent versions?
But I don't program in either; I program in ASP.NET -- wait, no, I don't even do that: I program against the project-specific API that my more senior coworkers wrote on top of ASP.NET. (Actually, that's not even true either -- there are 3 fucking layers of APIs between me and ASP.NET!)
Now, given all that, please explain to me how the fuck rote memorization of POSIX APIs would have done me any goddamn good at all?!
(This is not to say, by the way, that I'm not also familiar with the POSIX API -- I had to know it for my advanced operating systems (e.g. threading, scheduling, RPC, etc.) and computer graphics classes back in college -- but learning it was tangential to the purpose of learning advanced operating systems and computer graphics respectively, not the goal in and of itself. And that's exactly the way that it should be!)
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
You confused Fortran with Cobol. Yes, Cobol would stick around for decades because of legacy code in all the banks, insurance, government and other institutions.
On the other hand, Fortran is also a language of choice for cutting edge research where no legacy code exists and program development is done from scratch.
In theory there is no difference between theory and practice. In practice there is. - Yogi Berra
These two sentences seem to be saying exactly the opposite. If the compiler does not ever assume that the value has not changed then it may assume that it *HAS* changed, and would not use a cached value. This is the normal behaviour in C. You can get the latter with certain optimizations enabled, but in cases where you do, the code won't perform any worse than Fortran produced code anyways. Even then, a modern compiler may be able to detect that a person has used pointer aliasing in a context and disable those optimizations in that context, while in Fortran, the language structure does not permit such things to happen, and thus produces code that makes the assumption it will never happen.
The optimizations that Fortran makes can be explicitly disabled by using a union type, but then it will not ever be any faster than what a C or C++ compiler could produce for manipulating such values.
File under 'M' for 'Manic ranting'
There is no language, that is not interpreted, that is as good as Fortran for scientific computing. Yes, when it was invented it was just gotos and arrays, but it used matrices. Unlike C, where you had arrays of arrays, but a good programmer would use indexing like A[ncols*i+j]; which would create errors always, always, always.
People invented new languages that improved upon fortran, but the only thing they did was to give good ideas to fortran to become better. For example, today fortran has array slicing built into it, the same array slicing that matlab has. After using it with matrices operations, I have never been so happy. I can use matrices in a way that makes everything so much easier, clearer, and shorter. I have changed codes with 100 lines to 10. Do you know how important this is if your simulation has a small glitch? If somehow the fluid goes into space and you don't know why? There is a big difference between general code and numerical code. In general code, if you have an error you can start asking yourself where that error might have started. Where am I adding something to the string? Where am I initializing stuff? Etc. Make a bad operation in one of the 100 lines of code that contains many long formulas, and you will cry blood, because you can't just see the number 1.45560e10 in an array of millions of numbers and say... Well, the error seems to have started here.
I tried Fortran about 7 years ago but I couldn't find a decent GUI for Windows XP. Maybe I was looking in the wrong websites. I just want to create a simple "Calculation" program that performs mathematical calculations. The dialog box should have with a menu and a command button that closes the window.
we're not talking about simple loops here, would you happen to know what solving a tensor calculus problem by numeric methods entails?
the famous c++ numeric projects have massive blocks of compiled fortran code in them
we're not talking about simple matrix multiplication though. The boost math toolkit doesn't prove anything by its mere existence, that's not how the big boys do numeric methods.
Latin and ancient Greek was taught because most of the great works were ancient and written in those languages. Only unitl the end of the dark ages did European academia recover enough to make native language works more relevant. Also, Latin was still used by what remaining social order existed. It was not quite dead.
Even today, you might want to learn some other language in order to gain better access to academic works in their original form.
A Pirate and a Puritan look the same on a balance sheet.
I suspect Fortran makes it easier for compiler writers, but for the compiler user the difference is tiny.
Both GCC and ICC can vectorize the following piece of code, by generating code with a run-time check for aliasing and two paths: a vectorized path and a scalar path.
This code is pretty trivial, but I think the method is valid for most(all?) possible uses of Fortran arrays.
In my experience, with a bit of care in code writing (and reading the compiler's vectorization reports), ICC can vectorize pretty complex, but readable, standard and portable, loops.
void f(int n, float *a, float *b, float *z)
{
int i;
for(i = 0; i
stupid me... forgot the tags
void f(int n, float *a, float *b, float *z)
{
int i;
for(i = 0; i < n; i++)
z[i] = a[i]+b[i];
}
They have no idea about the physics or maths involved (which is the difficult part)
Wrong. The physics and math are the easy part. They are well-documented in books and papers.
The programming and architecture, on the other hand, is the hard part.
Ever seen a textbook on physics without one error? They exist.
Ever seen a program without one bug? No need to answer this.
If Pandora's box is destined to be opened, *I* want to be the one to open it.
"Accurate floating point" is an oxymoron.
FORTRAN goes out of its way to keep IEEE-754 compliance, true, but that's to get reproducibility across machines (i.e. the _same_ inaccuracy for a given calculation).
If you look at the foundational libraries for most FORTRAN programs - LAPACK, SLATEC, etc., you'll see a huge amount of effort going in to keeping iterative calculations numerically stable across floating point values, and in to making sure error terms are bounded and deterministic. The authors were very much aware that FORTRAN could not and cannot 'force' floating point calculations to be 'accurate' to any reasonable degree.
I am not a programmer. Wanted to be. Too late to start I think.
Garbage! You can start programming in any age just fine. :)
You are right. I want to learn Javascript. I know there is no typing. But useful for what I want to do: web page creation.
Don't explain computers to laymen. Simpler to explain sex to a virgin. -- Robert A. Heinlein
And you can't even write "I will can")
I will can the peaches tonight. What's the problem?
When our name is on the back of your car, we're behind you all the way!
i did give a proviso for run-time alias checks in my comment above. Our compiler will also generate a run-time check for that as well, with a small codesize and runtime cycle penalty.. The FORTRAN equivalent doesn't need the alias check.
I'd expect ICC to be very aggressive, given that Intel has one of (if not the) largest paid, full-time compiler team in the world.
So how about all of FORTRAN's other nifty features, such as array slices? To get the same functionality in C / C++, you have to put explicit strides and bounds everywhere, and sometimes checks to reverse loop directions. In FORTRAN, you can write things like "A(1:100,1:200:2) = B(101:300:2,51:150)", and the compiler is free to choose the best way to do it.
In C / C++, you leave it to the programmer to dictate the loop explicitly and hope the compiler can figure out what you're doing. In my experience, real world programmers get unusually creative with this task, creating awful code. If you write clearly enough and pay enough attention to compiler vectorization reports or other feedback, maybe the compiler + user eventually figures it out. Realistically, most programmers aren't that sophisticated. And even among the ones who are, not all have the time or inclination.
Looking back to my array slice example: Now take those slices across function call boundaries in both languages and see how much work the programmer has to do in each language...
My point is, the more work the programmer has to do to help the compiler succeed, the more evidence it's a poor fit for the problem domain. FORTRAN can make it easier for compiler writers because they start with a higher level specification of what the programmer is trying to achieve. FORTRAN also makes it easier for programmers because they stop at that higher level specification of what they're trying to achieve.
Program Intellivision!
that when you need quadruple precision complex Bessel functions it's nice to have it built into the language.
A: Legacy code.
Computer science comes up with new languages like a flavor of the month. Fortran is the common language of scientific programming. Computation intensive scientific problems such as electronic structure are as old as Douglas Hartree (i.e. predates computers). These problems can take (and have taken) multiple lifetimes --- a 5 year phd in computational physical science is just getting a warm up. For example, the Gaussian package was started by Nobel laureate John Pople in 1970 and has been continuously developed by research groups around the world ever since --- and its still in Fortran, even though it is a commercial package. That's not a legacy code -- thats a living code that has left (and still leaves!) a legacy!
These two sentences seem to be saying exactly the opposite. If the compiler does not ever assume that the value has not changed then it may assume that it *HAS* changed, and would not use a cached value.
Yes, that is what I said, but note the caveat. If the varible is a float, then it must only assume change if data has been accessed through a float* or a char*.
Even then, a modern compiler may be able to detect that a person has used pointer aliasing in a context and disable those optimizations in that context, while in Fortran, the language structure does not permit such things to happen, and thus produces code that makes the assumption it will never happen.
I'm not sure if you're talking about strict aliasing (type punning) or regular pointer aliasing. For type punning, the C compiler can assume it doesn't happen with a few minor caveats aside.
Even then, a modern compiler may be able to detect that a person has used pointer aliasing in a context and disable those optimizations in that context, while in Fortran, the language structure does not permit such things to happen, and thus produces code that makes the assumption it will never happen.
More the opposite: the compiler will only enable them if it can prove it doesn't happen. That is very much harder. It's alos why Java will likely always be slower, because escape analysis is exactly alias analysis. If you have to prove it, you will always miss cases when other languages can guarantee it doesn't happen.
SJW n. One who posts facts.
Touche. All European (and colonial) scientists shared latin. Scientists in other great cultures around the world just used their local 'universal' languages.
Sometimes boldness is in fashion. Sometimes only the brave will be bold.
Must be terrible - even here in cyberspace, you just don't even have the strength to defend yourself. Everyone still spits on you, laughs at you. It's like high school all over again, isn't it? You must be terrified that you'll lose as badly here as you have out there in the real world. Even the few people in school who ever showed you anything like respect eventually betrayed you, didn't they? Here, you've been derided, banned, branded a troll. All you know how to do is make challenges you know you'll never have to live up to. The internet has freed you from being physically hurt. Bullies can't stuff you into a dumpster here on the internet, but even here people you perceive as your inferiors are still able to humiliate you publicly. Even the courts don't want to hear from anyone as insignificant as you - or did you actually ever get that far? The wonderful folks that make Spam Titan certainly haven't felt your wrath. Is that because you discovered that your claims are legally baseless, or did Mommy just tell you she isn't going to spend money just to salve your ego? There's the chance that you actually managed to talk to a lawyer and get told just how worthless your case is; but somehow I don't think you ever even made it that far. All you know how to do is prove that you still exist by repeatedly uttering meaningless challenges via the internet. At your best you show all of the intelligence and thoughtfulness of an eight year old child in the midst of a neverending temper tantrum. Yes, I'm sure you think it's unfair that none of us will bow down to your obviously superior intellect. That's not how this is supposed to work, is it? Here, you're supposed to be in charge, respected and admired for your intellectual prowess - but instead you're derided by people who won't even pretend to be bound by the rules you think should apply here. I do pity you. Your life in the real world must be a hell from which even the cold dark of the grave would be a welcome reprieve, and the promise of finding Shangri La here in cyberspace has turned out to be a lie. It's not a magical alternate universe where your ability to argue even after you've lost is respected and admired, but just another place where you are trivialized, marginalized. Hell, even here you have to sneak around anonymously - must be terrible for you.
I was really pleased that InfoJunkie777 raised this issue and followed with great interest the ensuing discussion. I suspect that not everyone who contributed comments has actually had much first hand experience with FORTRAN or even Fortran and some therefore are thinking out of the box. That's not a bad thing of course, since new ideas frequently spring from thinking outside the box. However, I would like to offer a few comments from someone who has been firmly inside the box. Take the issue of fast computing. When I started programming in FORTRAN IV back in 1967 processing speed was the least relevant issue because we were required to take part in a procedural loop from which, occasionally, there was no escape. This consisted of punching cards, submit the cards to an operator who ran the program in batch mode, an hour, or even a day, later collect a printout, correct punching and programming errors, resubmit, and keep going around the loop until, with luck, finally escape with real results. Computing speed in this regime was effectively instantaneous. About the same time some bright spark (who would hate to be named now) invented a version of FORTRAN called PORTRAN (Poor man's Fortran) which was used by kids in rural schools with no direct access to a computer. This involved programming by using a paper clip to remove chads in blank punched cards and posting them to a computer operator in a city. I know it sounds dreadful now, but this was a wonderful thing in its time, inspiring many young minds to go further in their education. I notice that many of the contributors to the discussion remarked that Fortran is still considered useful for scientists and mathematical manipulations, but nobody seemed to understand quite why. I think the reason is simply that it remains fit for purpose. All the criticisms of Fortran are perfectly true (horrible at text processing, dreadful with graphics, inconvenient process of compiling, linking etc.), but for number crunching Fortran remains just fine. Right from the earliest days, FORTRAN IV made it really simple to do complex arithmetic (with i imaginary), matrix algebra, and advanced statistical analysis. In this respect access to the freely available IBM SSP made numerical analysis a breeze. Less than 10 years later than PORTRAN saw the advent of widely available make-your-own microcomputers with the S100 bus allowing one to simply plug in whatever card was relevant to your needs. This was instant opportunity for someone bright to upstage FORTRAN forever. But it did not happen. Instead, FORTRAN-80 was born which ran on the Z80 chip. The entire software library of mainframes became available in your own private room. I don't find it in the least surprising that Fortran is still relevant today. It began life with a strong supporting library and has evolved and adapted to remain fit for purpose. Code portability is still an attractive feature. I am still programming 47 years later, and there is little need for me to write any new Fortran code because it is already all written and running perfectly. The only need is minor manipulation of new data for the same old programs. Finally, it be plainly absurd for me to think of using Fortran for other aspects of my academic work and research, such as interactive graphics, programming hardware, and writing simulation software. Fortran is not fit for purpose here, so I use Pascal and, reluctantly C.
Its easy to pick nits in this one (and I read most of it). C might not be quite as fast as fortran, but you can get to the 'bare metal' very easily with C, and you can't do that with the others. Also you can add inline fortran into C (and have C run the fortran, compiled as tight as anything), and inline Fortran runs at Fortran speeds, then you get the benefit of both worlds. Next is GOTO. If all you can do is BASIC, then GOTO is a dirty word. Nicklaus Wirth first decried the use of GOTO because he saw newbies and neophytes using it all over the place instead of good functional programming. He insisted GOTO was from the Devil! But reality is bad. In Assembly language, there is no "While-Do" or "Do-Until". There are machine instructions like Jump and Jump-Relative, which basically loads a new address into the instruction pointer register, and that sure looks like a GOTO. Also seeing Wirth's comments, Edgar Dijkstra wrote a reply: not damning Wirth eternally, but giving some pointed remarks, causing Wirth to recant a bit. And its true, if you are a newbie, GOTO is bad. If you are a systems programmer, its hellish to write an operating system without GOTO as the data structures built within the language do not support all of the needed data structures required by an operating system (and these data structures are rarely needed elsewhere), and also normal returns from built in data structures suffer badly from timing requirements (logic races), which are problems that are *NEVER* seen by application programmers. The author takes Wirths initial view (perhaps never having read Dijkstra or Wirths recant).
A: Legacy code.
and
B. Legacy scientists.
Nothing pisses a team off faster than a young, new engineer coming in and writing code in a new language that no one else knows. No one can proof it. No one can compile it. No one understands why the new guy needs to be different. No one wants to rewrite the old programs (which have been working fine for 30+ years) in the new language.
They teach engineers C++, Java, and Fortran in school. C++ and Java so that they can learn programming and Fortran so that they can actually keep a job.
Right, the best case here would have been to write some sane fortran methods with basic unit tests, then wrap them with python ctypes calls. Viola! Everyone is happy - the CS guy that can do 'web' thing, the old school physicists that can re-use the basic, known to work, simulation code, and the new-school physicists that are doing everything in an iPython shell.
I assume: no loops?
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Sure ...
What is your problem? You invented Fortran and are now pissed? Why do you write such nonsense?
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Sigh, if you define 'big boys' by doing numeric methods ... perhaps you should get a bit more respect for the rest of the comp sci community. After all: we write the fortran compilers you are so in love with.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
ALL CAPS has been optional since 1990, at least. Fortran has had modularisation, structured code since 1990, Classes and object-orientated since 2003. Please update your prejudices.
Reminds me of a quip I heard back in the early 1980s: We don't know what language the scientific community will be using 40 years from now, but we know it'll be called "Fortran".
We might also note that the most common implementations of Fortran are now part of a package that also contains C and several other languages. They all effectively have the same capabilities, because if something isn't "doable" in one language, you can just call a subroutine in a language that makes it easy. The first-level parsers translate into a common internal language, and the modules past that level don't care what the surface syntax was.
I've seen a number of "Fortran" programs that were 90% coded in other languages. But the top-level entry-point routine was in Fortran, so the "program" was in Fortran. I once spoofed this on a project by writing an app "in C", meaning that the entry point was a C main(ac,av) routine, but everything else was in other languages. I actually used all the languages that we had "installed" in the compiler package, including Fortran. This got me tongue-in-cheek accusations of being a major geek show-off.
Those who do study history are doomed to stand helplessly by while everyone else repeats it.
The program I graduated from at a large state school in the US isn't even accredited by ABET. Seeing as how ABET is mostly known as an engineering accreditor I would expect this to be the case for many computer science degrees not part of an engineering program.
Why?
No real need for change.
New languages has niceties like "object orientation", making it easier to train novice programmers. Nice for corps that need cheap programmers for writing 'apps'.
Scientists however, are experts. The can use a more cumbersome language, if it provides more speed. And no need for "GUI" or other app-oriented features. The features of modern languages is thus unnecessary for science - raw power is what matters.
I started looking at the videos on the Julia website and kept thinking how that language reminded me of the very high level of APL but with normal ASCII characters. I remember how IBM did work on a special vectorizing APL, but it never caught on like Fortran. Julia might have a better go at it--it's pretty new, though.
Well, consider that APL was originally based on an [alternate] mathematical notation developed by Kenneth E Iverson.
BTW, I was writing APL programs in 1972 [and I already knew Fortran] ... The real problem with APL, aside from needing an alternate keyboard, was that the equations were so dense that proper commenting was difficult. And, if you did proper commenting, it broke up the equations, defeating the purpose ...
Like a good neighbor, fsck is there
So, Fortran issues extra instructions and pipeline stalls for accuracy, yet manages to be faster.
That is amazing!
It's faster in areas not involving floating point, and in floating point on hardware that has a good floating point implementation.
It's easier to branch-predict fortran code, and the lack of pointer support makes the boolean algebra a lot simpler for the complier. Given the calling conventions and limits, it's actually a lot easier to optimize fortran, and given that oist matrix math involves linear loops, it's easier to autovectorize things like the Berkeley Physics package. E.g. if you are attempting to do montecarlo simulations of P-P and N-P collisions in a relativistically invariant reference frame while simulating pair production events constrained by the matrix solution to the intersection of multiple Feynman-Dyson diagrams, it will almost universally run faster if the code is in FORTRAN.
That's just for the keycaps. You have to buy the rest of the keyboard separately (for something like $100).
I run a Unicomp Ultra Classic keyboard. It cost $80, and is worth at least twice as much. Try one out someday.
Also "legacy training". Student learns from prof. Student becomes prof. Cycle repeats.
Also Fortran didn't stagnate in the 60s, it's been evolving over time.
Other languages are highly optimizable too. However most of the new and "cool" languages I've seen in the last ten years are all basic scripting languages, great for the web or It work but awful for doing lots of work in a short period of time. It's no mystery why Fortran, C/C++, and Ada are still surviving in areas where no just-in-time wannabe will flourish.
Do not drag genuine JIT/intermediate bytecode compiling languages through the mud by grouping them with scripting languages. AFAIK there is no cool language that is ever compiled, JIT or not.
First, my comment wasn't generally about whether C or Fortran is better.
I just just illustrating that C's aliasing isn't as much as an obstacle for vectorization as it's often said (and I probably said so in the past, so I'm also guilty).
In general, Fortran arrays and slicing map to pretty trivial C code. Most people can write decent stuff for that. Getting it to vectorize isn't hard.
Secondly, AFAIK, arrays and array slices in Fortran need to be used with a bit of care.
In some situations it can lead the compiler to copy the data into a temporary array (eg, passing a slice as a function parameter).
Another issue is that in a array with 2 or more coordinates, only one coordinate has a memory layout suitable for vectorization in a CPU without scatter/gather (which you may want to avoid anyway if seeking ultimate performance).
Dealing with this issues requires a good understanding of these issues, the language and the compiler's modus operandis.
Fundamentally, arrays in any language are trivial when at the microscopic language but choosing the right strategy for the full program can be a challenge in any language.
Third, having spent more time that I'd like trying to hammer into a few scientists that you need to avoid loops and use array operations to get good performance out of MATLAB®, I would say that some scientists' brains are better suited to hand writing loops than array manipulation.
"Don't listen to APK. He's trying to sell his particular brand of snake-oil. Let's face it - he's just out to substitute his (proprietary, non-standard, non-best-practices) method for DNS." - by mmell (832646) on Friday May 02, 2014 @03:42PM (#46902201) FROM http://tech.slashdot.org/comme...
Per my subject-line: It's that, or you're brain-damaged & can't remember what you said this past week only a day or so ago quoted above!
Now, you're saying THIS BELOW quoted instead?
"why would I want to "disprove 17 points of fact on great benefits using a hosts file gives users in added SPEED, SECURITY, RELIABILITY, & even ANONYMITY"? I never once argued that hostfiles have no place in modern IT infrastructure, home computing infrastructure or even modern computing - nor did I ever say or even imply that any of those points (tl;dr) are untrue." - by mmell (832646) on Saturday May 10, 2014 @04:23PM (#46968547)
"?"
"Satan turns to Christ" trying to play "innocent"?? Please...:
(THAT above's on top of calling my app a malware repeatedly & it's the FARTHEST THING from it, saying I am selling it too? Sorry - learn to read: IT IS FREE!)
* Get real!
(The "trying to play innocent here" or "victim" type b.s.? Come on... really/seriously! Lmao... you're unbelievable -> http://www.youtube.com/watch?v... )
APK
P.S.=> THIS seriously "takes the cake" from you, especially AFTER the above:
"I've been very direct in pointing out your behavior is the problem - behavior which can only have originated in the mind of a terribly hurt and abused little boy." - by mmell (832646) on Saturday May 10, 2014 @04:23PM (#46968547)
Speak for yourself & as was said to you before? Quit "projecting"... & answer this question -> http://slashdot.org/comments.p...
Which is yet another you 'evaded' with troll maneuvers of which the ABOVE TAKES THE F'ING CAKE for nerve (lol, you won't)
That's the compiler, not the language. IEEE-754 wasn't published until 1985, so the older [1977] spec doesn't say anything about it.
In any case, if you care about the difference between 80-bit extended precision and IEEE double precision, then you're either writing a compiler, dealing with an extremely stiff differential equation, or [most often] have made a poor algorithm choice and are trying to paper over algorithmic instability by throwing more bits at it.
-JS
no, I mean those who run very large models - lattice guage theory, quantum chemistry of proteins, astrophysical fluid dynamics
Why reinvent the wheel?
Fortran 2003 has ISO_C_Binding for complete access to the C library functionality.
So you definitely have file and network I/O available in Fortran, much as you have in C.
This might not in itself be reason to use Fortran; however, Fortran does have many interesting properties, which may enable writing code for numerical and computational algorithms that in the real world will run faster than even C code.
I once worked on a CDC Cyber 170/750, where you could not have spelled it Fortran. That's because it had a 6-bit character encoding system, with room for only upper case letters. (Ok, you could have printed in all lower-case letters, but the line printers only had upper case letters.) It was originally designed for numeric processing, so who needed a case distinction? Hence FORTRAN. Then someone actually hacked it to allow both upper and lower case letters: a slash before any alphabetic character meant the lower case version of that character. Luckily, they also hacked the text editor to display '\A' as 'a' etc. And I wrote my linguistics dissertation on that system. This was in 1984.
Real APL programmers don't need a special keyboard. They just use a keymap and remember where all the symbols are.
Awww... That's why it's funny. You fail at humor.
Yes... and here is where we enter into the kinds of optimizations that -O3 does with gcc.
Fortran compilers don't even try, however... with appropriate optimizations enabled, it always assume that it will never happen, unless you are explicitly using a union type, which almost invariably results in faster code, end will 99 times out a hundred exhibit the behavior that the code author expected, except in a case where different object pointers might overlap in their content, where the behavior is defined by the implementation and the author can exploit this fact to achieve certain techniques that more resemble assembly language optimization than high level coding. C allows this, Fortran does not... but allowing it comes as a performance cost.
File under 'M' for 'Manic ranting'
That's the compiler, not the language. IEEE-754 wasn't published until 1985, so the older [1977] spec doesn't say anything about it.
In any case, if you care about the difference between 80-bit extended precision and IEEE double precision, then you're either writing a compiler, dealing with an extremely stiff differential equation, or [most often] have made a poor algorithm choice and are trying to paper over algorithmic instability by throwing more bits at it.
-JS
Or I want reproducible results. It's one of the reasons that, if you are using a PRNG as an input to a montecarlo algorithm, that you want to seed it the same way each time, and you probably want to carry around your own PRNG, rather than trusting that some idiot didn't change drand48 to "make it have better entropy", rendering your computations non-reporducible.
It turns out that in Science(tm), being able to reproduce someone else's results independently ends up being "kinda important".
Also (according to the professor who taught my advanced mathematics course), FORTRAN compilers are easy to trick into doing exactly what you want in Assembly. In languages like C, it's apparently much more difficult to predict what the compiler will end up spitting out, but in FORTRAN they are (or were - my prof's experiences with FORTRAN date back to the 80s) able to pretty much able to optimize the actual Assembly quite well without actually needing to touch Assembly...
I found that tidbit quite interesting...
I think we're now in agreement.
Apparently despite lots of Karma, however I can't send this message without waiting 5 minutes.
SJW n. One who posts facts.
Thanks for sharing the story of PORTRAN: that's really interesting history that I'd never heard before (I'm the author of the OA).
Mmell - my program PROTECTS YOU vs. malware (if it does anything) for FREE by essentially using the principle of the forcefield really in "What you can't touch, can't hurt you",,, & yes it works.
Hairyfeet (/. user) can tell you the same!
In fact - He & I "had it out" on hosts files vs. DNS!
(Until I pointed out downsides of it vs. hosts such as the fact hosts can cure its problems - redirects by Kaminsky flaw since 99.999% of ISPs aren't patched vs. it oddly even though a patch has been around for more than 1/2 a decade++ now, & vs. "FastFlux" &/or Dynamic DNS using botnets + power consumption, CPU cycles, RAM, & other forms of I/O too being less with hosts along with electricity consumption).
So, He went to AdBlock & noticed his customers (owns a PC repair shop) didn't get infected anymore - & hosts do a FAR BETTER JOB of protecting you not only vs. ads, but also vs. known sites-servers/hosts-domains serving ads AND malicious content too!
(Hosts do more for the end user in added speed, security, reliability, & anonymity @ a faster level of operations BEFORE browser addons even BEGIN to operate!)
That's ALL I wanted to hear from yourself & the "beatings will no longer continue"...
* At least YOU'RE man enough to admit you did it out of anger + made a mistake... I'll give you that!
(However - DO *try* to see MY "pov" here, that's all - & yes, there are 2 more guys on this board I am pressing who OUTRIGHT said my app was a "malware" & it's DEFINITELY not!)
APK
P.S.=> PER MY SUBJECT-LINE ABOVE:
Write Mr. Steven Burn of Malwarebytes' hpHosts website here http://hosts-file.net/?s=Downl... & he can verify that APK Hosts File Engine 9.0++ 32/64-bit http://start64.com/index.php?o... is CLEAN, no threat & free of malicious content (heck - it's a portable app, & doesn't TOUCH your OS other than hosts itself)... apk
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
Ask him to show he's coded a program that did well enough to become commercially sold. Go on, ask. You'll get back zero from that zero since he's ALL talk, nothing more.
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
+5's on his posts = sockpuppets use (mods himself up, & detractors down). This site's full of pigs that do that. His "kind" (online scum) truly have no shame. The little jackass posts utter bullshit and yet when confronted to show he's actually done any programming? You see him down mod those posts to "hide them" (or so his deluded mind thinks).
I'm still kicking myself for giving up my Tandy Enhanced keyboard (I donated it to Goodwill when I was a teenager and didn't know any better)... : (
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
Only 8 arguments, I've seen monstrosities with > 20 arguments all with 2 or 3 letter names.
Ixnay on the atinlay
Star Trek transporters are just 3d printers.
Don't forget Fortran 66's handy capacity to use constants as variables. You could say 1=2 And from then down in the code 1+1 would equal 4. That was pretty handy, although only when you wanted to play a mean joke on somebody.
Star Trek transporters are just 3d printers.
One reason is that, unlike other languages, you have control over the order of operations in a formula. This is important when executing the operations in the wrong order will cause an overflow. For example if A, B, and C are very large, (A - B) * C would give an overflow if executed as A*C - B*C. Whereas (presumably) D = A - B, then D * C would not. Some languages will " optimize" these statements and thus cause overflow.
I always liked Fortran because it was very straightforward for soling mathematical equations. Way back in the 60's I wrote Fortran programs to solve differential equations, very easily without any programming training of any type. I wrote the programs to verify the results of my slide rule calculations and was pleased that my slide rule results were accurate three places to the right of the decimal, which means splitting a small space between marks on the ruler mentally into the correct fraction of the hair line position in that space. So I can see why scientists would still use Fortran.
I won't spampost here, nor will I post stalk you - but if I see you using these techniques, I will respond directly. "The beatings will no longer continue"? We'll see. I am aware of your point of view in this; however, I have no intention of tolerating your abuse of the Slashdot bulletin board. If I have made a mistake (and I have) I am prepared to correct it. I insist you do likewise.
The beatings may or may not continue at your discretion, of course. However, I reserve the right to respond to what I perceive clearly to be an abuse of this forum - and I still find your abuse of this forum to be intolerable. My analysis concludes that you are in fact a fairly good programmer and have written several quite interesting pieces of software. However, your inappropriate marketing techniques (offtopic "spam" posts of your advertisement for your software, immediate and vociferous post-stalking of anyone who posts a negative opinion of you, your posts or your software) are irremediably attached to the very software products you're attempting to promote.
I will not knowingly download or use software you've written, specifically because you have demonstrated here in this forum that you are neither stable nor trustworthy. I don't know you and can't say personally whether or not this is accurate, but it is a perception which I (and apparently several other Slashdot readers) have formed based on our experiences with you here. There is a parallel - the Reiser Filesystem was once a widely noted and even commercially adopted piece of software - right up until Hans Reiser was convicted of murder. The quality of RFS no longer matters, even though Hans Reiser is no longer directly involved with it. The reputation of RFS is now irreparably sullied. Your reputation and software are not as badly off. Begin behaving yourself and find another mechanism for advertising - you will find that even her at Slashdot, people will respond to that. Even in your post above you have proferred an olive branch, but accompanied by another pitch for your hostfile manager (yes, I know - it's a non-trivial piece of work which provides data normalization for hostfiles as well as several useful functionalities). Offtopic posts are not a reputable mode of behavior. It's still shilling. Is this truly an offer of peace, or just another chance for self promotion?
Dear father-in-law, I am very proud to see you write here! ;)
echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
I'm scientist and fortran IS legacy code. No one younger than 40 yo can stand reading fortran code anymore. New projects start with C/ C++ (or python if speed is not a concern). CERN converted almost all of its libraries or programs to C/C++, other labs are doing the same. If Julia is gonna be THE language of the future in science only time will show us.
"Initially, I maintained a more neutral stance" - by mmell (832646) on Sunday May 11, 2014 @02:51PM (#46973999)
NOT very "neutral" & VERY WRONG - I work WITH DNS fixing its faults in security actually (only keeping top 50 sites I like @ the TOP of my hosts file - to offset index loss on large hosts & it works - the rest IF/WHEN I miss a lookup = OpenDNS (rare since 95% of my time online IS in my favs hostsfiles hardcoded)) - http://tech.slashdot.org/comme...
(THAT was the 1st time I have EVER seen YOU reply, to me...)
---
"You have also been spamming Slashdot, often posting your personal advertisement for your software in threads where it is completely inappropriate" - by mmell (832646) on Sunday May 11, 2014 @02:51PM (#46973999)
Show me once where I've posted where hosts don't apply when I posted... Clue: I ONLY POST where hosts fix things or do a better job than competitors & ONLY after they post first (usually Adblock or Ghostery, both 'souled out' & INFERIOR).
---
I have no reason to continue... you were man enough to say you said my ware = malware out of anger, I can forgive that... but?
YOU BROUGHT IT ON YOURSELF (see link above).
APK
P.S.=> Good day... apk.
Oh please just fuck off and take your meds. I'm sick of having every thread on this site polluted by your script-posted rants.
It's funny how we call code legacy yet there is no such thing as legacy math.
And optimization has a lot to do with why Fortran is still used, and preferable to c/c++ in many cases.
Fortran can make some strong assumptions that it uses for optimizations. It is not as general purpose as c, for which those assumptions might or might not be correct. Yes, you can do nearly anything in either language, but some will be easier to do in one, and some in the other.
Expecting c to smash arrays into one another as well as a language designed for that purpose is silly--as would be expecting the time it takes to code in the more general purpose language to be comparable to the custom language.
hawk
Nice answer but I work in a space lab and more new code is written in Fortran than every other language put together.
It works. That's the main reason. We have people who can write in multiple languages, but the language of choice for most heavy lifting is Fortran.
The cure for this kind of inanity is a slap around the head and telling them it isn't going to be accepted until it's readably documented.
There's a lot of whining when they get told this, but aftee a few rounds they tend to get into the habit of documenting as they go.
I think that it comes down to usability, and the simplicity of the language.
I have used both FORTRAN 66 and FORTRAN IV. The difference between the 2 are significant. Since then have come FORTRAN 77, FORTRAN 90, FORTRAN 95,
FORTRAN 2003, AND THE CURRENT FORTRAN 2008. There is a lot of code and subroutine libraries written in FORTRAN which keeps FORTRAN alive. There were various variations on the listed versions of FORTRAN also. I expect FORTRAN to outlast me.
My son (2nd-year Physics undergraduate at the University of Surrey) is in the last generation to be taught coding using Fortran. This year's intake went straight to C++.
Why are you telling me? Do you have a point to make?
Scientists tend to stick with what works instead of what's new.
that's how it's spelt now, not "FORTRAN"
I'm actually more interested in how the world "spelt" is spelled.
Oh please, Esperanto was invented for completely different reason: for quick learning. Esperanto is just the BASIC of second languages.
Show me a post on /. where my posting on hosts didn't apply. Pretty simple (obviously, you can't, & that's that).
APK
P.S.=> There's NO WAY you fools can win here: Get THAT thru your heads - I have you outthought, outsmarted, & yes, "outed" easily by facts + truth I state that YOU cannot get the better of - period!
... apk
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
You say you're sick? Take your own advice (and your meds) & quit projecting!
From a fair challenge like a chickenshit blowhard http://slashdot.org/comments.p...
"Shutdown code, rejected: My programming ( http://start64.com/index.php?o... ) has advanced beyond YOUR commands: Beyond YOUR weakness" - Ultron 6 FROM -> http://www.youtube.com/watch?f...
* Not a thing you can do vs. it - & trolls most CERTAINLY can't disprove my points on hosts files giving users added speed, security, reliabliity, & anonymity online!.
(You know it, I KNOW IT - Anyone with 1/2 a brain on /. the past 2 yrs. does also, seeing you trolls harass me to no end - only to end up with EGG ON YOUR FACES!)
APK
P.S.=> Why you'd troll me used to boggle my mind. It's a good program that does the job & offers the benefits I enumerate in its download link. HOWEVER - It doesn't boggle my mind anymore why you trolls do:
You're malware makers/botnet masters (I block them refreshed daily from 12 reputable & reliable sources in the security community), advertisers (I block their ads which steal speed you PAID for & infect you with malicious scripts + track you), inferior competitors (Ghostery/AdBlock/RequestPolicy), or webmasters (Pissed I block ads - they're being exploited + I held off on letting my app out (not anymore after that)) & it isn't "Souled-Out" INFERIOR (Adblock & Ghostery) & it shores up security faults in DNS & speeds up resolution of your fav. sites hardcoded in it (faster than remote DNS lookups + secures you vs. DNS request logs + DNSBL)
.. apk
For being an offtopic illogical ad hominem attack using troll: See post parent to this http://slashdot.org/comments.p... as it says it all. You can thank K.S. Kyosucky for it.
I might ask why everyone is still using some variant of the C programming language...it was developed in the 60s!
Why is everyone else still using C? It is 40+ years old.
If you haven't seen or used modern Fortran and think it's anything like Fortran 66/77 then you're mistaken.
As Seymore Cray said, when asked what the scientific programming language of the 21st Century would be, "I have no idea what it will look like, but I'm sure it will be called Fortran."
Even better is to use matrices in native form, as in (x')*A*'x meaning the vector x, the matrix A and quadratic form thereof. Very handy for teaching n-dimensional minimization (hint, take the deriviative of the term). How to write that in a formula translation language is the trick, we used t() to get the transpose, explicit typing to ensure A was a matrix and x a vector, etc. Fortran is a pretty handy form but it did not let us redefine operators like * back in the day. Now I am in R, so cannot really comment on modern Fortran.
"There is no god but allah" - well, they got it half right.
Yes, until the compiler changes the interior of a loop thinking it was doing it right. We were engineers doing orbital mechanics, did not pay attention to the switches on the compiler, it took a greybeard who looked at our core dump (remember those?). He spotted that a line of code had been moved outside of the loop because it did not look like it was necessary to have it inside. I think the function call used used a pass by reference variable that was being changed within the function. The optimizer did not see that change so it made sense to call the function just once outside the loop. Maybe I have detail wrong (it was back in 1978 or so), but the fact that the optimizer goofed has made me suspicious of these sorts of promises ever since.
"There is no god but allah" - well, they got it half right.
About 11 years ago I was working at Sun Microsystems working on getting patches to customers from legacy compiler engineering for escalated bugs against FORTRAN and CC++. I know that sales of the compilers exceeded $1 Million a year even though Sun was giving Java away for free and not competing very well with its IDE against IBM and others. I hadn't coded in FORTRAN for about 15 years at that point and had to learn about developments in the language while I had redirected me experience to C/C++. and I was surprised by the demand, but quickly learned that our customers liked FORTRAN because of the overall performance of legacy numerical analysis libraries. It would be interesting for people at Oracle to comment on this.
Fortran, apart from being a brilliant language for numerical math, has the added benefit of keeping CS graduates at bay. I'd rather have a physicist who can't program, than a CS type who can.
The problem was not the CS major, it was hiring a fool right out of school to run a project that large. He may grow out of being a fool, most do. But not yet.
I hope you don't assign your Physics students that way...
It is much easier to describe complex mathematics in Fortran and the resulting executable is faster than C.
Perhaps OCaml can come close but I doubt it.
Everything in computing is mathematics.
All computers are turing machines. All computer programs are a Turing machine.
Turing machines are mathematical and equivalent to lambda calculus which of course is math.
Latin was the one language that all academics shared.
...you mean, those who didn't speak Hebrew, Greek, or Arabic?
Actually, the Arabic scientists of the time -did- speak Latin, Greek and other languages, and so did most of the Hebrew or Greek ones. But the Euroupeans did not generally speak Arabic.
ALL CAPS has been optional since 1990, at least.
Fortran has had modularisation, structured code since 1990, Classes and object-orientated since 2003. Please update your prejudices.
...modularisation, structured code since Fortran IV, about 1973 (?). FTFY...
Learning Latin is a great mind building exercise.
So is learning Mandarin - and a bit more useful. ;-)
"Flyin' in just a sweet place,
Never been known to fail..."
I will be able to, no?
Who do you get to be an expert to tell you something's not obvious? The least insightful person you can find? -J Roberts
You are right that aliasing is one of the main differences. But Fortran compilers, like all other (real) compilers, are concerned with correct output first and foremost. It's not that they don't care about producing correct output, it's that they can safely make certain assumptions that C/C++ compilers cannot.
Fortran compilers have the edge over C and C++ compilers because, among other things, the Fortran language has certain constraints on things like arrays passed as parameters, which allows the Fortran compiler to safely perform some optimizations that the C/C++ one's can't because C/C++ allows more things to be aliased. Aliasing introduces uncertainty which restricts optimization, and it's not always possible to remove those uncertainties.
The other big reason is that many Fortran libraries have been tuned far better than C/C++ equivalents, and so when concerned about speed for a certain domain of problems, using the highly tuned Fortran ones is a no-brainer. Additionally, sometimes there is no C/C++ equivalent library, so productivity-wise Fortan can also be the obvious choice.
Disclaimer: I worked for 17 years on C/C++/Fortran/JIT compilers for IBM.
It's a matter of the right language for the job. Better than a language that tries to do everything.
Any commercially sold code you can show us you did?? Downmodding it to hide it before was low!
Your statistical model is only correct with one specific set of random data?
People do write large scale numerical code using functional abstractions, automatic vectorization, pipelines, data flow, and all that. There are excellent libraries for those purposes for both C++ and Fortran.
The reason people still stick to C++ and Fortran rather than going to a fully automatic system is threefold. First, it isn't necessary: modern versions of C++ and Fortran already have all the necessary high level support; except for an unfamiliar syntax, Nile doesn't add any functionality. Second, there is tons of legacy code that people want to interoperate with easily and without much hassle; switching to a new language with new conventions makes that hard. Third, with tools like Nile, sooner or later, users hit cases where the automated tools don't work anymore, and then they have to go back to figuring out how to link in C/C++/Fortran anyway.
Language and systems people often have the notion that numerical and parallel software developers do what they do out of ignorance, when in fact it's a rational decision to stick with the tried-and-true existing languages and tools. When improvements are needed, they need to be made incrementally and in a backwards-compatible fashion, and that's how they are happening.
You assume incorrectly that these are "lessons" people working in these areas don't already know and still need to learn.
On the other hand, you'll find that actually implementing something like Nile correctly and efficiently is extremely hard; so hard, that by the time you're done, the world has already moved on to other tools.
That may or may not be true, but either way, it's a language-independent problem.
If anything, scientists are a lot more likely to use OOP in Fortran because it's a lot more straightforward to use than in C++, while providing much of the same power, and often better performance.
Since almost all hardware can run compiled Fortran code why not keep it if you have lots of legacy stuff that rarely gets reprogrammed. I am a CS grad but my consultant experience shown me that "upgrading" is not always the best thing for my clients. I would say if an upgrade was required that the perfect language to go to is C, not C++, and migrate it faithfully, not using the latest hot CS trend because in such programs reliability is job one. If you can't rely on the migrated program then the migration is a complete failure, as you witnessed.
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
"I never once argued that hostfiles have no place in modern IT infrastructure, home computing infrastructure or even modern computing - nor did I ever say or even imply that any of those points (tl;dr) are untrue. I've been very direct in pointing out your behavior is the problem - behavior which can only have originated in the mind of a terribly hurt and abused little boy." - by mmell (832646) on Saturday May 10, 2014 @04:23PM (#46968547)
No, you fucking liar? See above, & see your UTTER LIE shown for what is really is, next below:
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
THEN?
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE http://slashdot.org/comments.p...
?
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS etc. too? Please -> http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
ROTFLMAO http://slashdot.org/comments.p... You're a fool that projected his own modus operandi doing it no less.
ROTFLMAO http://slashdot.org/comments.p... You're a fool that projected his own modus operandi doing it no less.
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE - "EATING YOUR WORDS" http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE - "EATING YOUR WORDS" http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE - "EATING YOUR WORDS" http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE - "EATING YOUR WORDS" http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE - "EATING YOUR WORDS" http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE - "EATING YOUR WORDS" http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE - "EATING YOUR WORDS" http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk
Saying I use hosts to evade police while I surf little boy porn http://slashdot.org/comments.p...
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (1 of 2)
Libeling me saying my WARE IS A VIRUS http://slashdot.org/comments.p... (2 of 2)
THEN RECANTING THAT LIBEL HERE - "EATING YOUR WORDS" http://slashdot.org/comments.p...
?
ERRONEOUSLY saying I was creating a DNS replacment (which it's not, it shores up DNS redirect security issues & resolves FASTER locally in RAM vs. remote lookups) -> http://tech.slashdot.org/comme...
Saying VI can do all my APK Hosts File Engine can do (not) & running -> http://slashdot.org/comments.p... when VI can't?
* Please... lol!
APK
P.S.=> You have SERIOUS issues - get over your ''geek angst" already (you're not even much of a 'geek' based on your technical screwups above)... apk