FORTRAN (was Re: indentation)

François Pinard pinard at IRO.UMontreal.CA
Thu Dec 9 19:57:12 EST 1999


"William B. Clodius" <wclodius at lanl.gov> writes:

> [...] I believe that all Fortran's up to Fortran 90 could be implemented
> with static allocation. It had no recursion and, in most respects, no
> dynamic allocation. The one tricky point in static allocation involves
> some usages of CHARACTER variables which result in expressions whose
> size can vary at runtime.

CHARACTER variables?! :-) They appeared rather late in FORTRAN.
In earlier FORTRAN, one was using Hollerith constants within integers,
for initialising something vaguely resembling character strings.  All this
was highly dependent on the word size, of course, and hardly portable.
There was a function LOCF(VAR) returning the address of VAR.  The usual
idiom was to initialize some:

   COMMON // IZ(1)
   IZ = 1 - LOCF(IZ)

and then use:

   IZ(IZ+K)

to read or assign the K'th word in memory.  If you knew rather well how
the system was using its memory, you could do "sophisticated" things. :-)

> As a side point, dynamic languages can also be implemented statically

I vaguely remember that it is the young Alain Colmerauer, the later father
of the Prolog family, who made us laugh quite a bit when he asserted that
recursive algorithms may be implemented non-recursively, if using a stack.
It was at a time we were using FORTRAN and assembler on the first floor to
make real programs, while linguists on the fifth floor and other computer
science people were using Algol-60 to write algorithms like mathematic
theorems.  The despise was mutual...  Testing theoretical algorithms with
a real computer was, at the time, considered a dirtying, impure activity,
only done secretely if possible; so we were calling them "Algoolic Anonymous"
(does the pun translate?).  Things changed immensely since then.  Nowadays,
computer science people often lead, and even for practical matters! :-)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list