6. Virtual Machines

A virtual machine executes a programs written in a specific language.

Interpreter

Purpose: execute a program written in the interpreter's language.

Flexibility: replace interpreter (portability, efficiency).

Implementation: Has components program store, working memory, program counter, and methods to execute the instructions in the language.

Emulator

Purpose: simulate a hardware processor in software.

Flexibility: modifying emulator is easier than changing hardware.

Rule-based Interpreter

Purpose: interprete rule set using fact base.

Flexibility: replace interpreter.

Implementation: has components rule store, working memory, rule matcher (instead of program counter), and a rule interpreter.

Note: layer and facade could also be viewed as virtual machines, but lack program counter.
Previous group Next group Back to the top