PL QUIZ 1 - Sheet1 Flashcards

(105 cards)

1
Q

primary design issues for names

A
  • Are names case sensitive?
  • Are the special words of the language reserved words or keywords?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

a string of characters used to identify some entity in a program.

A

name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

used to make programs more readable by naming actions to be performed

A

special words

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

a word of a programming language that is special only in certain contexts

A

keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

a special word of a programming language that cannot be used as a name

A

reserved word

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When more than one variable name can be used to access the same memory location, what is it called?

A

aliases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

determines the range of values the variable can store and the set of operations that are defined for values of the type

A

Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

the contents of the memory cell or cells associated with the variable

A

value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

an association between an attribute and an entity, such as between a variable and its type or value, or between an operation and a symbol

A

binding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

binding where it first occurs before run time begins and remains unchanged throughout program execution

A

static

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

the binding first occurs during run time or can change in the course of program execution

A

dynamic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

a statement in a program that lists variable names and specifies that they are a particular type

A

explicit declaration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

a means of associating variables with types through default conventions, rather than declaration statements

A

implicit declaration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

the process of taking a memory cell to which a variable is bounded from a pool of available memory

A

allocation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

process of placing a memory cell that has been unbound from a variable back into the pool of available memory.

A

Deallocation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

the time during which the variable is bound to a specific memory location

A

lifetime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

variables that are bound to memory cells before program execution begins and remain bound to those same memory cells until program execution terminates

A

static variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

variables whose storage bindings are created when their declaration statements are elaborated, but whose types are statically bound

A

stack-dynamic variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

nameless (abstract) memory cells that are allocated and deallocated by explicit run-time instructions written by the programmer

A

explicit heap-dynamic variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

bound to heap storage only when they are assigned values

A

implicit heap-dynamic variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

the range of statements in which the variable is visible.

A

scope of a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

based on the calling sequence of subprograms, not on their spatial relationship to each other

A

dynamic scoping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

the collection of all variables that are visible in the statement

A

referencing environment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

a variable that is bound to a value only once

A

