Language translators and IDEs
導入済み
19:11
オペレーティングシステム
あなたは一度も見たことがなく、これからも見ることはない——それにもかかわらず、常にそこにあります。開くアプリ、保存するファイル、画面をタップする每一次に、見えない…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| compiler/kəmˈpaɪlə/ | コンパイラ |
| programmer | A person who writes and develops computer programs. |
| machine instructions | Commands in machine code that a processor can execute directly. |
| arithmetic/əˈrɪθmətɪk/ | Calculations with numbers, such as adding and subtracting. |
| source code/sɔːs kəʊd/ | ソースコード |
| translator/trænˈsleɪtə/ | 翻訳器 |
| machine code/məˈʃiːn kəʊd/ | 機械語 |
| processor/ˈprəʊsesə/ | The component that executes instructions and performs the operations of a computer or similar system. |
| compiling | The process of translating a whole program before it runs. |
| interpreting | The process of translating and executing a program one statement at a time. |
| assembler/əˈsemblə/ | アセンブラ |
| assembly language/əˈsemblɪ ˈlæŋɡwɪdʒ/ | アセンブリ言語 |
| mnemonic instruction | An assembly language command that uses a short word for an operation. |
| labels/ˈleɪblz/ | Names used to mark positions in a program's code. |
| symbolic addresses | Names used to refer to memory locations instead of their actual addresses. |
| addresses | Numbers that identify specific locations in a computer's memory. |
| hardware/ˈhɑːdweə/ | The physical parts of a computer system that can be touched. |
| device drivers/dɪˈvaɪs ˈdraɪvəz/ | Programs that allow an operating system to control hardware devices. |
| embedded systems | Computers built into larger devices to perform specific tasks. |
| loops | Parts of a program that repeat instructions a number of times or until a condition is met. |
| high-level program | A program written in a language designed to be easier for people to understand. |
| object code/ˈɒbdʒekt kəʊd/ | オブジェクトコード |
| executable/ɪɡˈzekjʊtəbl/ | 実行可能ファイル |
| syntax errors | Mistakes that break the rules for writing code in a programming language. |
| run time/rʌn taɪm/ | The period during which a program is running on a computer. |
| operating system/ˈɒpəreɪtɪŋ ˈsɪstəm/ | System software that manages hardware resources and provides services for applications. |
| interpreter/ɪnˈtɜːprɪtə/ | インタープリタ |
| statement/ˈsteɪtmənt/ | A line of code that tells a program what to do. |
| execution speed | The rate at which a computer carries out a program's instructions. |
| portability | The ability of a program to run on different platforms. |
| platform/ˈplætfɔːm/ | The combination of processor and operating system on which a program runs. |
| debugging/ˈdiːbʌɡɪŋ/ | The process of finding and correcting errors in a program. |
| bytecode/ˈbaɪtkəʊd/ | バイトコード |
| portable/ˈpɔːtəbl/ | ポータブル |
| virtual machine/ˈvɜːtʃuːəl məˈʃiːn/ | 仮想マシン |
| just-in-time compilation/dʒʌst ɪn taɪm ˌkɒmpɪˈleɪʃn/ | 即時コンパイル |
| native code | Machine code that can run directly on a particular processor. |
| console mode | A way of running a program using text input and output. |
| command line | A place where users type text commands to interact with a computer. |
| integrated development environment/ˈɪntɪɡreɪtɪd dɪˈveləpmənt enˈvaɪrənmənt/ | 統合開発環境 |
| context-sensitive prompts/ˈkɒntekst ˈsensɪtɪv prɒmpts/ | 文脈依存型プロンプト |
| identifiers | Names chosen by programmers for parts of a program. |
| keywords/ˈkiːwɜːdz/ | Words with special meanings that are part of a programming language. |
| parameters/pəˈræmɪtəz/ | Values that specify a model or function, or named inputs that a subroutine receives. |
| auto-complete/ˈɔːtəʊ kəmˈpliːt/ | 自動補完 |
| dynamic syntax checks/daɪˈnæmɪk ˈsɪntæks tʃeks/ | 動的構文チェック |
| prettyprint/ˈpretɪprɪnt/ | コード美化 |
| strings/strɪŋz/ | Sequences of characters used as text in a program. |
| comments/ˈkɒments/ | Explanatory text in source code or markup that does not execute as a program instruction. |
| indentation/ˌɪndenˈteɪʃn/ | Space placed at the start of a line to show structure, including code blocks in languages that use it syntactically. |
| expand and collapse | A feature that shows or hides sections of code. |
| block/blɒk/ | A group of statements treated as a single section of code. |
| breakpoints/ˈbreɪkpɔɪnts/ | ブレイクポイント |
| single stepping/ˈsɪŋɡl ˈstepɪŋ/ | ステップ実行 |
| variables/ˈveərɪəblz/ | A quantity or named value that can change or take different values. |
| expressions | Combinations of values and operations that produce a value. |
| report window/rɪˈpɔːt ˈwɪndəʊ/ | レポートウィンドウ |
| warnings | Messages that point out possible problems in a program. |
| function/ˈfʌŋkʃn/ | A mapping that assigns exactly one output to each allowed input. |
| logic error/ˈlɒdʒɪk ˈerə/ | A mistake in an algorithm or program that produces an incorrect result despite valid syntax. |
| run-time error messages | Messages that report errors occurring while a program is running. |
誰もコンピュータが自らプログラムを書けるとは信じていなかった
- 1952年、グレース・ホッパーは最初のコンパイラを構築した。これはプログラマーの表記法を機械命令に変換するプログラムである。「誰も信じていなかった」と彼女は後に語っている。「走れるコンパイラを持っていたのに、誰も触ろうとしなかった。彼らはコンピュータは計算しかできないと言ったのだ。"
- 以来使ってきたあらゆる言語はこの考えに基づいている:あなたは人間向けにソースコードを書き、翻訳器がプロセッサが実行する機械語を生成する。
- 翻訳器には3つの種類と1つの有名なハイブリッドがあり、試験ではいつ使い分けるべきか、なぜそうするのかを答えることを求める。
- この授業は翻訳器、コンパイルと解釈のトレードオフ、両方を併用するJava、そして IDE が提供するツールについてである。
ソースコード、機械語、アセンブラ
- プロセッサは機械語のみを実行する。翻訳器は人間向けに書かれたプログラムを機械語に変換する。
- アセンブラはアセンブリ言語を機械語に翻訳する:各助記命令、
LDD、ADD、JMPは、それぞれ正確に1つの機械語命令に変換され、ラベルと記号アドレスは実際のアドレスに置き換えられる。 - アセンブリは、プログラマがハードウェアを直接制御したい場合に使用される:デバイスドライバー、組み込みシステム、ゲームの最も内側のループなど。
Match each translator to what it does.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Assembler: assembly→machine code; compiler: all-at-once to an executable; interpreter: line by line at run time.
コンパイラ
- コンパイラは、実行される前に、高レベルのプログラムをすべて機械語であるオブジェクトコードに翻訳します。実行可能ファイルを作成し、翻訳の最後にすべての構文エラーを一覧として報告します。
- プログラムを実行することはありません。コードが正常であれば、コンパイラをインストールしたままでも、何度でも実行可能ファイルを動かすことができます。
- 実行時に何もしないため高速ですが、機械語は特定のプロセッサとオペレーティングシステムに依存します。
The compiler route: source to running program
Step through how a compiler works — translating the whole program once, before it runs. Contrast it with an interpreter, which translates and runs one line at a time.
A compiler differs from an interpreter because it:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
A compiler translates all at once into an executable that runs without the compiler. An interpreter runs line by line.
Put the compiler route in order, from writing code to running it.
難易度 3/5 · 200 コイン + 今日初回達成時の小ボーナス
A compiler translates the whole program once into an executable; that file then runs without the compiler.
インタープリタ
- インタープリタは、高レベルのプログラムの1文ずつを翻訳して、直ちに実行し、次の文に進みます。
- 実行可能ファイルは生成されません。最初のエラーに出会うと、その行番号と共に報告するため、修正後すぐに再実行できます。
- プログラムを実行するたびに、ソースコードとインタープリタの両方が必要であり、毎回翻訳をやり直すため、実行速度は遅くなりますが、インタープリタが存在する場所であれば同じソースコードがどこでも動作します。

