fortran66のブログ

fortran について書きます。

【メモ帳】N Wirth

N. Wirth, The Essence of Programming Languages

link.springer.com

4 Language Semantics


While disregarding details and further unresolved difficulties, we emphasize that
the language’s definition must be stated in terms of mathematical formulae and be
free of references to any mechanism for execution. A language must be understandable
by its static rules alone, without knowledge about any possible implementation.
We explain this strong requirement by three familiar examples:

1. Numbers: Operations on numbers (integers) are defined by the axioms of mathematics.
Hence there is no need to specify how numbers are represented as sequences
of bits. In fact, representation must not be specified, as this would narrow the freedoms
of implementers. Such an over-specification would break the notion of the
abstraction; it would reveal to the reader properties of their (possible) representation
instead of the numbers themselves.

2. Data Structures: Each element of an array is selected by a unique index, and an
element of a matrix by a tuple of indices. Hence, there is no need for a programmer to
know how an array is allocated within a computer store (whether row- or columnwise
or anything else). In fact, this knowledge would allow the programmer to perform
operations not specified by the proper abstraction alone.

3. Iterative Statements: Repetitions are typically explained in terms of their implementation
with jumps. But there is no need for a programmer to know about jumps, in
fact he must avoid the notion of structure-breaking jumps. Instead, the properties of
an iterative statement S must be defined in terms of the effect of the iterated statement
Q alone.

整数や配列の番地の展開は実装の詳細に依らぬのがいいと言っていて、その通りだと思いますが Fortran を学ぶ上では避けては通れない知識だとも思います。ここが表面的な文法を学んだだけでは苦しい所である気がします。

それは、現在の計算機ではメモリー上のデータの移動が律速段階になっていて、明示的代入を通じてメモリー移動を巧妙に制御しないと計算機資源を有効に活用できない所に遠因していると考えます。

なお三番目のループ(ジャンプ)については Hoare の記述に依っているようです。

N. Wirth, The Development of Procedural Programming Languages Personal Contributions and Perspectives

ALGOL, PASCAL, Module-2, Oberon の系譜について回顧

link.springer.com

アルゴリズムとデータ構造

アルゴリズムとデータ構造

PASCAL (情報処理シリーズ)

PASCAL (情報処理シリーズ)

Oberon-2 Programming with Windows

Oberon-2 Programming with Windows

Object-Oriented Programming in Oberon-2

Object-Oriented Programming in Oberon-2

Programming in Oberon: Steps Beyond Pascal and Modula (ACM Press)

Programming in Oberon: Steps Beyond Pascal and Modula (ACM Press)