Names, Scopes, and Bindings Flashcards
Covers Names, Scopes, and Bindings
Define Names
Mnemonic string used to represent something else; Sort of like tokens. Allows us to refer to variables, types, operations, etc… rather than low-level concepts like addresses.
Define Binding
Association between 2 things; a name and the thing it names.
What is Binding Time?
The point at which binding is created. Or, more generally, the point at which any implementation decision is made.
What is a regular expression?
Formal notation for the lexical structure to ensure clear rules.
What is the scope of the Binding?
The part of the program (textually) in which the binding is active.
Some things are defined during language design time. Name a few.
- Program structure
- Primitive types
- Constructors
Name some items that can be defined during the language implementation time.
- I/O
- Number of bits in primitive types
- How overflow is handled
- Organization of maximum size of stack and heap
What are some pros/cons defining more at language design time than implementation time.
- Portability
- Disallows architecture specific optimization
What are some pros/cons of binding in early stages VS later stages
- Greater efficiency
- Less flexibility
(T/F) The compiler is written during the programming language design time.
False. The compiler is written during the implementation phase.
At what point can programmers modify the programming language?
During the language implementation time.
What things are determined during program writing time?
- Algorithms
- Names
- Data Structures
What things are determined during link time?
- Layout of the whole program in memory
What is determined during load time?
- Choice of physical addresses
What things are determined during compile time?
The layout of statically defined data in memory
What things are determined during run time?
- Variable values
- Sizes of strings
- Start-up time
What is Static Binding?
Binding that happens before run time.
What is Dynamic Binding?
Binding that occurs during run time.
Compilers VS Interpreters: Which has early binding time?
Compilers
Name the 7 language times or phases that binding depends on.
- Design time
- Implementation time
- Program writing time
- Compile time
- Link time
- Load time
- Run time
Define Bindings Lifetime
The period of time between the creation and the destruction of a name-to-object binding.
Define Object Lifetime
The time between the creation and destruction of an object.
Name key events during an objects lifetime
- Creation of object
- Creation of bindings
- How objects are referenced using the bindings
- Temporary deactivation of binding
- Reactivation
- Destruction of both bindings and objects.
When does a dangling reference occur?
When a binding outlives the object.





