LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-22-2017, 02:16 AM   #1
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
FORTRAN? Any reason to learn it?


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?
 
Old 06-22-2017, 05:54 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
If you're specifically going to be involved in programming for large-scale scientific or mathematical computations, then yes.

http://www.moreisdifferent.com/2015/...l-use-fortran/

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?
 
Old 06-22-2017, 06:07 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

Rep: Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321Reputation: 7321
probably you will find these interesting, although you can look for other pages too:
https://www.cfd-online.com/Forums/ma...c-fortran.html (more than 10 years long discussion)
https://stackoverflow.com/questions/...-analysis-thes
 
Old 06-22-2017, 06:11 AM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,685

Rep: Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713
Quote:
Originally Posted by Laserbeak View Post
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.
 
Old 06-22-2017, 08:05 AM   #5
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Original Poster
Rep: Reputation: 143Reputation: 143
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?
 
Old 06-22-2017, 08:10 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
I first learned FORTRAN in the seventies - even used it occasionally. Never used it since, certainly not in any commercially useful sense.
YMMV.
 
Old 06-22-2017, 09:37 AM   #7
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,340

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by Laserbeak View Post
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.

-------------------
Steve Stites
 
Old 06-22-2017, 09:45 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Quote:
Originally Posted by jailbait View Post
C is far superior to FORTRAN for I/O
???? - thems might be considered fighting words by some.
CERN f'instance maybe.
 
Old 06-22-2017, 09:45 AM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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.
 
Old 06-22-2017, 10:24 AM   #10
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,784

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by jailbait View Post
C is just as good as FORTRAN for mathematics.
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)
 
Old 06-22-2017, 10:27 AM   #11
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,332
Blog Entries: 3

Rep: Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727Reputation: 3727
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.
 
Old 06-22-2017, 04:00 PM   #12
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,242

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
No. The scientific community has largely moved to other languages such as Python.
 
1 members found this post helpful.
Old 06-22-2017, 06:35 PM   #13
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
https://docs.oracle.com/cd/E19205-01...vcv/index.html has many refs to SSE, fyi if that's the compiler you 'unearthed'
But +1 #12. Too bad your Solaris doesn't have APL R?
 
Old 06-22-2017, 10:52 PM   #14
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 529

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by Laserbeak View Post
I've translated from FORTRAN to C before, ...
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 View Post
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).
 
Old 06-23-2017, 12:25 AM   #15
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Original Poster
Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by !!! View Post
https://docs.oracle.com/cd/E19205-01...vcv/index.html has many refs to SSE, fyi if that's the compiler you 'unearthed'
But +1 #12. Too bad your Solaris doesn't have APL R?
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.

Last edited by Laserbeak; 06-23-2017 at 12:31 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fortran 77 stf92 Programming 6 06-29-2010 11:49 AM
fortran vivekmadhav007 Programming 4 03-15-2009 07:00 AM
g77 in gcc 4.1.0 not found only gfortran fortran 95 compiler! I need fortran 77. TheBrick Linux - Software 3 07-04-2007 06:39 AM
Gnu Fortran versus Intel Fortran tomatoefish Linux - Software 3 02-20-2006 01:31 PM
does linux fortran compiler in fedora 4 support VAX FORTRAN? terrence Programming 17 08-31-2005 08:59 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration