The article tells the story:
- The origins of Fortran
- Structure of the Fortran Programming Language
- Advantages and Disadvantages of the Fortran Language
- Compilers for the Fortran programming language
- Outlook for the Fortran programming language
See also: Best laptop for engineering student
The Fortran programming language was developed in the mid-fifties and was the first high-level language. Today you can often hear that its time has passed with the advent of mass computers and left in an era of punched cards and whole-room-sized computers.
However, this language is still relevant. In this article, we discuss how Fortran came into existence, what its features are, pros and cons, where it is used today and if it has any future.
History of Fortran
John Warner Backus, the head of a group of developers at IBM, published a series of articles in 54 A.D. which made the term FORTRAN possible. He published "Preliminary Report" and "Specifications for the IBM Matmal Transmula TRANslating System". Two years later the team led by Backus presented the world with the first Fortran compiler (25,000 lines for IBM 704).
How was the Fortran programming language created?
- The first program that compiled text written in Fortran into a set of machine codes was developed from scratch between '54 and '57. At that time high-level (= HLL) character systems had not yet been created. Basically all OSs were simple and computer memory was no larger than 16 Kb. That compiler was targeted at the IBM 704. The HLL system proved to be more powerful than the assembler, and this contributed to its rapid adoption.
- Fortran development was completed in 1958. At this time, Fortran III also appeared, but this version was not yet widely available.
- Fortran IV appeared as early as 1961. It included a number of improvements, including the implementation of COMMON and EQUIVALENCE operators.
- Another year later the US Standardization Agency began work on developing standards for an object-oriented Fortran system. This was a necessary step to ensure that this programming language could be used on all new computers. As a result, Fortran became even more popular and was available on the Apple and TRS80.
- The first international standard HLL was implemented in FORTRAN 66 in 1967. Thanks to its publication, FORTRAN was far ahead of other languages at the time in terms of breadth of use. In the mid-1970s, it was already in use on almost every PC, mini or mainframe. The programming language FORTRAN 66 used if statements, goto-statements and spagethi programs. Similar structured programming became particularly popular in the sixties and seventies.
Fortran ran on punched cards, including the FMS platform. Developers had to optimize language source placement until Fortran 90 had a "free" syntax. In this system, the 7th column was the beginning of an array code that did not exceed 72,000 characters.
And, until the Fortran 90 version of the programming language came along, the spaces between the 7th and 72nd columns were not taken into account. In other words, the "DO I = 1.5" loop could be represented as a record. At the same time, "DO I = 1.5" has a value similar to "DOI = 1.5".
A large number of industrial codes were written in Nastran, NAG and IMSL. It is important that updated programming language variations are compatible with earlier versions. Fortran 90 fully met this requirement. This version is compatible with Fortran 77. Subsequently, this requirement was no longer met when new developments were introduced.
Featured review: Best laptop for engineering student
More modern versions of the Fortran 90 and 95 programming language have been upgraded to the Fortran 2003 standard, which is still in force today. Note that the new programs for compiling to machine code can be used in modern versions without restrictions and can even support 64-bit processors. In addition, developers have created compilers for Linux in the form of the object-oriented Actor Fortran system to keep up with current trends.
Structure of the Fortran programming language
A Fortran program is a system made up of library elements including the main program text, modules, external subroutines and procedures.
Any program includes a basic set of combinations of computer instructions and data. In addition it may or may not contain additional program modules.
The syntax for the base set is:
program program_name implicit none ! type declaration statements ! executable statements end program program_name
Here is an example of a computer program that adds 2 numbers and displays the result:
Live Demo program addNumbers ! This simple program adds two numbers implicit none ! Type declarations real :: a, b, result ! Executable statements a = 12.0 b = 15.0 result = a + b print *, ‘The total is ‘, result end program addNumbers
By compiling and executing the record like this, the program lets you get the result as
The total is 27.0000000
- The start of every Fortran computer program is the program keyword, and the end program is followed by the name of the software product.
- The implicit command none enables the compiler to check that the variable types are declared correctly. It is mandatory to write the none operator at the beginning of each program.
- Fortran uses the exclamation mark (!) in front of comments. All characters or strings following an exclamation mark will be ignored by the compiler.
- To output data to the monitor, you must write the print * operator.
- To make the program easier to read you should use line indentation.
- The Fortran programming language can use uppercase and lowercase characters. It is case insensitive unless it is a string literal.
The basic character set of the Fortran programming language includes
- Alphabetic characters A … Z and a … z.
- Numeric characters 0 … 9.
- Underscore mark (_)
- Special characters =: + space - * / () , $ '! "% &; <>?
- Symbols include the symbols of the core library. The authentication module (token) can act as a keyword, identifier, constant, string literal or character.
- Program statement statements are made up of tokens.
An identifier is a name which is used to identify a variable, action or other program components which are defined by the user. Here are also the rules for writing it in the Fortran programming language.
- The maximum number of characters in an identifier is 31.
- The name may include the alphanumeric characters listed above and an underscore (_).
- An identifier may only begin with an alphabetic character.
- The identifier is not case-sensitive.
- Keywords are special, reserved entries in the library which cannot be applied as identifiers/names.
See also: Best laptop for hacking
Advantages and disadvantages of Fortran
Fortran has its own characteristics that set it apart from other modern programming languages. It was the first compilable high-level system oriented towards scientific and technical applications. Moreover, the Fortran programming language continues to evolve successfully, which confirms its relevance, even with systems that came much later. There may not seem to be much demand for its use now, but it still has a long list of advantages.
Advantages of the Fortran programming language:
- A very simple and accessible version of the language for learning to program. It has an easy to understand syntax and its historical experience will be useful for those who are just beginning to learn how to develop programs.
- Once you know the basics of Fortran, it's easy to learn other languages.
- The system has an extensive set of tools, available for free, so there's no need to get hung up on licenses.
- Thanks to its worldwide distribution, Fortran has a large library and a wide range of applications, which have been developed over its long history.
- The system is standardised across platforms and newer versions are compatible with earlier versions.
- The Fortran programming language has a set of tools (translators) for conversion to machine systems on different computers.
- Virtually all PCs have a Fortran compiler, so users always have options for complex parallel computations.
- Fortran can be used to generate compact and efficient program code and was a popular technology at a time when computers were not yet very productive.
- The Fortran programming language is useful for those pursuing higher education in technical and, especially, physical-mathematical disciplines.
It is worth noting that at all stages of its development, Fortran, despite its reliability and relevance, has not been particularly advanced in the field of programming technology.
The main disadvantages of the Fortran programming language:
- Strict code formatting requirements. For example, the Fortran 77 version was limited in line length and had to be indented at the beginning. These conditions made it awkward to work even with punch cards, let alone on a PC monitor. These limitations were later relaxed starting with Fortran 90.
- A small set of commands to control the program structure. For example, it was very difficult to write software applications without the GOTO operator.
- A weak set of tools for describing data.
Compilers for the Fortran programming language
Programs to translate Fortran programming texts into a set of machine years, for IBM, were mostly created by Microsoft up until 1997. The corporation then stopped developing Fortran compilers, citing low profitability. DEC, which merged with Compaq in 1998 and then merged with HP, is now the main supplier of such programs.
Read also: Best laptop for Machine Learning 2023
DEC develops a compiler which is integrated with the Digital Visual Fortran development environment and is based on Microsoft Visual Studio. FPS 4.0 (Microsoft Fortran Power Station), DVF 5.0 and 6.0 are the most popular of these programs. All of these compilers are compatible with several Fortran programming language standards.
As a result of the firms' merger, further development products were introduced under the Compaq and HP brands. HP now sells programming environment version 6.6 for Intel/win32. Fortran is supported on all Hewlett-Packard platforms.
Lahey is one of the largest suppliers of Fortran compilers. Its experts develop solutions targeted at Windows and Linux operating systems.
Watcom's development has been considered the best environment for Fortran programming for several years. Work on this compiler was isolated in a separate project Open Watcom, which offered open source solutions.
Featured review: Best laptop for Machine Learning
The Intel Fortran Compiler is a well-known and popular product which is still being developed today. It can be used for code optimization for Intel ia32 and ia64 platforms.
Among the solutions available on a free-of-charge basis is the compiler developed by Sun Microsystems (part of Sun Studio). This product provides efficient code generation for SPARC, x86 and x86_64 and is compatible with both Solaris and GNU/Linux operating systems.
An open programming environment for FORTRAN 77 is offered by the GNU Free Software Foundation. This compiler is available for almost all platforms and is compatible with GCC. However, the foundation's product does not support all of the current Fortran standards. Also worth mentioning is the g95 project, which is developing a Fortran 95 environment based on the GCC compiler.
The future of the Fortran programming language
According to statistics, around 0.74% of searches on popular search engines for programming languages involve Fortran. To show just how high this figure is, it's worth noting that the number is much lower for such well-known languages as Lisp, Scala, Clojure, LabVIEW, Haskell, Rust and VHDL.
During the development of Fortran, compilers for it were created by IBM, Microsoft, Compaq, Hewlett-Packard, Oracle, and others. As a result, this programming language gained compatibility with Windows, Mac OS and Linux. Now, thanks to the CCTools app for Android, the compiler program can even be taken with you. It can also be run, with some manipulation, on the iPhone.
Fortran remains in high demand in scientific and technical fields. It is used to analyse weather forecasts, seismic activity, molecular dynamics, and oceanography. It is a powerful system for the numerical processing and presentation of data, and its use dates back to the days when the first calculators for the mass consumer were first introduced.
Read also: Best laptop for Sims 4
It's worth noting that some of Fortran's popularity stems from its history. It has been developing for a long time without experiencing fierce competition, which enabled it to form a large client base, extensive libraries and add-ons. As new versions of the language supported its predecessors, engineers, scientists and other users of Fortran have never thought of abandoning it.
Now the main "competitor" of the considered system is MATLAB, distinguished by higher universality and convenience. However, the competitor has disadvantages. MATLAB has severe restrictions on software parameters. It is quite expensive and its use can often be considered superfluous.
It is difficult to foresee the development of IT technologies and programming languages for the next 20 or even 10 years. If we analyse Fortran's main competitors today, for example Go, we can note that their main disadvantages are due to their universalisation. In other words, the developers of the Fortran programming language have clearly defined specialization, which is focused on scientists.
They take into account the views of their target audience and strive to meet their wishes. Most likely, in the future too, the Fortran team will not abandon their focus in favour of new trends. This means that at least one more generation of programmers will use the system, and then a new version of the popular Fortran programming language will be introduced to the world.