Comparing Fortran and Pascal: Advantages & Uses

  • Context: Fortran 
  • Thread starter Thread starter Tom83B
  • Start date Start date
  • Tags Tags
    Fortran Pascal
Click For Summary

Discussion Overview

The discussion centers on the comparison between Fortran and Pascal, particularly in the context of their use in scientific computations and programming education. Participants explore the advantages of Fortran for scientific applications, the relevance of Pascal in modern programming, and the historical context of both languages.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Some participants note that Fortran is favored for scientific computations due to its long-standing use and the extensive libraries available, which would be costly to convert to other languages.
  • Others argue that Pascal is outdated for research-level physics computation and the software job market, suggesting that teaching it is based on nostalgia rather than practical application.
  • Concerns are raised about the current state of Pascal's compiler support, with some participants highlighting that modern alternatives like C++ and Java are more widely used and supported.
  • One participant mentions that Delphi, an evolution of Pascal, lacks certain functionalities important for scientific computing, such as an exponential operator and complex arithmetic.
  • There is a discussion about the readability of Pascal and Delphi compared to C++, with some participants advocating for the clarity of Pascal's syntax.
  • Some participants express that while Pascal has historical significance, its practical applications have diminished in favor of more modern languages.
  • The conversation briefly touches on comparisons with other languages like APL and C, discussing their design philosophies and usability.

Areas of Agreement / Disagreement

Participants express multiple competing views regarding the relevance and utility of Fortran and Pascal in modern programming and scientific computation. There is no consensus on the superiority of one language over the other, and the discussion remains unresolved regarding their respective advantages.

Contextual Notes

Participants highlight limitations in Pascal's current compiler support and its declining use in both academic and professional settings, while Fortran's legacy and library support are noted as significant factors in its continued relevance.

Tom83B
Messages
45
Reaction score
0
Hi,
I heard that fortran is quite a useful language for some scientific computations, so I looked it up to see what is looks like and I was surprised that the syntax is very similar to Pascal. I know that syntax doesn't mean anything, but it seems to me that when languages have a similar syntax they are similar in most of the aspects...

Is Pascal ever used in the same way as Fortran? I know that at Charles University in Prague physics student are taught only Pascal in a subject called programming for physicist (later on they can probably choose some other languages as well, like C++ etc.).

Why is Fortran so good for these computations? Does it really have so many advantages or is it just the favourite language of physicist because they've been using it for decades?

Thanks for your answers.
 
Technology news on Phys.org
Tom83B said:
Why is Fortran so good for these computations? Does it really have so many advantages or is it just the favourite language of physicist because they've been using it for decades?
The fact that Fortran has been used for decades means there are huge libraries of Fortran code that would take years of recoding and debugging to convert to other languages. Another factor is that on some super-computers, more work has been done on adding extensions and optimizations to Fortran compilers on those computers versus other languages for those computers (a choice made because of legacy of Fortran).
 
Thanks.
 
Tom83B said:
Is Pascal ever used in the same way as Fortran? I know that at Charles University in Prague physics student are taught only Pascal in a subject called programming for physicist (later on they can probably choose some other languages as well, like C++ etc.).

Teaching Pascal to physics undergrads is '80s out-dated thinking. Pascal is nowadays seldom used in either research-level physics computation or software job market. The former is dominated by Fortran, C++, and mathematical packages like Matlab and Mathematica. The latter is dominated by Java, C#, C++ etc. The only reason to teach Pascal is nostalgia.
 
petergreat said:
The only reason to teach Pascal is nostalgia.
That's interesting. I think some high schools here teach Pascal as well. I always thought it was because of the easy syntax, but now it seemed to me, that most of other schools teach languages like Java, Fortran or C++ from the beginning (currently I'm on high school in Germany and they teach us Java)
 
Pascal's compiler support is dreadful nowadays. Borland / Turbo Pascal was a good product back in the DOS days, but it's outdated now. The open-source Free Pascal Compiler is way behind the free GCC/G++ compiler for C/C++, in terms of functionality, optimization, 3rd party support etc.. As for IDEs, Lazaurus is way behind Visual C++. Delphi may be good, but it no longer has a free student version, and the price is too high for amateurs. I actually liked pascal, but there's no longer any reason for me to continue using it. Pascal has been very influential in the historical development and evolution of programming languages, but it's fading away from the scene.
 
Tom83B said:
I think some high schools here teach Pascal as well. I always thought it was because of the easy syntax

That's a fair point. Pascal is a very neat language, unlike C++ which makes it so easy to make mistakes. Lately there seems to be lots of people advocating Python as the best language for new learners, since it's also a neat language, but much more modern. Having said that, I don't know whether that works well in practice, because I know few places which teach students Python as a first programming language.
 
Pascal has morphed into Delphi and has become a modern object oriented language that can do anything C++ can. Delphi's two biggest drawbacks IMO for science or engineering are the lack of an exponential operator and the lack of complex arithmetic. I find this inexcusable. There are ways around both of those inconveniences but there shouldn't have to be.

From what little I know of C, it was designed to contain as much programming as possible with as few keystrokes as possible. This makes it faster to write but harder to understand someone else's code.

Pascal and Delphi are the opposite. They are both much more wordy but much easier to read and understand. In addition, both Pascal and Delphi enforce strict typecasts which reduces errors in coding.

I agree with what's been written about Fortran so I won't add much except to say that I have translated Fortran programs to Delphi and found the Delphi structure to be much more elegant than the original Fortran.
 
petergreat said:
Borland / Turbo Pascal was a good product back in the DOS days, but it's outdated now.

Sad truth.
 
  • #10
skeptic2 said:
From what little I know of C, it was designed to contain as much programming as possible with as few keystrokes as possible. This makes it faster to write but harder to understand someone else's code.
This sounds more like a description of APL with all of it's greek symbols and a multitude of operators. Example of a APL program to find all the prime numbers from 2 to N.

aplprime.jpg
 
Last edited:
  • #11
APL and C are very different. In some regards, C is more like a high-level assembly language, with some statements/expressions pairing directly with their assembly counterparts (e.g., x++ and INC, && and AND, ^ and XOR). IMO, APL would be more like BASIC implementations on minicomputers back in the 70's, with support for matrix operations. A single line of BASIC code, like APL code, would be translated to many lines of lower-level assembly.
 
  • #12
A bit off topic, but since the OP's question was already answered earlier:

Mark44 said:
APL would be more like BASIC implementations on minicomputers back in the 70's.
APL dates back to the early 60's. It has a large number of operators that will operate on multi-dimensional dynamically created (via assignment) variables. Generally an APL program consists of lines of code where each line handles sets of data in a single propagation pass through a series of operations, while most programming languages operate on such data via an iterative process for each element.

http://en.wikipedia.org/wiki/APL_(programming_language)
 

Similar threads

  • · Replies 62 ·
3
Replies
62
Views
14K
  • · Replies 397 ·
14
Replies
397
Views
22K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
16
Views
3K
  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 4 ·
Replies
4
Views
9K