プリンキピア

第7章高水準プログラミング言語

History of HLLsHLLの歴史

The evolution of HLLs began so that programmers could write programs in a familiar notation rather than using numbers (machine languages) or mnemonics (assembly languages). While there may be similarities in syntax among them, there are distinct purposes for which their development occurred. There is a much larger variety of HLLs than the ones mentioned in this section, but we will be looking at a few up close.
英語のヒント
HLLの発展は、数字である機械語や、ニーモニックであるアセンブリー言語の代わりに、なじみのある記法でプログラムを書けるようにするために始まった。言語間で構文が似ていることはあるが、開発された目的はそれぞれ異なる。この節で挙げるより、はるかに多様なHLLが存在するが、ここではいくつかを詳しく見ていく。
FortranFortran
In the early 1950s, IBM created one of the first HLL compilers for the Fortran language, which is one of the single biggest advances in computing. While Fortran was mostly used in mathematics and science, it could be easily read. Fortran makes it possible for programmers to comment their code by starting program lines with “!”. It uses conditional statements with goto statements to branch out to different parts of the code. It also uses “do...end do” iterative statements. It was also the first HLL to use a compiler, computer software that converts source code from one language to another.
英語のヒント
1950年代初め、IBMは、HLLの初期のコンパイラーの一つをFortran向けに作った。これは、コンピューティングの最も大きな進歩の一つである。Fortranは主に数学や科学に使われたが、容易に読める言語だった。プログラムの行を「!」で始めることで、コードにコメントを書ける。条件文とgoto文を使って、コードの別の部分へ分岐する。また、「do...end do」という反復文も使う。ある言語のソースコードを別の言語へ変換するソフトウェアである、コンパイラーを使った最初のHLLでもあった。
! Compute the average
Average = Sum / List_Len
! Count the values that are greater than the average
Do Counter = 1, List_Len
   If (Int_List(Counter) > Average) Then
      Result = Result + 1
   End If
End Do
COBOLCOBOL
Common Business-Oriented Language (COBOL) was developed to be a high-level language for business that was standardized by the American National Standards Institute (ANSI) group in 1968. COBOL represents a distinct milestone in the evolution of computer science because of the ways in which it differed from Fortran.
英語のヒント
Common Business-Oriented Language(COBOL)は、ビジネス向けの高水準言語として開発され、1968年に米国国家規格協会(ANSI)によって標準化された。Fortranとの違いによって、COBOLはコンピューターサイエンスの発展における、明確な節目となった。
The following code snippet illustrates reading an inventory record and computing the available stock:
英語のヒント
次の短いコードは、在庫レコードを読み、利用可能な在庫数を計算する例である。
100-PRODUCE-REORDER-LINE.
   PERFORM 110-READ-INVENTORY-RECORD.
   IF CARD-EOF-SWITCH IS NOT EQUAL TO "Y"
      PERFORM 120-CALCULATE AVAILABLE STOCK
      IF AVAILABLE STOCK IS LESS THAN BAL-REORDER-POINT
         PERFORM 130-PRINT-REORDER-LINE
110- READ-INVENTORY-RECORD.
   READ BAL-FWD-FILE RECORD
      AT END
         MOVE "Y" TO CARD-EOF-SWITCH.

. . . .
We can see that COBOL has a very different type of syntax than Fortran. It is purposed differently as it is very aligned to business applications and the programming of specific business activities that make up business processes.
英語のヒント
COBOLの構文は、Fortranとは大きく異なることが分かる。COBOLは、業務アプリケーションや、業務プロセスを構成する具体的な活動のプログラミングに、非常によく合うよう作られており、目的が異なる。
BASICBASIC
Beginner’s All-Purpose Symbolic Instruction Code (BASIC) was developed in 1971. It is a programming language that has enjoyed widespread use. A variation of BASIC referred to as Visual Basic (VB) was the language responsible for much of the development work performed on the new generations of personal computers as it was easy to learn and read. Today it has evolved into Visual Basic .NET.
英語のヒント
Beginner’s All-Purpose Symbolic Instruction Code(BASIC)は、1971年に開発された。広く使われてきたプログラミング言語である。その派生であるVisual Basic(VB)は、学びやすく、読みやすかったため、新しい世代のパソコンで行われた開発の多くを支えた。今日では、Visual Basic .NETへ発展している。
The following code snippet illustrates the same computation and comparison of an average we did in Fortran but this time in BASIC:
次の短いコードは、Fortranで行ったのと同じ、平均の計算と比較を、今度はBASICで示す。
REM Compute the average
average = sum / listlen
REM Count the values that are greater than the average
FOR counter = 1 to listlen
   IF intlist(Counter) > average
      THEN result = result + 1
   End If
