Programming Languages Flashcards
What is a value?
A value is an expression that cannot be simplified any further.
What is the term for:
an expression that cannot be simplified any further.
Value
What term describes:
the types of all preceding bindings in the file.
static environment
what term describes
the value of all preceding bindings in the file.
dynamic environment
Give a rough definition of the static environment.
The static environment is roughly the types of all preceding bindings in the file.
Give a rough definition of the dynamic environment.
The dynamic environment is roughly the value of all preceding bindings in the file.
What is the term for “how an expression or statement is written”?
syntax
stack data structure containing a element for each function that hasn’t finished executing.
call stack
What is the term for “how an expression or statement is interpreted (i.e. how it is evaluated and type checked)”?
semantics
describes a function call when there are no more pending computation after it is evaluated.
Tail call
Describes the position of an expression e
, when there are no pending computations after e
is evaluated.
tail position
What are the questions we ask when we encounter a new language construct?
- What is the syntax?
- What are the type checking rules?
- what are the evaluation rules?
What is a “call stack”?
stack data structure containing a “stack frames” for each function that hasn’t finished executing.
used to refer to a sub-type of an algebraic type.
variant
In the context of algebraic-types, what does the term “carries” mean?
describe when a variant wraps one or more value.
within the context of compound types, this is a piece of information that distinguishes one variant of a “one-of” type from the others.
tag
a function with free variables that have been closed (or bound) by an environment.
closure
A variable used within a function body that is neither a local variable or a function parameter.
free variable
What is a “stack frame”?
A data structure containing information about a function invocation.
What is a “tail call”?
A function call that occurs in “tail position”.
What is “tail position”?
Describes the position of an expression e
, when there are no pending computations after e
is evaluated.
How many kinds of compound types are there?
There are 3 types.
List the types of compound types.
- sum-types or “each-of” type
- algebraic-types or “one-of” type
- self-referential type
what is a variant in the context of “compound types”?
A variant refers to a sub-type of an algebraic type.