一度翻訳して配布するか、逐次翻訳するか

When does an interpreter report an error?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
An interpreter runs line by line, so it reports an error at the moment it reaches that line — handy during development.
An interpreter produces no stand-alone executable, so the interpreter itself must be installed to run the program.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
An interpreter translates and runs line by line each time — there is no separate executable to ship, unlike a compiler.
メリットとデメリット(採点基準に基づく)
| コンパイラ | インタープリタ | |
|---|---|---|
| 実行速度 | 高速、既に機械語 | 遅い、各実行時に翻訳 |
| ユーザーが必要なもの | 実行可能ファイルのみ;ソースコードは非公開 | ソースコードとインタープリタ |
| エラーの発見 | 翻訳後にまとめてリスト表示 | 開発中に各行で個別に報告 |
| コードの変更 | プログラム全体を再コンパイル | 編集してすぐに再実行 |
| ポータビリティ | 1つのプラットフォーム;それぞれ再コンパイルが必要 | インタープリタが存在するどこでも動作 |

You should choose a compiler when:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Compiled executables are fast and stand-alone. Interpreters suit quick development and portable scripts.
Which points favour using an interpreter while developing a program? Select すべて that apply.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Fast edit-run cycles and errors at their line are the interpreter's strengths. Run-time speed is the compiler's.
演習例:作成中はインタープリタ、完成後はコンパイラ
- 開発者がプログラムを作成している間はインタープリタを使用し、完了後はコンパイラを使用します。それぞれの使い方を説明せよ。 [4]
- 開発中、インタープリタは完全な翻訳を待たずに、部分的に書かれたプログラムを即座に実行します。エラーに出会うと行番号を報告するため、開発者はそれを修正してすぐに再実行できます。これはデバッグを容易にする高速な「編集-実行」サイクルです。
- プログラムが完了すると、コンパイラはプログラム全体を実行可能ファイルに翻訳します。これにより高速に動作し、ユーザーのコンピュータには翻訳者が必要なく、かつソースコードを非公開に保つことができます。
- 各ツールについて2点:その機能と、なぜその工程に適しているか。
Java: 部分的にコンパイルされ、部分的に解釈される
- Javaソースコードは、機械語ではないどのプロセッサーにも対応しないコンパクトでポータブルな中間形式であるバイトコードにコンパイルされます。
- 仮想マシンであるJVMは、どのマシンで実行されてもバイトコードを解釈するか、または** JITコンパイル**を使用して、実行中に最も頻繁に使用される部分をネイティブコードに変換します。
- コンパイル段階では構文エラーを早期に検出します。解釈段階では、JVMが存在するどこでも1つのバイトコードファイルを動作させることができます。シラバスの例として、コマンドラインから実行するテキストプログラムのコンソールモードがあります。

