Dynamic variables

D. R. Hanson, Todd A Proebsting

Research output: Chapter in Book/Report/Conference proceedingConference contribution

10 Citations (Scopus)

Abstract

Most programming languages use static scope rules for associating uses of identifiers with their declarations. Static scope helps catch errors at compile time, and it can be implemented efficiently. Some popular languages-Perl, Tcl, TeX, and Postscript-offer dynamic scope, because dynamic scope works well for variables that "customize" the execution environment, for example. Programmers must simulate dynamic scope to implement this kind of usage in statically scoped languages. This paper describes the design and implementation of imperative language constructs for introducing and referencing dynamically scoped variables-dynamic variables for short. The design is a minimalist one, because dynamic variables are best used sparingly, much like exceptions. The facility does, however, cater to the typical uses for dynamic scope, and it provides a cleaner mechanism for so-called thread-local variables. A particularly simple implementation suffices for languages without exception handling. For language s with exception handling, a more efficient implementation builds on existing compiler infrastructure. Exception handling can be viewed as a control construct with dynamic scope. Likewise, dynamic variables are a data construct with dynamic scope.

Original languageEnglish (US)
Title of host publicationProceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)
Pages264-273
Number of pages10
StatePublished - 2001
Externally publishedYes
EventACM SIGPLAN'01 Conference on Programming Language Design and Implementation (PLDI) - Snowbird, UT, United States
Duration: Jun 20 2001Jun 22 2001

Other

OtherACM SIGPLAN'01 Conference on Programming Language Design and Implementation (PLDI)
CountryUnited States
CitySnowbird, UT
Period6/20/016/22/01

Fingerprint

Computer programming languages

ASJC Scopus subject areas

  • Computer Science(all)

Cite this

Hanson, D. R., & Proebsting, T. A. (2001). Dynamic variables. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) (pp. 264-273)

Dynamic variables. / Hanson, D. R.; Proebsting, Todd A.

Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). 2001. p. 264-273.

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Hanson, DR & Proebsting, TA 2001, Dynamic variables. in Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). pp. 264-273, ACM SIGPLAN'01 Conference on Programming Language Design and Implementation (PLDI), Snowbird, UT, United States, 6/20/01.
Hanson DR, Proebsting TA. Dynamic variables. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). 2001. p. 264-273
Hanson, D. R. ; Proebsting, Todd A. / Dynamic variables. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI). 2001. pp. 264-273
@inproceedings{810a0d163bbb48cd95389e92c7c399a1,
title = "Dynamic variables",
abstract = "Most programming languages use static scope rules for associating uses of identifiers with their declarations. Static scope helps catch errors at compile time, and it can be implemented efficiently. Some popular languages-Perl, Tcl, TeX, and Postscript-offer dynamic scope, because dynamic scope works well for variables that {"}customize{"} the execution environment, for example. Programmers must simulate dynamic scope to implement this kind of usage in statically scoped languages. This paper describes the design and implementation of imperative language constructs for introducing and referencing dynamically scoped variables-dynamic variables for short. The design is a minimalist one, because dynamic variables are best used sparingly, much like exceptions. The facility does, however, cater to the typical uses for dynamic scope, and it provides a cleaner mechanism for so-called thread-local variables. A particularly simple implementation suffices for languages without exception handling. For language s with exception handling, a more efficient implementation builds on existing compiler infrastructure. Exception handling can be viewed as a control construct with dynamic scope. Likewise, dynamic variables are a data construct with dynamic scope.",
author = "Hanson, {D. R.} and Proebsting, {Todd A}",
year = "2001",
language = "English (US)",
pages = "264--273",
booktitle = "Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)",

}

TY - GEN

T1 - Dynamic variables

AU - Hanson, D. R.

AU - Proebsting, Todd A

PY - 2001

Y1 - 2001

N2 - Most programming languages use static scope rules for associating uses of identifiers with their declarations. Static scope helps catch errors at compile time, and it can be implemented efficiently. Some popular languages-Perl, Tcl, TeX, and Postscript-offer dynamic scope, because dynamic scope works well for variables that "customize" the execution environment, for example. Programmers must simulate dynamic scope to implement this kind of usage in statically scoped languages. This paper describes the design and implementation of imperative language constructs for introducing and referencing dynamically scoped variables-dynamic variables for short. The design is a minimalist one, because dynamic variables are best used sparingly, much like exceptions. The facility does, however, cater to the typical uses for dynamic scope, and it provides a cleaner mechanism for so-called thread-local variables. A particularly simple implementation suffices for languages without exception handling. For language s with exception handling, a more efficient implementation builds on existing compiler infrastructure. Exception handling can be viewed as a control construct with dynamic scope. Likewise, dynamic variables are a data construct with dynamic scope.

AB - Most programming languages use static scope rules for associating uses of identifiers with their declarations. Static scope helps catch errors at compile time, and it can be implemented efficiently. Some popular languages-Perl, Tcl, TeX, and Postscript-offer dynamic scope, because dynamic scope works well for variables that "customize" the execution environment, for example. Programmers must simulate dynamic scope to implement this kind of usage in statically scoped languages. This paper describes the design and implementation of imperative language constructs for introducing and referencing dynamically scoped variables-dynamic variables for short. The design is a minimalist one, because dynamic variables are best used sparingly, much like exceptions. The facility does, however, cater to the typical uses for dynamic scope, and it provides a cleaner mechanism for so-called thread-local variables. A particularly simple implementation suffices for languages without exception handling. For language s with exception handling, a more efficient implementation builds on existing compiler infrastructure. Exception handling can be viewed as a control construct with dynamic scope. Likewise, dynamic variables are a data construct with dynamic scope.

UR - http://www.scopus.com/inward/record.url?scp=0034819688&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=0034819688&partnerID=8YFLogxK

M3 - Conference contribution

AN - SCOPUS:0034819688

SP - 264

EP - 273

BT - Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)

ER -