Lecture 5 Notes

Sorry i didnt make this up 10 42 lexical address

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: th semi-infinite extent, the garbage collector collects bindings when they are no longer reachable. This is only determinable at run-time, so we say that this is a dynamic property. £¥ ¢¦¡ $# %© If we didn’t allow ’s to appear as the body (or value) of a , then the let-bindings would expire at the end of the evaluation of the body. This is called dynamic extent, and it is a static property. Because the extent is a static property, you can predict exactly when a binding can be discarded. (“Dynamic” sometimes means “during the evaluation of an expression” and sometimes means “not calculable in advance.” Sorry– I didn’t make this up.) $# %© 10 ¤ 4.2 Lexical Address Analysis We’ve seen how we can use interpreters to model the run-time behavior of programs. We now introduce a new theme to the course: how to use the same technology to analyze or predict the behavior of programs without running them. We will do three kinds of predictions: 1. First, we will do a lexical address analysis. This analysis will predict, at analysis time, where in the environment each identifier will be found at run time. We will see that the analyzer looks like an interpreter, except that instead of passing around an environment, we pass around a static environment, which associates with each identifier whatever we know statically about it. As a result of the lexical address analysis, we will be able to translate our programs into a variable-free form, in which every variable reference is replaced by an address in the environment, and we can replace our interpreter by one that uses these addresses instead of identifiers. 2. In Lecture 6 we will do type analysis. Most languages divide up their expressed values into types. The type of a value determines what operations are appropriate on that value. We will analyze our programs to ensure that no operation is ever performed on inappropriate data. This analysis will enable us to reject programs that are “dangerous,” that is, those pr...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online