Lecture 9: Understanding Run-time Environment Representation and
Control In Algol-like languages like Pascal, Algol W, and C/C++,
all of the environments that exist at any point during a
computation can be collectively represented using a stack. This
representation for environments is particularly advantageous
because the environment stack can be implemented as an
elaboration of the control stack included in the architecture of
a modern computer to support procedure calls. Algol-like
languages are almost always compiled to machine code instead of
interpreted like LC and Jam. Nevertheless, during program
execution, the compiled machine code must perform all of the
same operations on program data structures as interpreted code.
The major difference between the two approaches is that a
compiler typically has the opportunity to perform far more
program analysis enabling it to precompute quantities that are
computed by an interpreter during program execution. Almost all
modern machines provide a control stack to s