ACM Transactions on Programming Languages and Systems (TOPLAS) - Lecture notes in computer science Vol. 174
Compilers: principles, techniques, and tools
Compilers: principles, techniques, and tools
Run-time detection of undefined variables considered essential
Software—Practice & Experience
Introduction to the theory of programming languages
Introduction to the theory of programming languages
Hi-index | 0.00 |
Most programming languages ignore the problem of undefined variables and permit compilers to allow the leftover contents of the memory cells belonging to such variables to be referenced. Although efficient, this type of semantics does not support software engineering, in that defects may arise in subtle ways, and may be difficult to locate. Two other types of semantics that better support software engineering are to either initialize all variables to some default (e.g., zero), or to treat all references to undefined variables as illegal. Of these two types of semantics, the latter one has been argued by some to be superior in terms of software engineering, but conventional implementations of this semantics have been significantly less efficient. In this paper, we propose a new implementation of this semantics whose efficiency compares favorably, for certain realistic programs, with the semantics of initializing all variables to default values.