Organisation of Programming Languages II
Organisation of Programming Languages II
LANGUAGES
(CMP 401)
Language construct were designed more from the point of view of the
machines instead of the users.
Aliasing
4. Language design
The cost of executing programs written in a language isi greatly
influenced by the design.
Some language that requires many run-time type checks will prohibit
fast code execution, regardless of the quality of the compiler.
A simple trade off can be made between compilation cost and execution
speed of the compiled code using optimisation.
In a von Neumann computer, both the data and programs are stored in
the same memory.
Results of operations in the CPU are then moved back to the memory.
Nearly all the digital computers built since the 1940s are based on this
architecture.
INFLUENCES ON LANGUAGE DESIGN
Von Neumann Architecture
INFLUENCES ON LANGUAGE DESIGN
Von Neumann Architecture
The execution of a machine code program on a von Neumann
architecture occurs in a process called the fetch-execute cycle.
Always remember that the program resides in the memory but are
executed by the CPU.
Each instruction to be executed must be moved from memory to the
processor.
The address of the next instruction to be executed is maintained in a
register called the program counter.
The fetch-execute cycle is as follows:
initialize the program counter
repeat forever
fetch the instruction pointed to by the program counter
increment the program counter to point at the next instruction
decode the instruction
execute the instruction
end repeat
LANGUAGE IMPLEMENTATION
METHODS
From the von Neumann Architecture, two of the primary
components of a digital computer are: the processor and
internal memory.
The user programs form another layer over the top of the layer of
virtual computers.
LANGUAGE IMPLEMENTATION
METHODS
Layered interface of virtual computers, provided by a
typical computer system
LANGUAGE IMPLEMENTATION
METHODS
There are several methods of implementing a
programming language:
Compilation
PureInterpretation
Hybrid Implementation Methods
LANGUAGE IMPLEMENTATION
METHODS
QUESTIONS!