一度書いてどこでも動作:1つのバイトコードファイル、プラットフォームごとに1つのJVM

Java compiles to bytecode that runs on a JVM. The main benefit is:
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Bytecode is platform-independent; any JVM can run it (with JIT giving near-native speed for hot code).
Java's compiler produces platform-independent ____, which a virtual machine then interprets.
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
Bytecode is an intermediate form: compiled once, then run by the JVM on any platform. That is what makes Java partially compiled and partially interpreted.
このカードは修正されたため、翻訳が更新されるまで英語で表示されます。
Worked example: why compile to bytecode and then interpret?
- Explain why Java is compiled to bytecode rather than straight to machine code.
- A compiler produces machine code for a particular processor and operating system, so the program will not necessarily run on a machine with a different platform.
- Java's compiler targets a virtual machine instead, so the bytecode is identical everywhere. Each platform supplies its own JVM to interpret it.
- The cost is speed: interpreting bytecode is slower than running native code, which is why the JVM adds just-in-time compilation 即时编译 for the hot parts.
IDEとその4つの機能グループ
- 統合開発環境(IDE)は、プログラムの作成、翻訳、実行、デバッグを行うための1つのアプリケーションです。シラバスではその機能を4つに分類しています。
- コーディングのため:コンテキスト依存のプロンプトが、その地点に適切な識別子、キーワード、パラメータを表示し、自動補完が名前を完了させます。
- 初期エラー検知のため:動的構文チェックは、翻訳前に入力中にミスを下線部で示します。表示のため:prettyprintは、キーワード、識別子、文字列、コメントを異なる色で表示し、一貫性のあるインデントを行います;展開と折りたたみはブロック本体を隠してアウトラインを見やすくします。
- デバッグのため:ブレイクポイントは指定した行でプログラムを一時停止します;ステップオーバー/ステップインは1行ずつ実行します;ウィンドウでは変数や式の数値を表示します;レポートウィンドウはエラー、警告、出力をリスト表示します。

