Hot answers tagged

48

FORTRAN was, at the time(*1), lacking almost everything, from string handling to all I/O beside reading numbers from cards or tape. Heck, not even integer size was guaranteed across machines. No real way of structuring or flow control beside GOTO — even subroutines/functions were only integrated a year before with FORTRAN II. For most parts, FORTRAN is a ...


32

The meeting that defined the requirements of the new language took place on May 28–29, 1959. Charles Phillips prepared a memo several months later summarizing the decisions made at that meeting. Its listing of requirements is reprinted on page 201 of the ACM’s History of Programming Languages. a. Majority of group supported maximum use of simple English ...


24

I managed to find the exact same three photos Stroustrup used in his slide: Simula: Kristen Nygaard, who co-designed Simula with Ole-Johan Dahl; Fortran: John Backus, who headed the team that developed Fortran; Assembler: David John Wheeler, who worked on what would today be called a relocating assembler for the EDSAC, an early programmable computer (paper),...


22

FORTRAN was originally developed for the IBM 704 computer, which stored integers in sign-and-magnitude format. In the original documentation, it supports fixed-point variables, which used the machine’s native format, floating-point variables, and unsigned fixed-point constants, which were intended for line numbers and subscripts. These would be translated ...


19

The use of such letters was common in mathematics long before programming existed. x, y, z were used as variables by Descartes in 1637; in his framework, a, b, c and other letters towards the start of the alphabet represented known values, letters towards the end of the alphabet represented unknown values. The use of i, j etc. doesn’t go quite that far back, ...


17

TL;DR: That being so, the assigned goto is just an indirect jump through the variable. Right. But in actual fact, the assigned goto had to be given a list of statement numbers No, it had not. The list was always an optional one. If not given, the GOTO was simply executed without any further check. What purpose does the statement-label list serve? It's ...


14

