プリンキピア

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

Summaryまとめ

7.1 Programming Language Foundations7.1 プログラミング言語の基礎

• HLLs give us the ability to make use of abstraction to build algorithms in a close-to-English representation.
• 高水準言語により、抽象化を利用し、英語に近い表現でアルゴリズムを構築できる。
• There are criteria that are used for selecting the proper HLL for the required tasks. These can include scalability, cost, flexibility, efficiency, portability, and maintainability.
英語のヒント
• 必要な作業に適した高水準言語を選ぶための基準がある。たとえば、拡張性、費用、柔軟性、効率、移植性、保守性が挙げられる。
• HLLs are designed to fulfill a purpose, which could be general purpose, web oriented, object-oriented, or parallel-programming oriented, among others.
英語のヒント
• 高水準言語は、目的を果たすために設計される。たとえば、汎用、Web向け、オブジェクト指向、並列プログラミング向けなどがある。
• HLLs are shipped with application programming interfaces (APIs) that contain useful tools and objects to help program them for their purpose.
英語のヒント
• 高水準言語には、目的に合ったプログラムを作るのに役立つ道具やオブジェクトを含む、アプリケーションプログラミングインターフェース(API)が同梱される。
• HLLs have different implementation approaches. These vary from compiled to interpreted to hybrid.
• 高水準言語には異なる実装方式がある。コンパイル方式、解釈実行方式、その混成方式まで、さまざまである。
• IDEs are structured environments containing tools that are targeted to programming different HLLs.
• IDEは、さまざまな高水準言語でのプログラミングを対象とする道具を含む、体系的な環境である。

7.2 Programming Language Constructs7.2 プログラミング言語の構成要素

• HLLs all have data types which are either primitive or complex that form the domain of legal data types they recognize.
英語のヒント
• すべての高水準言語は、基本型または複合型のデータ型を持つ。これらが、その言語が認識する有効なデータ型の範囲を形作る。
• HLLs all have operators that represent the legal set of operations that may be performed on the data types such as addition or assignment.
• すべての高水準言語は、加算や代入など、データ型に対して実施できる有効な操作の集合を表す、演算子を持つ。
• HLLs support variables named containers that may hold the legal values of the HLL data types and literals, which are a plain language representation of those values.
• 高水準言語は、その言語のデータ型の有効な値を保持できる、名前付きの入れ物である変数と、その値を平易な形で表したリテラルを支える。
• HLLs have rules for identifiers that are user-defined names of language elements such as variables, constants, and functions.
• 高水準言語には、変数、定数、関数などの言語要素に利用者が付ける名前である、識別子の規則がある。
• HLLs allow for documentation, usually as comments, so that programmers know about a program.
• 高水準言語は、プログラマーがプログラムについて理解できるように、通常はコメントの形で説明文を入れられる。
• HLLs provide data structures, such as arrays, which are containers to store multiple values.
• 高水準言語は、複数の値を保存する入れ物である、配列などのデータ構造を提供する。
• HLLs have constructs for flow of control which dictate the path of execution of the code, usually conditional statements and iteration constructs.
英語のヒント
• 高水準言語には、コードの実行経路を決定する制御フローの構文があり、通常は条件文と反復構文からなる。
• HLLs provide the means to modularize, usually in the form of functions.
• 高水準言語は、通常は関数の形で、モジュール化の手段を提供する。
• A call stack or execution stack is the data structure that controls the execution of a program.
• 呼び出しスタック、すなわち実行スタックは、プログラムの実行を制御するデータ構造である。
• Most HLLs provide the means for handling and recovering from runtime errors, a process called exception handling.
• 多くの高水準言語は、実行時エラーを処理し、回復するための手段を提供する。この処理を例外処理という。
• HLLs can handle both user interactive and file input and output.
• 高水準言語は、利用者との対話的な入出力と、ファイルの入出力の両方を扱える。

