Pythonの基礎 インタープリンタとは?

Python

インタープリンタとは?

インタプリタとは、プログラミング言語で書かれたソースコードないし中間表現を逐次解釈しながら実行するプログラムのこと。「インタープリタ」「インタープリター」などと表記することもある。

コンピュータでプログラムを扱う言語処理系の方式の一つです。
コンピュータ用のプログラム言語で記述されたプログラムを,コンピュータがひとつひとつ解釈し機械語に直しながら実行する言語処理方式をインタープリタ方式といい,入力したプログラムを解釈するプログラムをインタープリタと呼ぶ。インタープリタは実行時の動作やエラーの解析が容易である一方で,プログラムを一挙に機械語に翻訳するコンパイラに比べて実行速度ははるかに遅いです。
プログラムの開発段階ではインタープリタ方式で実行し,できあがったプログラムを日常的に使うにはコンパイラ方式を使うのが一般的です。

代表的なプログラミング言語には、BASIC、Lisp、JavaScript、Python、Rubyなどがあります。
< プログラミング言語の命令を一つずつ,機械語に解釈しながら実行する方式で,解釈実行方式ともよばれます。通訳を介在しながら外国語を話す様を思い浮かべるとよいでしょう。BASIC や Perl などが代表的なインタープリタ方式の言語です。教育目的やそれほど実行速度を気にしないようなアプリケーションを作成するときに利用されます。 作成したソースプログラムをただちに実行できるという点がこの方式のメリットです。一方,解釈しながら実行されるために,コンパイル型に比べると実行速度が遅いというのが欠点です。特にプログラム中の何度も実行されるような部分では,何度も解釈されるので,その無駄は無視できません。出典↓

インタプリタとコンパイラの特徴を併せ持つ言語に「Java」があります。Javaはプログラムコードを事前に中間的なコードであるバイトコードに変換し、仮想マシンの機械語に翻訳して仮想マシン上で実行します。仮想マシンさえあれば,どこでも同じように動作するため、どのプラットフォーム上でも実行可能です。

Python 3.7.3 documentation

Python 3.7.3のdocumentationは、以下からアクセスできます。
Python 3の詳細な解説を参照することができます。

3.12.2 Documentation

英訳

An interpreter is a program that interprets and executes source code or intermediate representations written in a programming language. Sometimes referred to as “interpreter” “interpreter” etc.

It is one of the language processing methods that deal with programs on a computer.
A language processing method in which a computer interprets a program written in a program language for computer one by one and converts it into a machine language is called an interpreter method, and a program for interpreting an input program is called an interpreter. While the interpreter is easy to analyze run-time behavior and errors, it is much slower than a compiler that translates a program into machine language.
In the program development stage, it is common to execute in an interpreter mode, and use the compiler mode to use the finished program on a daily basis.

Typical programming languages ​​include BASIC, Lisp, JavaScript, Python and Ruby.

Java is a language that combines the features of an interpreter and a compiler. Java converts program code into intermediate code bytecode in advance, translates it into virtual machine machine language, and executes it on a virtual machine. As long as you have a virtual machine, it will work the same way anywhere, so it can run on any platform.

タイトルとURLをコピーしました