Транслятор – это... Виды трансляторов. Преобразование и трансляция программы

Programs, like people, require a translator or translator to translate from one language to another.

Basic concepts

The program is a linguistic representation of the calculations: i → P → P (i). The interpreter is a program, the input of which is program P and some input data x. It performs P on x: I (P, x) = P (x). The fact that there is a single translator capable of executing all possible programs (which can be represented in a formal system) is a very deep and significant discovery of Turing.

The processor is an interpreter of machine language programs. As a rule, interpreters for high-level languages ​​are too expensive to write, so they are translated into a form that is easier to interpret.

Some types of translators have very strange names:

  • Assembler translates assembler programs into machine language.
  • The compiler translates from a high level language to a lower language.

– , S T , : P → X → Q. , ∀x. P() = Q().

the translator is




, , -. - , , :





→ () → → () → → ().

, , . JIT- , , . , .

.

:

→ → → () → .

:

  • . .
  • : M N , M + N (), M × N ( ).

types of translators




, . .









. , . JavaScript C JavaScript- C, . .

– , : , . -, , .

:

  • – , .
  • , , .
  • – -, .

broadcast program




?

, , , :

  • ;
  • ;
  • ;
  • ;
  • ;
  • ;
  • ;
  • ;
  • .

, , , , , , .

, , . . , , ?

:

  • : , , ;
  • : , RISC CISC, , , ..;
  • : , , , , , , , , , , , , , , , , , , , , , , , , , . .;
  • ;
  • : , , , , ;
  • : , ( ), (, , , , , , );
  • (, , ): , , , API-, , .

program conversion




, :

  • . ? ? ? ?
  • : - ?
  • . . , .
  • . ? ? ?
  • . , . , .
  • . , . , , LLVM, RTL JVM. C JavaScript.
  • . , , .
  • . . .

dynamic compilation




:

, ( , ):

  • ( ) ( ), .
  • ( ) .
  • . – .
  • ( ).
  • ( ), ( ) , . . .
  • , (, ).
  • - . .

, .

object file




()

, , .

, , , .

, , :

  • , ;
  • ;
  • ;
  • .

()

. , . . (LL LR) , - . .

, , . :

  • k = 5 * (7 – y;
  • j = /5;
  • 56 = x * 4.

( , . .) .

, . Java- , :

  • ;
  • ;
  • ;
  • ;
  • ;
  • .

input program




, , .

. RISC- . CISC-, , .




All Articles