Why do you need FORTRAN, C, C++ for physics

  • Context: C/C++ 
  • Thread starter Thread starter Superposed_Cat
  • Start date Start date
  • Tags Tags
    C++ Fortran Physics
Click For Summary

Discussion Overview

The discussion revolves around the necessity and relevance of programming languages such as FORTRAN, C, and C++ in the field of physics and scientific computing. Participants explore the historical context, applications, and evolving preferences for programming languages in scientific simulations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants question the necessity of knowing FORTRAN, C, or C++ specifically for scientific applications.
  • One participant notes that FORTRAN was developed for scientific applications, while C became popular due to its use on Unix machines and its ability to serve as a cross-platform assembly language.
  • Another participant explains that C++ built upon C by introducing object-oriented concepts, becoming a preferred choice for certain applications.
  • There is mention of MATLAB and Java emerging as popular languages for simulations, with MATLAB being favored by engineering students and Java being easier to learn than C++.
  • Some participants express skepticism about MATLAB and Java's suitability for scientific computation, citing MATLAB's proprietary nature and Java's perceived limitations.
  • One participant suggests that the future of Java may be influenced by languages like Scala, which offer different programming paradigms.
  • Another participant argues that many engineering firms prefer MATLAB due to its extensive libraries and support, despite its cost.
  • Concerns are raised about the limitations of MATLAB and Java compared to other languages like Mathematica and the potential for these languages to dominate the field.

Areas of Agreement / Disagreement

Participants express a range of views on the relevance and effectiveness of different programming languages for scientific computing. There is no consensus on which languages are superior or more appropriate, and multiple competing perspectives remain throughout the discussion.

Contextual Notes

Participants reference historical developments and the evolution of programming languages without resolving the implications of these changes on current practices. The discussion includes varying opinions on the effectiveness of proprietary versus open-source solutions and the impact of language choice on scientific work.

Who May Find This Useful

This discussion may be of interest to students and professionals in physics, engineering, and computer science, particularly those exploring programming language choices for scientific applications and simulations.

Superposed_Cat
Messages
388
Reaction score
5
Okay I get that FORTRAN was made for science and C AND C++ are fast but why do you have to know one of them? (or so I heard). Thanks for any help.
 
Technology news on Phys.org
Why do you need more than just a hammer in your toolbox?
 
the and was supposed to be lowercase sorry. But I meant why those specific languages?
 
FORTRAN came about first for scientific applications and later COBOL was developed for business.

C was the defacto language for Unix machines and was being used as a cross hardware platform assembly language as newer CPUs came on the market. At one time, Unix machines had a feature that would take C source code transmitted over the network, compile it and update the executable, saving it wherever you wanted which was subsequently disabled when a college student created one of the first worms that infected 6000+ machines (http://en.wikipedia.org/wiki/Morris_worm).

C++ piggybacked on C (and literally too: where code was translated by the CFRONT program from C++ into C code and then compiled) introduced OO concepts to the UNIX world and became the preferred choice over Objective-C which was proprietary at the time and SmallTalk the first OO language.

SmallTalk while popular in OO research wasn't adopted for mainstream OO due to the limitation of coding in an IDE like environment where you could change anything in the SmallTalk core and where you had to export the whole workspace to someone else's machine for them to run your program. and they in turn had to import it and hope it didn't change something they had altered.

Given those choices FORTRAN, C and C++ survived to the present day.

So if you were writing a computer simulation of some physical problem you'd choose FORTRAN because of the large body of supporting libraries. Later as Unix got more popular you would choose C because it was available on more machines more so than FORTRAN. If you were a CompSci person you'd write it in C++ for greater modularity.

ADDENDUM: Matlab and Java are now taking over as the preferred languages for simulation. Matlab is primarily used by engineering students who then want to use it when they get a job (smart marketting on Matlabs part).

Java for many reasons: students learn it, its easier to learn than C++, runs cross-OS and cross-HW including Android HW has a lot of library support including the Open Source Physics library of methods and ODEs.
 
Last edited:
  • Like
Likes   Reactions: 1 person
Thanks
 
jedishrfu said:
ADDENDUM: Matlab and Java are now taking over as the preferred languages for simulation.

Yeesh, let's hope that's not true. Matlab is proprietary and Java is ill-suited to scientific computation.
 
Daverz said:
Yeesh, let's hope that's not true. Matlab is proprietary and Java is ill-suited to scientific computation.

but it is true...

and the future of Java appears to be heading toward Scala and its syntactical sugar, scriptability and its model of OO + Functional Programming...
 
jedishrfu said:
but it is true...

and the future of Java appears to be heading toward Scala and its syntactical sugar, scriptability and its model of OO + Functional Programming...

Good, all the new JVM languages (Scala, Clojure, JRuby, etc.) will allow some of the good parts of the Java ecosystem to survive (the JVM itself*, the "cross-platformness") while marginalizing the fundamentally broken part: Java the language.

* Footnoted because one can definitely make the argument that the JVM class loader is a bit of a disaster.
 
I would have thought that mathamatica and fortran/c++ would be more popular than java+matlab. MATLAB is very limited and has terrible graphics and java just isn't anyone I knows' cup of tea. That was the first OO language me and my friends learned and we all changed soon after.
 
  • #10
Many engineering firms use MATLAB more than Mathematica and buy into the MATLAB libraries as well. Its an expensive solution but MATLAB supports them and that make the firms feel more secure. In addition, MATLAB can interface with Java code although not seamlessly and with C code.

You will find out more about this when you get out of academia.
 
  • #11
I'm not even in academia yet, thanks for the help.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
16
Views
3K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 17 ·
Replies
17
Views
6K
  • · Replies 17 ·
Replies
17
Views
5K
  • · Replies 22 ·
Replies
22
Views
3K