While this may cover many ways of overflow (from integer and counter all the way to record, I assume the Overflow in question is about floating point, which more precisely means over/underflow of the exponent. The exact handling varies widely between compilers and machines. Fortran 77 did not make any assumptions here (AFAIK), it at all, it was expected that ...


10

First of all, the accepted answer is wrong; the statement list was not optional in the "original" FORTRANs (I and II). Here is a listing of the routine used to read GO TO statements: REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REM REM C0200/ CALLS=GETIFN,DIAG,TEST..,C0190,C0180,TET00,C0160, REM ...


10

I only have experience of ICL mainframes, CDC, Prime 300, Data General Nova and Eclipse. On those, the programs just crashed. Like Mick's answer, it would be up to the programmer to figure it out. These were variants of Fortran II (lots of 3- way jumps), Fortran IV (or 66) and Fortran V (what the vendor called it). Fortran was mainly used for High ...


10

I don't recall any overflow handling on the FORTRAN 77 compiler that I worked on and supported (Honeywell Series 60 Level 62). Any overflow would cause a program abort, so it was up to the programmer to ensure that overflows did not happen. This compiler was designed to be compatible with IBM System/360 FORTRAN, and even used the same base-16 floating point ...


9

One possibility to look at might be the Hercules emulator, which emulates the IBM S/370, ESA/390, and z/Arch systems. This is emulating the 'bare iron', and does not include the operating system or utilities, but there are sources for OS images and compilers listed on that page.


8

That fact is explicitly mentioned in the (Russian) book Ошибки-ловушки при программировании на фортране, 1987 (Errors and pitfalls in FORTRAN programming), page 88. One of the puzzles was to make the sequence of operators J=1 PRINT 1,J 1 FORMAT(' J = ',I1) print 0. The provided solution was PROGRAM TASK CALL ZERO(1) J=1 ...


7

The answer is "it depends". If your object program is running on a machine that traps on arithmetic overflow, you'll get a trap on arithmetic overflow. If there's a latching overflow indicator, there might be a way to interrogate it; with ICL 1900 FORTRAN, you could CALL OVERFL(K) to set K depending on whether overflow had occurred (K=1 for ...


7

These aren't mainframes by any manner of means, but I've successfully compiled and run Fortran programs on an emulated: DEC PDP-11 running RSX11 DEC PDP-8 running OS 8. Both of these ran under SimH on a Raspberry Pi Zero. The PDP-8, being a small machine, typically ran from paper tape rather than cards. I have reason to believe that another early ...


7

The compilers I produced or helped produce (40-50 years ago) produced code that kept all floating point numbers as simple 2's complement mantissa/exponent form. It converted them to hardware FP representation and invoked the FP unit to process the arithmetic, then on return converted them back. You have to remember, back in those days FP hardware had a very ...


7

Before IEE 754, there was no floating point equivalents to "NaN" or "Inf". Overflow, underflow, and division by zero generated interrupts which would be ignored, trapped, or terminated the program with a default error message (and most likely a core dump as well). These options could often be controlled from Fortran by a collection of ...


6

As a Fortran Compiler writer for dusty deck (and other computers), let me add that many answers, although correct, are not focusing on the implementation Fortran language, but features that they might have remembered using from Fortran. Many of those features, although correctly described, are mainly about features provided by the operating system or run-...


6

Does it have to be a mainframe, or PDP-11 or VAX would be good enough? If the latter, then there is SIMH, and there is Bitsavers' Software Archive. There was a FORTRAN compiler on BSD UNIX for sure. Better yet, there is no need to simulate the whole system. For convenience, one can use a user space PDP-11 emulator. Binaries can be taken from here, 2.11 BSD ...


6

I can't say whether IBM invented this extension or even whether any IBM compiler ever supported it, but at least as of the IBFTC FORTRAN IV compiler for IBSYS version 13 (manual dated 1968), subscripted variables were explicitly prohibited in an ASSIGN. Assuming the vendor's documentation to be accurate :-) A System/360 FORTRAN IV manual says the same thing (...


5

On IBM H/W, overflows & underflows generated an interrupt and generally resulted in an exception with the program being cancelled. On CDC under NOS any runtime error was noted by the Peripheral Processor and at the end of the time slice, the program was cancelled with a less than helpful message and diagnostic snap dumps which may or may not be close to ...


5

On BESM-6 the ALU/FPU interrupts (overflow, division by zero) were inexact, thus it was impossible to recover and continue, but it was possible to handle them with a mechanism akin to the setjmp/longjmp capability in the C language, where the "setjmp" equivalent was IFOVFL(DUMMY), returning 0 at setup, and 1 on exception, and the "longjmp"...


5

In the 1990s, I worked for a UK company (Polyhedron Software) that produced a suite of code analysis and refactoring tools for Fortran, marketed as PlusFort. The GXCHK module performed static analysis of Fortran code to look for common errors, including: Subprogram argument mismatch or misuse (e.g. constant actual argument is illegally modified by ...


5

I'm too young to remember really old Fortran compilers, but the behaviour that you described occurs in all current Fortran compilers. It's a core part of the language standard, so we can safely assume that any standard-conforming compilers in the past used to work this way as well. Check out this example at https://godbolt.org/z/GKadP9rov (feel free to ...


4

There are emulators for the historically significant systems produced by Control Data Corp. cdc and Cray cray. DtCYBER, which can be run on Windows and Linux and is available as source code under GPL 3.0 terms. DtCYBER does not include operating systems, compilers, etc., which the user must provide for themselves--a tall order, but probably not impossible. ...


4

Do you consider the PDP-10 a mainframe? Here is a TOPS-10 distribution with Fortran included: http://www.steubentech.com/~talon/pdp10/


4

The PDP-8, a tiny minicomputer compared to some of the examples here, did the following in its floating point package: The input conversion routine halts on overflow during calculation of the mantissa. Typing RUBOUT and pressing CONTINUE on the console will restart the routine. Overflow during exponent calculation yields an unpredictable result; the ...


4

In my dusty memory, F77 on a CDC Cyber 175 would crash on floating-point overflow, and I would assume that applies from 6600 to 176 as well. That might have been due to local setup.


4

The emulator B7094 come with Fortran 2 and Fortran 4. It's relatively easy to use (much easier than hercules, of course) : https://www.majorgeeks.com/files/details/b7094_ibm_7094_emulator.html Fortran 4 is very similar to the "still in use" Fortran 77 and any incompatibility can be easily patched. I don't remember if it's shipped with the emulator, ...


4

DEC PDP-10 Fortran documentation says the target of an assigned go to can be a variable or an array element. It sounds like it would allow the construct discussed in this question. see manual This edition of the manual is dated 1972.


4

The documentation, possibly including a language's keywords and their descriptions, could be copyrighted. This is why Zilog Z80 assembly language is not compatible with or a strict superset of Intel 8080 assembly language; because, IIRC, Intel registered a copyright.


Only top voted, non community-wiki answers of a minimum length are eligible