Chapter 1 Abstract Machines

How abstract machine is closely related to the programming languages.

How, without requiring us to go into the specific details of any particular implementations, it allows us to describe what an omplementation of a programming language is.

interpereter and compiler

How abstract machines can be structured in hierarchies that describe and implement complex software systems.

1.1 The concepts of Abstract Machine and of Interpreter

From machine to abstract machine.

Definition 1.1 :

Language L,

An abstract macine for L, ML.

ML is any set of data structures and algorithms which can perform the storage and execution of programs written in L.

ML is composed of a stroe and an interperter.

store -- stroe data and programs.

interpreter -- executes the instructions contained in programs.

1.1.1 The Interpreter

An “execution method” common to all interpreters.

Operations types:

1. Operations for processing primitive data;

2. Operations and data structures for controlling the sequence of execution of oper-ations;

3. Operations and data structures for controlling data transfers;

4. Operations and data structures for memory management.

Definition 1.2 (Machine Language):

Given an abstract machine, ML, the language L "undsertood" by ML's interpreter is called the machine language of ML.

Low-level languages, whose abstract machines are very close to, or coincide with, the physical machine.

High-level languages, which support the use of constructs that use appropriate abstraction mechanisms

to ensure that they are independent of the physical characteristics of the computer.

1.1.2 An Example of an Abstract Machine: The Hardware Machine

1.2 Implementation of a Language

The implement of a programming language L means implementing an abstract machine which has L as its machine language. (There may many different abstract machines that have L as their language.)

  • Balance between performance and flexibility :
    • implementation in hardware;
    • simulation using software;
    • simulation(emulation) using firmware.

Microprogramming --

the term used for simulation using micro-programming, is emulation.

the level at which microprogramming occurs is called firmware.

So, observe that a micro-programmable machine constitutes a single, simple example of a hierarchy composed of two abstract machines.

As the last note, let us emphasise the fact, which should be clear from what we have said so far, that one should not talk about an “interpreted language” or a “com-piled language”, because each language can be implemented using either of these techniques. One should, instead, talk of interpretative or compiled implementations of a language.

1.3 Hierarchies of Abstract Machines