Programming Languages Flashcards
What a subprogram side effects?
Variables in the calling environment are unexpectedly changed.
What is a side effect?
When evaluating an expression/function has the result of changes in the environment.
What are some common reasons for Program errors?
- Failure to initialise
- Aliasing
- Expression evaluation errors
What does it mean to fail to initialise?
Variable is being used before it is initialised.
Define aliasing:
Two or more distinct names refer to the same storage location. Changing one variables changes another.
What are some examples of expression evaluation errors?
- Out-of-range
- array subscript
- division by zero
- arithmetic overflow
What is the main criteria for the choice of programming languages for Critical Systems?
- Logical soundness
- Complexity of formal language definition
- Expressive power
- Security
- Verifiability
- Bounded space and time requirements
Define logical soundness:
The programming language is clear and precise
What does the criteria “Complexity of formal language definition” mean?
There are simple formal definitions of the language features. If the language is too complex it will lead to errors in compilers and support tools
What does the criteria “Expressive Power” mean?
Program features can be expressed easily and efficiently? The easier it is to write a program the easier it is to verify it
What does the criteria “Security” mean?
The programming language can detect errors before execution?
What does the criteria “Verifiability” mean?
The programming language provides support for verifying that the program code meets the specification
What does the criteria “Bounded space and time” mean?
The programming language ensures the time and memory constraints are not exceeded
Why do we not invent new programming langues?
Creating a new programming langue is a complex task. Reliability and predictability is key and therefore new untested and regulated systems are dangerous.