NEXT
Note that the BASIC syntax has its roots in Fortran but is more efficient.
英語のヒント
BASICの構文はFortranに起源を持つが、より効率的であることに注目しよう。
Pascal and CPascalとC
The programming languages introduced so far follow the imperative language paradigm that emphasize a “tell the computer what to do” approach. Pascal and C distinguish themselves by being both procedural and imperative languages, and they were invented at approximately the same time. A procedural language allows programmers to group statements into blocks of code within the scope of which variables may be defined and manipulated independently from the rest of a program. These blocks can be named, in which case it allows programmers to create functions or procedures that can be called from other parts of a program. Similar to other imperative languages, both Pascal and C also focus on evaluating expressions and storing results in variables (e.g., a = 10; b = 5; c = a + b).
英語のヒント
ここまで紹介したプログラミング言語は、「何をするかをコンピューターへ指示する」方法を重視する、命令型言語のパラダイムに従う。ほぼ同じ時期に生まれたPascalとCは、手続き型と命令型の両方であるという特徴を持つ。手続き型言語では、複数の文をコードのブロックへまとめ、その範囲内で、プログラムのほかの部分から独立して変数を定義・操作できる。ブロックには名前を付けられ、その場合、プログラムの別の部分から呼び出せる関数や手続きを作れる。ほかの命令型言語と同様に、PascalもCも、式を評価し、その結果を変数へ保存することに重点を置く。たとえばa = 10; b = 5; c = a + bである。
The following Pascal code snippet illustrates the same computation and comparison of the average computed previously in BASIC:
次のPascalの短いコードは、前にBASICで求めた平均について、同じ計算と比較を示す。
{ Compute the average }
average := sum / listlen;
{ Count the values that are greater than the average }
for counter := 1 to listlen do
   if (intlist[counter] > average) then
      result := result + 1;
The introduction of procedures in Pascal improved programs’ readability by allowing programmers to write more modular code. Pascal became the preferred teaching language during the 1970s and early 1980s.
英語のヒント
Pascalへの手続きの導入により、プログラマーは、よりモジュール化されたコードを書けるようになり、プログラムの読みやすさが向上した。1970年代から1980年代初めにかけ、Pascalは教育用として好まれる言語になった。
Pascal was overshadowed in commercial applications by C, which came into existence after the initial work on the UNIX operating system was completed in the late 1960s. That first OS version was written in assembly language, yet in the early 1970s, C became a better alternative. At the time, it was the perfect language for creating operating systems and was a huge commercial success.
英語のヒント
商用アプリケーションでは、PascalはCの陰に隠れた。Cは、1960年代末にUNIX OSの初期の作業が終わった後に生まれた。その最初のOSはアセンブリー言語で書かれていたが、1970年代初めには、Cがよりよい選択肢になった。当時、OSを作るのに最適な言語であり、商業的にも大成功した。
The following C code snippet illustrates the same computation and comparison of the same computed average:
次のCの短いコードは、同じ平均について、同じ計算と比較を示す。
/* Compute the average */
average = sum / listlen;
/* Count the values that are greater than the average */
for (counter = 0; counter < listlen; counter++)
    if (intlist[counter] > average) result++;
The introduction of functions in the C language improved programs’ readability and writability by allowing programmers to write more modular code. The C language runtime was also more efficient. C became the preferred language for commercial applications during the 1970s and early 1980s.
英語のヒント
C言語への関数の導入により、プログラマーは、よりモジュール化されたコードを書けるようになり、プログラムの読みやすさと書きやすさが向上した。C言語の実行環境も、より効率的だった。Cは、1970年代から1980年代初めにかけ、商用アプリケーション向けとして好まれる言語になった。