Mortran

Last updated

Mortran (More Fortran) is an extension of the Fortran programming language used for scientific computation. [1] It introduces syntax changes, including the use of semicolons to end statements, in order to improve readability and flexibility. Mortran code is macro-processed into Fortran code for compilation.

Example:

<I=1,200;J=I;UNTILM(J).EQ.0<J=M(J);>IF I.NE.J<OUTPUTI,M(J+1);(' Chain',I4,' ends with ',A4);>>

Note that Mortran, like many preprocessors, does not make a complete analysis of the Fortran source and, like many preprocessors, may not always make its assumptions/requirements explicit. Consider, for example, Mortran multiple assignment. From the Mortran User Guide:

/I,A(I,K),J/=SQRT(X/2.0);

produces the following FORTRAN statements:

I=SQRT(X/2.0)A(I,K)=SQRT(X/2.0)J=SQRT(X/2.0)

In this example, the produced Fortran implements the multiple assignment correctly only if X is not aliased to I or to A(I,K), assuming the multiple assignment semantics are left to right.

The MORTRAN2 processor is written in ANSI standard Fortran 66, with the only extension the ability to assign and compare character data stored in INTEGER variables.

Related Research Articles

In computing, a compiler is a computer program that translates computer code written in one programming language into another language. The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a low-level programming language to create an executable program.

C is a general-purpose computer programming language. It was created in the 1970s by Dennis Ritchie, and remains very widely used and influential. By design, C's features cleanly reflect the capabilities of the targeted CPUs. It has found lasting use in operating systems, device drivers, and protocol stacks, but its use in application software has been decreasing. C is commonly used on computer architectures that range from the largest supercomputers to the smallest microcontrollers and embedded systems.

<span class="mw-page-title-main">Fortran</span> General-purpose programming language

Fortran is a first generation general-purpose, compiled imperative programming language that is especially suited to numeric computation and scientific computing.

<span class="mw-page-title-main">Macro (computer science)</span> Rule for substituting a set input with a set output

In computer programming, a macro is a rule or pattern that specifies how a certain input should be mapped to a replacement output. Applying a macro to an input is known as macro expansion. The input and output may be a sequence of lexical tokens or characters, or a syntax tree. Character macros are supported in software applications to make it easy to invoke common command sequences. Token and tree macros are supported in some programming languages to enable code reuse or to extend the language, sometimes for domain-specific languages.

PL/I is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has been in continuous use by academic, commercial and industrial organizations since it was introduced in the 1960s.

<span class="mw-page-title-main">Lua (programming language)</span> Lightweight programming language

Lua is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications. Lua is cross-platform, since the interpreter of compiled bytecode is written in ANSI C, and Lua has a relatively simple C API to embed it into applications.

In computer science, a preprocessor is a program that processes its input data to produce output that is used as input in another program. The output is said to be a preprocessed form of the input data, which is often used by some subsequent programs like compilers. The amount and kind of processing done depends on the nature of the preprocessor; some preprocessors are only capable of performing relatively simple textual substitutions and macro expansions, while others have the power of full-fledged programming languages.

The C preprocessor is the macro preprocessor for several computer programming languages, such as C, Objective-C, C++, and a variety of Fortran languages. The preprocessor provides inclusion of header files, macro expansions, conditional compilation, and line control.

In computer programming, an assignment statement sets and/or re-sets the value stored in the storage location(s) denoted by a variable name; in other words, it copies a value into the variable. In most imperative programming languages, the assignment statement is a fundamental construct.

Ratfor is a programming language implemented as a preprocessor for Fortran 66. It provides modern control structures, unavailable in Fortran 66, to replace GOTOs and statement numbers.

<span class="mw-page-title-main">For loop</span> Control flow statement for repeated execution

In computer science a for-loop or for loop is a control flow statement for specifying iteration. Specifically, a for loop functions by running a section of code repeatedly until a certain condition has been satisfied.

m4 is a general-purpose macro processor included in most Unix-like operating systems, and is a component of the POSIX standard.

In computer science, array programming refers to solutions that allow the application of operations to an entire set of values at once. Such solutions are commonly used in scientific and engineering settings.

In computer programming, a statement is a syntactic unit of an imperative programming language that expresses some action to be carried out. A program written in such a language is formed by a sequence of one or more statements. A statement may have internal components.

FOCAL is an interactive interpreted programming language based on JOSS and mostly used on Digital Equipment Corporation (DEC) Programmed Data Processor (PDP) series machines.

This is an overview of Fortran 95 language features. Included are the additional features of TR-15581:Enhanced Data Type Facilities, which have been universally implemented. Old features that have been superseded by new ones are not described – few of those historic features are used in modern programs although most have been retained in the language to maintain backward compatibility. The current standard is Fortran 2023; many of its new features are still being implemented in compilers. The additional features of Fortran 2003, Fortran 2008, Fortran 2018 and Fortran 2023 are described by Metcalf, Reid, Cohen and Bader.

In computing, Pic is a domain-specific programming language by Brian Kernighan for specifying line diagrams. The language contains predefined basic linear objects: line, move, arrow, and spline, the planar objects box, circle, ellipse, arc, and definable composite elements. Objects are placed with respect to other objects or absolute coordinates. A liberal interpretation of the input invokes default parameters when objects are incompletely specified. An interpreter translates this description into concrete drawing commands in a variety of possible output formats. Pic is a procedural programming language, with variable assignment, macros, conditionals, and looping. The language is an example of a little language originally intended for the comfort of non-programmers in the Unix environment.

Many programming languages and other computer files have a directive, often called include, import, or copy, that causes the contents of the specified file to be inserted into the original file. These included files are called header files or copybooks. They are often used to define the physical layout of program data, pieces of procedural code, and/or forward declarations while promoting encapsulation and the reuse of code or data.

IFTRAN was created in 1972 by E. F. Miller at General Research Corporation, Santa Barbara, California as a mechanism to support structured programming concepts in a FORTRAN-based environment.

References

  1. Cook, A. James (1976). "Experience with extensible, portable Fortran extensions". ACM SIGPLAN Notices. 11 (9): 10–17. doi:10.1145/987500.987503.