7.3 Alternative Programming Models7.3 ほかのプログラミングモデル

• Functional programming is a declarative language paradigm where programs are constructed by composing functions and applying them; some of whose features are implemented in imperative languages.
• 関数型プログラミングは、関数を合成して適用することでプログラムを構築する、宣言型言語のパラダイムである。その機能の一部は、命令型言語にも実装されている。
• Object-oriented programming (OOP) is a paradigm based on classes and objects and is widely implemented in many HLLs.
• オブジェクト指向プログラミング(OOP)は、クラスとオブジェクトに基づくパラダイムであり、多くの高水準言語で広く実装されている。
• The degree of support of encapsulation, inheritance, and polymorphism is indicative of the degree of object-orientation of an HLL.
英語のヒント
• カプセル化、継承、ポリモーフィズムをどの程度支えるかが、高水準言語のオブジェクト指向の度合いを示す。
• Concurrency is the behavior of an HLL when it can multitask sections of its own code, giving the illusion of simultaneous execution.
• 並行性は、高水準言語が、自身のコードの各部分をマルチタスクで処理できるときの振る舞いであり、同時実行しているように見せる。
• Parallelism is the behavior of an HLL when it can simultaneously execute sections of its own code, requiring multiple cores or processors.
• 並列性は、高水準言語が、自身のコードの各部分を同時に実行できるときの振る舞いであり、複数のコアまたはプロセッサーを必要とする。
• Scripting languages are HLLs that are usually interpreted but retain many of the features of compiled languages and are often used for web programming.
英語のヒント
• スクリプト言語は、通常は解釈実行されるが、コンパイル言語の特徴も多く持ち、Webプログラミングによく使われる高水準言語である。

7.4 Programming Language Implementation7.4 プログラミング言語の実装

• Compilers are the general tool used to implement the process of translating source code to another language that is either machine language or is closer to assembly language.
• コンパイラーは、ソースコードを、機械語またはアセンブリー言語に近い別の言語へ翻訳する処理を実装する、一般的な道具である。
• Interpreters follow the same processes as compilers with differences in the timing of the translation phases.
• インタープリターは、翻訳の各段階を行うタイミングが異なるものの、コンパイラーと同じ処理をたどる。
• The compilation process is divided into distinct stages: a front end (code analysis), an optional middle end (code optimization), and a back end (code generation). These tasks may be done in just two stages: front end and back end.
英語のヒント
• コンパイル処理は、フロントエンド(コード解析)、省略可能なミドルエンド(コード最適化)、バックエンド(コード生成)という、明確な段階に分かれる。これらの作業を、フロントエンドとバックエンドという二つの段階だけで行う場合もある。
• Many compilers generate assembly language either as their output (needs separate assembly) or as the output of one stage (assembly performed as part of compilation).
• 多くのコンパイラーは、最終出力として、または一つの段階の出力として、アセンブリー言語を生成する。前者では別途アセンブルが必要で、後者ではコンパイルの一部としてアセンブルを行う。
• A linker or link-loader is used to stitch together pieces of separately compiled code for final execution.
英語のヒント
• 最終的な実行のために、別々にコンパイルしたコードをつなぎ合わせるのが、リンカーまたはリンクローダーである。
• Runtime management is handled by a runtime system which is highly aware of the functionality of the compiler as to enable the use of features like garbage collection, exception handling, and concurrency or parallelism.
• 実行時管理は、コンパイラーの機能をよく把握したランタイムシステムが行い、ガベージコレクション、例外処理、並行性や並列性といった機能を使えるようにする。
• Runtime management may be handled by virtual machines which provide execution environments that are emulations of the computer architecture.
英語のヒント
• 実行時管理は、コンピューターアーキテクチャーを模倣した実行環境を提供する、仮想マシンが担当することもある。
• Code optimization and code improvement are highly desirable features of program implementation.
• コード最適化とコード改善は、プログラムの実装において非常に望ましい機能である。