named constant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
strings of a language
sentences
26
smalls units
lexemes
27
two distinct ways a language can be formally defined
* recognition * generation
28
a device that can be used to generate the sentences of a language
language generator
29
a device used to describe more of the structure of a programming language than can be described with a context-free grammar
attribute grammar
30
synthesized attributes of leaf nodes whose values are determined outside the parse tree
intrinsic grammar
31
defines the structure of valid statements in a language
syntax
32
definitions must be precise to avoid ambiguity and misinterpretation
language generator
33
A widely used notation for expressing language grammar
Backus-Naur Form (BNF)
34
three methods of semantic description
operational, denotational, and axiomatic
35
a method of describing the meaning of language constructs in terms of their effects on an ideal machine
Operation Semantics
36
Uses logical assertions to prove program correctness
Axiomatic Semantics
37
mathematical objects are used to represent the meanings of language constructs
Denotational Semantics
38
execution of machine code program on a von Neumann architecture computer
fetch-execute cycle
39
a broad area of computer applications characterized by the use of symbolic rather than numeric computations
Artificial Intelligence
40
having more than one way to accomplish a particular operation
feature multiplicity
41
a single operator symbol has more than one meaning
operator overloading
42
a relatively small set of primitive constructs can be combined in a relatively small number of ways to build the control and data structures of the language
Orthogonality
43
a measure of how easily a language can be used to create programs for a chosen problem domain
Writability
44
the ability to define and then use complicated structures or operations in ways that allow many of the details to be ignored
Abstraction
45
means that there are very powerful operators that allow a great deal of computation to be accomplished with a very small program
Expressivity
46
it performs to its specifications under all conditions
Reliability
47
testing for type errors in a given program, either by the compiler or during program execution
Type checkiing
48
The ability of a program to intercept run-time errors (as well as other unusual conditions detectable by the program), take corrective measures, and then continue is an obvious aid to reliability
Exception handling
49
having two or more distinct names that can be used to access the same memory cell
aliasing
50
the collection of techniques that compilers may use to decrease the size and/or increase the execution speed of the code they produce
Optimization
51
the ease with which programs can be moved from one implementation to another
Portability
52
the applicability to a wide range of applications
Generality
53
the completeness and precision of the language’s official defining document
Well-definedness
54
The address of the next instruction to be executed is maintained in a register
program counter
55
Why is it useful for a programmer to have some background in language design, even though he or she may never actually design a programming language?
Understanding language design helps programmers choose the right language for a project, write more efficient code, and understand trade-offs in different languages. It also helps when learning new languages quickly.
56
How can knowledge of programming language characteristics benefit the whole computing community?
It leads to better language design choices, improved software maintainability, and enables programmers to write more efficient and reliable code.
57
What programming language has dominated scientific computing over the past 50 years?
Fortran
58
What programming language has dominated business applications over the past 50 years?
COBOL
59
What programming language has dominated artificial intelligence over the past 50 years?
LISP (then later Prolog)
60
In what language is most of UNIX written?
C
61
What is the disadvantage of having too many features in a language?
It makes the language harder to learn, increases complexity, and reduces readability.
62
How can user-defined operator overloading harm the readability of a program?
If misused, it can make code ambiguous and hard to understand, especially when operators are used in non-intuitive ways.
63
What is one example of a lack of orthogonality in the design of C?
Arrays and functions cannot be returned directly from functions, but structures can.
64
What language used orthogonality as a primary design criterion?
ALGOL 68
65
What primitive control statement is used to build more complicated control statements in languages that lack them?
goto
66
What construct of a programming language provides process abstraction?
Subprograms (Functions/Procedures)
67
What does it mean for a program to be reliable?
It means that a program performs correctly under all expected conditions.
68
Why is type checking the parameters of a subprogram important?
It prevents type errors, making the program more reliable and easier to debug.
69
What is aliasing?
Aliasing occurs when two or more names refer to the same memory location, which can lead to unexpected side effects.
70
What is exception handling?
A mechanism that allows a program to detect and respond to runtime errors.
71
Why is readability important to writability?
Readable code is easier to modify, reducing errors and improving maintainability.
72
How is the cost of compilers for a given language related to the design of that language?
A complex language is harder to compile, increasing compiler cost.
73
What have been the strongest influences on programming language design over the past 50 years?
* Computer hardware architecture and * software development methodologies.
74
What is the name of the category of programming languages whose structure is dictated by the von Neumann computer architecture?
Imperative languages
75
What two programming language deficiencies were discovered as a result of the research in software development in the 1970s?
* Inadequate support for data abstraction and * poor control structures.
76
What are the three fundamental features of an object-oriented programming language?
Encapsulation, Inheritance, and Polymorphism
77
What language was the first to support the three fundamental features of object-oriented programming?
SIMULA 67
78
What is an example of two language design criteria that are in direct conflict with each other?
Readability vs. writability * A concise language might be writable but less readable.
79
What are the three general methods of implementing a programming language?
Compilation, Pure Interpretation, and Hybrid Implementation
80
Which produces faster program execution, a compiler or a pure interpreter?
Compiler
81
What role does the symbol table play in a compiler?
It stores variable names, types, and scope information.
82
What does a linker do?
It combines object files into a single executable file.
83
Why is the von Neumann bottleneck important?
It limits CPU speed due to slow memory access.
84
What are the advantages of implementing a language with a pure interpreter?
Better debugging, more platform independence, and no need for compilation.
85
What two common data structures were included in Plankalkül?
Arrays and records.
86
How were the pseudocodes of the early 1950s implemented?
They were implemented by hand, as there were no compilers yet.
87
Speedcoding was invented to overcome two significant shortcomings of the computer hardware of the early 1950s. What were they?
Lack of floating-point operations and slow I/O operations.
88
Why was the slowness of interpretation of programs acceptable in the early 1950s?
Because computers were so expensive that improving programmer productivity was more valuable than program execution speed.
89
What hardware capability that first appeared in the IBM 704 computer strongly affected the evolution of programming languages? Explain why.
Hardware-supported floating-point arithmetic, this allowed higher-level mathematical programming.
90
What was the primary application area of computers at the time Fortran was designed?
Scientific and engineering computations.
91
What was the source of all of the control flow statements of Fortran I?
IBM 704 machine instructions.
92
What dialect of LISP is used for introductory programming courses at some universities?
Scheme.
93
In what version of ALGOL did block structure appear?
ALGOL 60.
94
What language was designed to describe the syntax of ALGOL 60?
Backus-Naur Form (BNF).
95
What data structure that appeared in COBOL originated with Plankalkül?
Records (data structures).
96
What language introduced the case statement?
Pascal.
97
What are two characteristics of C that make it less safe than Pascal?
Manual memory management and lack of array bounds checking.
98
What is a nonprocedural language?
A language where the focus is on "what" should be done rather than "how" (e.g., SQL, Prolog).
99
What is the primary application area for which Ada was designed?
Military and embedded systems.
100
What are the concurrent program units of Ada called?
Tasks
101
Why does C++ include the features of C that are known to be unsafe?
For backward compatibility.
102
Define syntax and semantics.
* Syntax refers to the structure and rules that define how statements in a programming language are formed. * Semantics refers to the meaning of those statements.
103
Describe the operation of a general language generator.
A language generator defines valid strings in a language using formal grammar rules.
104
What is the difference between a synthesized and an inherited attribute?
Synthesized attributes are computed from child nodes. Inherited attributes are passed from parent nodes.
105
In what way are reserved words better than keywords?
Reserved words cannot be redefined by the user, avoiding confusion in code interpretation.