Remix.run Logo
▲ PaulHoule 4 hours ago

Mainframe-era systems often used fixed-size or limited-size buffers and data structures, based on those 80-character punched cards, most addressing modes on the 360 add 12-bit immediate displacements to pointers held in registers [1] bytes and such.

It is easy to laugh but C programmers have demonstrated that they can't handle variable-sized buffers on the stack, malloc(), free() and all that.

Early versions of FORTRAN [2] didn't even have a stack, like you couldn't write recursive functions, the program would take parameters for array sizes when it boots and the memory layout would all be figured out at the beginning. When I was developing a display controller for persistence of vision displays for the AVR-8 it drove me nuts how the C compiler kept moving the stack pointer around all the time for no real reason when an assembly program could move data to and from statically allocated structures. [3]

FORTRAN and COBOL came out around the time Syntactic Structures did so of course there was not an established theory for how to parse grammars, no parser generators, etc. No Dragon Book, but the heroic techniques used to develop compilers in that age are legendary if not quite lost.

I wrote some FORTRAN programs in high school on a VAX, in a comparative programming languages class in college, converted a lot of FORTRAN algorithms into statically allocated Java in grad school in 1990 and in my postdoc I wrote a generator that wrote JNI bindings for LAPACK.

[1] ... e.g. the typical struct is < 4096 bytes

[2] before the FORTRAN 90 standard though you could set the /RECURSIVE flag on DEC FORTRAN

[3] we were done such a disservice by all those "it's so elegant to compute Fibonacci in a better programming language than BASIC" articles in Creative Computing because recursion is one of those things, like C's memory management, that most programmers can't really handle.

▲kps 21 minutes ago | parent [-]

Fortran (before 90) ignored characters after column 72 because the IBM 704 had a 36-bit word and read each row of a card into two words. (The card reader could be wired with a plugboard to select any 72 of 80 columns from the card.)