HYBRID IMPLEMENTATION SYSTEMS - IMPLEMENTATION METHODS

  • Language implementation systems are a compromise between compilers and pure interpreters; they translate high-level language programs to an intermediate language designed to allow easy interpretation.
  • This method is faster than pure interpretation because the source language statements are decoded only once. Such implementations are called hybrid implementation systems.
  • The process used in a hybrid implementation system is shown in below Figure.
  • Fig: Hybrid Implementation System
  • Instead of translating intermediate language code to machine code, it simply interprets the intermediate code.
  • Perl is implemented with a hybrid system. Perl programs are partially compiled to detect errors before interpretation and to simplify the interpreter.
  • Initial implementations of Java were all hybrid. Its intermediate form, called byte code, provides portability to any machine that has a byte code interpreter and an associated run-time system.
  • Together, these are called the Java Virtual Machine. There are now systems that translate Java byte code into machine code for faster execution.
  • A Just-in-Time (JIT) implementation system initially translates programs to an intermediate language. During execution, it compiles intermediate language methods into machine code when they are called.
  • The machine code version is kept for subsequent calls. JIT systems are now widely used for Java programs. Also, the .NET languages are all implemented with a JIT system.

Comments