ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I already know C/C++/Obj-C pretty well, is there any compelling reason to try to learn FORTRAN? Is it really better at mathematics than the aforementioned languages?
It's fairly niche however. If you're wanting to learn something purely for interest's sake, then why not try something like Julia or Go which are both "up and coming".
I suppose the question has to be - for what purposes are you wanting to learn another language?
I already know C/C++/Obj-C pretty well, is there any compelling reason to try to learn FORTRAN? Is it really better at mathematics than the aforementioned languages?
In answer to the second question: how strong are your math skills? FORTRAN can do matrix mechanics better than anything, which gives it the power to solve problems that humans would resort to advanced calculus to solve. If you needs to solve massively complex sets of simultaneous equations to predict orbital trajectories, weather patterns, or solve some problems involving quantum mechanics then FORTRAN on a supercomputer is the way to go.
It was the first programming language I learned, and still makes the most sense to me (most other languages have a crippled test for 'if'). Where it applies well, nothing else can compare to the performance it provides. If, however, you really have no need of that kind of power it is wasted time. The market for FORTRAN skills is small and very specialized and it is unlikely to enhance your career. If you are learning for fun or to enhance your mental skills it is one good option. If you are looking at general computing, perhaps not.
I've translated from FORTRAN to C before, but never actually wrote it. I probably don't need it, but I just installed the Sun Compiler Workshop and it includes FORTRAN so II was just really musing.
Does its built-in support for matrices make SSE programming easier?
I already know C/C++/Obj-C pretty well, is there any compelling reason to try to learn FORTRAN? Is it really better at mathematics than the aforementioned languages?
FORTRAN is no better at mathematics than C. However FORTRAN was the first computer language to make mathematical notation easy to code. Over time scientific and mathematical programmers have built a large pool of FORTRAN subroutines which solve complex mathematical problems. If you are going to work on programs which solve complex mathematics problems and you have access to a good FORTRAN scientific subroutine pool then by all means learn FORTRAN and use the existing code.
If you are going to work on programs which solve complex mathematics problems and you have to do all of the work from scratch then use C. C is just as good as FORTRAN for mathematics. C is far superior to FORTRAN for I/O, entering data, and printing reports. Trying to print a readable report in FORTRAN will drive you up the wall.
FORTRAN is still used heavily in the scientific and modeling communities. Large atmospheric models were written in FORTRAN decades ago and are still being used/modified today. If you plan to go to NCAR/UCAR or work with any of their models or similar models, it's a valuable skill to have. I know it, I use it pretty regularly, but I'm more of hardware person rather than software so I prefer to let other people do that kind of work. It's hard to find capable people though.
I've read that because of the way C allows aliasing and pointing to parts of arrays, C compilers are sometimes less able to optimize functions handling large matrices compared to FORTRAN compilers. (never used FORTRAN myself though)
I was just asking someone about this last week as they have lots of experience with both C and FORTRAN, among others. Their answer was that FORTRAN is faster than C even, when well writen.
In addition to the other areas, it is used in physics.
I think that could be a good reason to learn a little FORTRAN. I use some old FORTRAN library functions that are reliable, simple, and compact. I translated them to C, GO TO statements and all.
By the way, I wouldn't mind getting rid of the GO TO statements, but how the heck do you do that with staggered loops, like this?
Code:
10 CONTINUE
some code
20 CONTINUE
more code
GO TO 10
still more code with a test: IF (condition) GO TO 30
GO TO 20
30 CONTINUE
It must be possible, but I haven't figured it out
Quote:
Originally Posted by dugan
No. The scientific community has largely moved to other languages such as Python.
I like Python, with C extensions for speed (including those functions translated from FORTRAN).
I started using Sun Workshop for like almost 20 years now, we had it at the company I first worked for. For some reason the powers that be decided they'd rather spend 1000s of dollars for licenses for that than use gcc since they didn't trust it for mission critical proprietary applications. Of course back then they didn't even have SIMD vector programming and it was all SPARC and UltraSPARC.
I think around that time Intel first came out with MMX which isn't that great. AltiVec on the PowerPC G4 came later and was much better.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.