What is the purpose of types in a language?
What is a type system?
What is type checking?
Process of ensuring that a program satisfies languages type compatibility rules.
What is strongly typed?
Language implementation prohibits application of operation to object not intended to support operation.
What is statically typed?
Strongly typed + type checking (mostly) performed before run-time.
What is dynamically typed?
Type checking performed at run-time.
Describe denotional types.

Describe constructive types.
Focuses on the construction.
A type is either

Describe abstraction-based type?
Focuses on the operations that can be performed on the type.
A type is an interface consisting of a set of operations with well-defined semantics.

What is orthogonality?
There are no restrictions on the way features can be combined in a programming language.
For example
What are primitive types?
Built-in types typically corresponding to those supported by hardware.
What are discrete types?
Countable
What are scalar types?
One-dimensional
Describe the contents of a record (structures).
Each record is a collection of fields, each of which belongs to a potentially simpler type.

Records are usually laid out contiguously in memory. However, there may be possible holes for alignment reasons. Smart compilers may re-arrange fields to minimize holes. Why could this be an issue?
A programmer may want to arrange fields to keep certain values in the same cache line. Elimminating gaps may cause multiple memory reads for certain full values.

Name a language that allows records to be packed.
Pascal
What are some pros/cons to record packing?
What are the most common and important composite data types?
Arrays
What is slicing?
A slice or section is a rectangular portion of an array.

What are two lifetime options for arrays?
Global
Local (extend of subroutine)
What are two bound options for arrays?
Static
Dynamic
What are three allocation mechanisms for arrays?
Static
Stack
Heap
When can a compiler allocate space for an array in static global memory?
If the array has a global lifetime and a static shape.
If an array has a local lifetime and a static shape, can its space be allocated in the subroutine’s stack frame at run time?
Explain.
Yes. As long as the exists throughout the execution of a subroutine.