コーディング、エラー検知、表示、デバッグ

Which feature is part of an IDE's debugger?
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
A debugger lets you set breakpoints, step through code line by line, and inspect variable values.
Match each IDE feature to its syllabus group.
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
Coding, initial error detection, presentation, debugging: the four groups the syllabus names, one feature each here.
演習例:Calculate()におけるバグの特定
- 関数
Calculate()が予期せぬ値を返しています。IDEのデバッグ機能を使って原因を見つける方法を記述せよ。 [4] Calculate()の最初の行にブレイクポイントを設定し、プログラムが通るのではなくそこで停止するようにする。- ステップオーバー/ステップインで関数を1行ずつ進めます。各ステップ後、変数の値や、IDEに監視させている式の値を読み取り、予想した値と比較します。
- 値が正しくなる前の行にロジックエラーがあります。レポートウィンドウは、その過程で発生するランタイムエラーメッセージや出力も表示します。

一時停止、ステップ、ęd査
Put the steps of finding a logic error with a debugger in order.
難易度 3/5 · 200 コイン + 今日初回達成時の小ボーナス
Pause, step, inspect, compare, locate. Each is one of the debugging features the syllabus lists.
見落としやすいポイント
- コンパイラはプログラムを実行しない。全体的に翻訳して、実行可能なファイルを作成する。
- インタープリタは最初のエラーで停止するのに対し、コンパイラはすべてのエラーをリスト化する。これらを混同しないこと。
- 「高速」には「実行時」、そして「ポータブル」には「インタープリタが存在する場所であれば同じソースコードがどこでも動作する」という意味が必要である。
- IDEの機能をシラバスの4つのグループに分類する:ブレイクポイントはデバッグ、prettyprint(美観整形)は表示、コンテキスト敏感なプロンプトはコーディングである。バイトコードは機械語ではない。
理解できましたか
- アセンブラ: アセンブリ命令1つが機械語命令1つに対応 · コンパイラ: プログラム全体を、実行前に翻訳して実行可能なファイルを作成し、すべてのエラーをリスト化する · インタープリタ: ステートメントを1つずつ、順次実行し、最初のエラーで停止し、実行可能なファイルは生成しない
- コンパイラ: 速度、配布、ソースコードの秘匿性のために使用される · インタープリタ: 素早い編集-実行サイクル、ポータビリティ、初心者のための学習に使用される
- Javaはポータブルなバイトコードにコンパイルされ、JVMによって解釈またはJITコンパイルされる: 部分的にコンパイルされ、部分的に解釈される
- IDEの機能は4つのグループに分かれる: コーディング(コンテキスト敏感なプロンプト)、初期エラー検出(動的構文チェック)、表示(prettyprint、展開と折りたたみ)、デバッグ(ブレイクポイント、ステッピング、変数、レポートウィンドウ)
何が問題でしたか?この内容はサイトの運営チームだけが確認します。