Lecture #3
CIS400 9/15/99
Language
evaluation cont.
per
Tucker:
·
Expressivity-
readability
·
Well
defined- syntax, semantics
·
Data
types & structures
·
Modularity
·
I/O
facilities
·
Portability
·
Efficiency
·
Pedagogy-
easy to teach & learn
·
Generality-
useful in wide range of applications
per
Sebesta:
·
Readability
:
- Simplicity
-
Orthogonality
-
Control
statements
-
Data
structures
-
Syntax
·
Writeability:
-
Simplicity
-
Orthogonality
-
Support
for abstraction
·
Reliability:
-
Type
checking
-
Exception
handling
-
Readability/
writeability
-
Aliasing
– 2 different ways to refer to the same spot in memory/storage
·
Cost:
-
Training
-
Code
development
-
Compilation
-
Execution
-
Maintenance
Language
design
per
Hoare:
·
Focus
on one well known feature at a time, (could be basic as data type)
·
Examine
many alternative features designed by others & choose the best, rejecting
those that are inconsistent
per
Horowitz:
·
Choose
specific application (logic, financial, etc.)
·
Keep
design committee small
·
Choose
precise design goals
·
Release
versions to small sets of interested people
·
Revise
language definition
·
Attempt
to build compiler & write formal language definition- semantics
·
Revise
language definition
·
Produce
clear and concise manual
·
Provide
"production quality" compiler and wide distribution
·
Write
primers explaining language
Language
processors
·
Computers-
integrated set of algorithms & data structures capable of storing and
executing programs
·
Composite ® actual (hardware) computer-wires and
circuits
·
Computer ® software simulated computer
programming
language is implemented by developing a translator capable of transforming
programs in one language into machine language of some computer where it can be
executed correctly
STATE
·
Instructions-
represent state transition via program execution
·
You
have a choice: implement with hardware, (quick yet inflexible)
implement with software, (slow and flexible)
COMPUTER
ORGANIZATION
Operations:
Sequence control how do we decide which instruction
to take next
Note: control sequence
changes accomplished by the program address register
Interpreter
·
Fetch
op code
·
De-code
op code
·
Fetch
necessary operands
·
Branch
to primitive (OPk)
·
Then
repeat until the end of the program
COMPUTER
AS A MULTI-LEVEL MACHINE:
Each
level supported by the level below it:
level 5 problem oriented language
translated by compiler
level 4 assembly language level
translated by assembly
level 3 operating system
partial interpretation by OS
level 2 conventional machine language
interpreted by micro-program
level 1 micro-programming
directly executed by hardware
level 0 digital logic
gates & transistors,
program address registers
TRANSLATION
VS. INTERPRETATION
·
Translation:
program written for level n machine translated to level 1
machine
·
Advantages:
-statements decoded ONCE
-efficient execution
·
Disadvantages:
-space consumption
·
Interpretation:
program written for level n + 1 is executed on level n
machine
·
Advantages:
-space conservation
·
Disadvantages:
-execution
TRANSLATORS
·
Compiler:
high level® machine
·
Assembler:
one to one, assembly ® machine
·
Loader:
relocatable version of machine code ® machine code
·
Link
editor: combines collections of relocatable programs ® single relocatable machine program
·
Pre-processor:
extended language ® standard language