CS 326 final endterm
Characterize programming languages by: - -syntax, semantics, and implementation
-how it looks, what it means, and how it executes
Imperative languages - Von Neumann (side-effects) and object oriented languages (interactions
between objects)
Von Neumann Languages - based on statements that influence subsequent computation; side
effects
Object-oriented languages - compute based on interactions between objects; each object has
internal state and functions to manage state
Functional languages - inspired by lambda calculus, uses recursive definition of functions
logic/constraint based languages - based on propositional logic; goal-directed searches using list
of logical rules
Declarative languages - Functional (scheme) and Logic based
Machine language - sequence of bits that directly control processor
assembly language - mnemonic abbreviations that are translated by an assembler; machine-
dependent
high level languages - machine-independent languages; do not correspond 1-to-1 with machine
language; translated by compiler or interpreter
, Compiler - translates into the target language (machine language)
Interpreter - implements a virtual machine whose machine language is the high-level language
compilation vs interpretation - - interpretation has better flexibility and diagnostics, allows for
program features to depend on the input
- Compilation has better performance
front end of the compiler: - scanner, parser, semantic analysis
- server to determine the meaning of the source program
back end of the compiler: - - target code generation, and code improvements
- serves to construct the target program
what is passed into a scanner? - character stream
what is passed into a parser? - token stream
what is passed in for semantic analysis? - parse tree
Compilation process - 1. lexical analysis (scanner)
2. syntax analysis (parser)
3. semantic analysis
4. machine-independent code improvement
5. target code generation
Characterize programming languages by: - -syntax, semantics, and implementation
-how it looks, what it means, and how it executes
Imperative languages - Von Neumann (side-effects) and object oriented languages (interactions
between objects)
Von Neumann Languages - based on statements that influence subsequent computation; side
effects
Object-oriented languages - compute based on interactions between objects; each object has
internal state and functions to manage state
Functional languages - inspired by lambda calculus, uses recursive definition of functions
logic/constraint based languages - based on propositional logic; goal-directed searches using list
of logical rules
Declarative languages - Functional (scheme) and Logic based
Machine language - sequence of bits that directly control processor
assembly language - mnemonic abbreviations that are translated by an assembler; machine-
dependent
high level languages - machine-independent languages; do not correspond 1-to-1 with machine
language; translated by compiler or interpreter
, Compiler - translates into the target language (machine language)
Interpreter - implements a virtual machine whose machine language is the high-level language
compilation vs interpretation - - interpretation has better flexibility and diagnostics, allows for
program features to depend on the input
- Compilation has better performance
front end of the compiler: - scanner, parser, semantic analysis
- server to determine the meaning of the source program
back end of the compiler: - - target code generation, and code improvements
- serves to construct the target program
what is passed into a scanner? - character stream
what is passed into a parser? - token stream
what is passed in for semantic analysis? - parse tree
Compilation process - 1. lexical analysis (scanner)
2. syntax analysis (parser)
3. semantic analysis
4. machine-independent code improvement
5. target code generation