第4章アルゴリズムの言語による実現:低水準プログラミング言語
4.4 Applications of Programming Models4.4 プログラミングモデルの応用
• Low-level and middle-level programming will continue to be important as society increasingly relies on low-powered computing devices and IoT.
英語のヒント
• 社会が低消費電力の計算機器やIoTへの依存を強めるにつれて、低水準・中水準プログラミングは今後も重要であり続ける。
• Middle-level languages including C are ideal for developing firmware and kernels.
• Cを含む中水準言語は、ファームウェアやカーネルの開発に最適である。
• Rust is a relatively new middle-level language that is gaining traction.
英語のヒント
• Rustは、勢いを増している比較的新しい中水準言語である。
• Arduino is an embedded computer platform. Arduino firmware can be written in C.
• Arduinoは、組込みコンピューターのプラットフォームである。ArduinoのファームウェアはCで書ける。
• Raspberry Pi kernels can be developed in C.
• Raspberry PiのカーネルはCで開発できる。
Review Questions確認問題
Exercises 1–5練習問題 1–5
1. What is the difference between machine code and assembly language? a. Machine code is written in a textual format, while assembly language is written in hexadecimal. b. Machine code is executed directly by the CPU, while assembly language must be interpreted. c. Machine code is written in binary, while assembly language is written in a textual format. d. Machine code and assembly language both require a compiler to be executed.
1. 機械語コードとアセンブリ言語の違いは何か。a. 機械語コードはテキスト形式で書かれ、アセンブリ言語は16進数で書かれる。b. 機械語コードはCPUが直接実行するが、アセンブリ言語はインタープリターによる解釈が必要である。c. 機械語コードは2進数で書かれ、アセンブリ言語はテキスト形式で書かれる。d. 機械語コードもアセンブリ言語も、実行にはコンパイラーが必要である。
2. Why are middle-level programming languages like C important? a. They are used exclusively for Web development. b. They are used to create systems software, such as operating system kernels. c. They do not allow access to hardware features. d. They are used only for academic purposes.
2. Cのような中水準プログラミング言語は、なぜ重要なのか。a. Web開発だけに使われるから。b. オペレーティングシステムのカーネルなど、システムソフトウェアの作成に使われるから。c. ハードウェアの機能へアクセスできないから。d. 学術目的にだけ使われるから。
3. What is an advantage of high-level programming over low-level programming? a. High-level programming languages are less time-consuming for the programmer. b. High-level programming languages are slower. c. High-level programming languages have a lower level of abstraction. d. High-level languages offer less security and reliability.
3. 低水準プログラミングと比べた、高水準プログラミングの利点は何か。a. 高水準プログラミング言語は、プログラマーが費やす時間が少ない。b. 高水準プログラミング言語は遅い。c. 高水準プログラミング言語は、抽象化の水準が低い。d. 高水準言語は、安全性と信頼性が低い。
4. What defines the order of code execution in the imperative programming paradigm? a. the compiler b. data flow and transformations c. the steps in the code d. There is no specific order of execution.
4. 命令型プログラミングのパラダイムでは、何がコードの実行順序を定めるか。a. コンパイラー。b. データの流れと変換。c. コード内の手順。d. 特定の実行順序はない。
5. What is the difference between an IDE and a development environment that is not an IDE? a. An IDE is a single tool for coding, while a non-IDE environment requires no tools. b. An IDE bundles all of the tools into one app with a graphical interface, while a non-IDE environment is a collection of several tools. c. An IDE uses only command-line programs, while a non-IDE environment uses graphical tools. d. A non-IDE environment uses graphical tools only.
5. IDEと、IDEではない開発環境の違いは何か。a. IDEはコーディング用の単一のツールで、IDEでない環境にはツールが不要である。b. IDEはすべてのツールをグラフィカルなインターフェースの1つのアプリへまとめるが、IDEでない環境は複数のツールの集まりである。c. IDEはコマンドラインプログラムだけを使い、IDEでない環境はグラフィカルなツールを使う。d. IDEでない環境はグラフィカルなツールだけを使う。
Exercises 6–10練習問題 6–10
6. What is a critical step that a programmer must focus on when participating in the development of a C program? a. planning the development b. documenting the code c. fully testing the code d. generating code
6. Cプログラムの開発に参加するとき、プログラマーが重点を置くべき重要な段階は何か。a. 開発を計画すること。b. コードの文書を書くこと。c. コードを十分に試験すること。d. コードを生成すること。
7. What is “ELF” in C programming? a. a function library for C programs b. an error logging framework in C c. a coding standard for writing C programs d. a file format for object code
7. Cプログラミングにおける「ELF」とは何か。a. Cプログラム用の関数ライブラリー。b. Cのエラーログ用フレームワーク。c. Cプログラムを書くためのコーディング規約。d. オブジェクトコードのファイル形式。
8. Why is linking necessary in C programming?
8. Cプログラミングでは、なぜリンクが必要か。
a. to combine separate object files into a single executable or library b. to compile the source code into object code c. to debug the program before it is executed d. to run the compiled program on the operating system
a. 別々のオブジェクトファイルを、1つの実行可能ファイルまたはライブラリーへ結合するため。b. ソースコードをオブジェクトコードへコンパイルするため。c. 実行前にプログラムをデバッグするため。d. コンパイル済みプログラムをオペレーティングシステム上で実行するため。
9. What is a core? a. a type of memory used for storing data in a computer b. an individual processor in a CPU chip that can execute instructions c. a program that runs on a computer d. a software module that manages system resources
9. コアとは何か。a. コンピューター内でデータを格納するためのメモリの一種。b. 命令を実行できる、CPUチップ内の個々のプロセッサー。c. コンピューター上で動くプログラム。d. システム資源を管理するソフトウェアモジュール。
10. What is a thread in the context of computing? a. a single task that executes on a core b. a component that stores data in a database c. a network connection between two computers d. a type of memory used in parallel computing
10. 計算技術の文脈で、スレッドとは何か。a. コア上で実行する単一のタスク。b. データベースにデータを格納する構成要素。c. 2台のコンピューター間のネットワーク接続。d. 並列計算で使うメモリの一種。
Exercises 11–15練習問題 11–15
11. What are the roles of a parent thread and child thread in parallel computing? a. The child thread starts other threads and manages the program’s execution. b. The parent thread performs tasks assigned by the child thread. c. The parent thread starts child threads, monitors them, and cleans the program. d. Both parent and child threads perform the same tasks simultaneously.
11. 並列計算における、親スレッドと子スレッドの役割は何か。a. 子スレッドがほかのスレッドを開始し、プログラムの実行を管理する。b. 親スレッドが、子スレッドに割り当てられた仕事を行う。c. 親スレッドが子スレッドを開始し、監視して、プログラムの後始末を行う。d. 親スレッドも子スレッドも、同じ仕事を同時に行う。
12. What are examples of parallel programming models? a. single-threaded and multi-threaded b. interpreter and compiler c. input/output and file systems d. shared memory and message passing
12. 並列プログラミングのモデルの例はどれか。a. シングルスレッドとマルチスレッド。b. インタープリターとコンパイラー。c. 入出力とファイルシステム。d. 共有メモリとメッセージパッシング。
13. What is firmware? a. a code that interacts with hardware devices b. a type of high-level software with high abstraction c. an operating system that runs on embedded devices d. a hardware component that updates software
13. ファームウェアとは何か。a. ハードウェア装置とやり取りするコード。b. 抽象化水準の高い、高水準ソフトウェアの一種。c. 組込み機器で動くオペレーティングシステム。d. ソフトウェアを更新するハードウェア部品。
14. Why is it recommended to start with simple hardware kits when learning embedded systems engineering? a. Simple kits provide advanced processors. b. Simple kits are intended for industrial use and can be used for complex processes. c. Simple kits allow users to build digital circuit design and explore firmware development. d. Simple kits require extensive prior knowledge of x86-64 architecture.
14. 組込みシステムの工学を学ぶとき、単純なハードウェアキットから始めることが勧められるのはなぜか。a. 単純なキットは高度なプロセッサーを提供するから。b. 単純なキットは産業用に作られ、複雑な処理に使えるから。c. 単純なキットを使うと、デジタル回路の設計を作り、ファームウェア開発を探究できるから。d. 単純なキットには、x86-64構成の広範な予備知識が必要だから。
15. What features does the Rust programming language offer that makes Rust more desirable then C? a. Since the language is object oriented, there is higher level data types. b. Rust is a high-level language, so it tends to be more readable. c. Rust provides a standard library and C does not. d. Has the same positive features of C and includes new features supporting higher level data types and parallel programming.
15. Rustプログラミング言語には、Cより望ましくするどのような機能があるか。a. オブジェクト指向言語なので、高水準のデータ型がある。b. Rustは高水準言語なので、読みやすい傾向がある。c. Rustには標準ライブラリーがあり、Cにはない。d. Cと同じ長所を持ち、高水準のデータ型や並列プログラミングに対応する新しい機能を含む。