Programming Languages

Slides:



Advertisements
Similar presentations
Chapter 3:: Names, Scopes, and Bindings
Advertisements

Names, Scope, Memory, and Binding. Name, Scope, and Binding A name is exactly what you think it is – Usually think of identifiers but can be more general.
Names and Bindings.
Various languages….  Could affect performance  Could affect reliability  Could affect language choice.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
CS 330 Programming Languages 10 / 16 / 2008 Instructor: Michael Eckmann.
Names, Bindings, Type Checking, and Scopes
Chapter 10 Storage management
3/17/2008Prof. Hilfinger CS 164 Lecture 231 Run-time organization Lecture 23.
Chapter 10 Storage Management Implementation details beyond programmer’s control Storage/CPU time trade-off Binding times to storage.
Run-Time Storage Organization
Run time vs. Compile time
The Concept of Variables
Chapter 9: Subprogram Control
Run-time Environment and Program Organization
1 Run time vs. Compile time The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage.
Names and Bindings Introduction Names Variables The concept of binding Chapter 5-a.
1 Contents. 2 Run-Time Storage Organization 3 Static Allocation In many early languages, notably assembly and FORTRAN, all storage allocation is static.
1 Chapter 5: Names, Bindings and Scopes Lionel Williams Jr. and Victoria Yan CSci 210, Advanced Software Paradigms September 26, 2010.
COP4020 Programming Languages
Name Binding and Object Lifetimes Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Concepts Lecture.
CS 403: Programming Languages Lecture 2 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
1 Binding Time and Storage Allocation (Section ) CSCI 431 Programming Languages Fall 2003 A modification of slides developed by Felix Hernandez-Campos.
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
1 Chapter 5 Names Bindings Type Checking Scope. 2 High-Level Programming Languages Two main goals:Two main goals: –Machine independence –Ease of programming.
Compiler Construction
1 Names, Scopes and Bindings Aaron Bloomfield CS 415 Fall
Chapter 5: Programming Languages and Constructs by Ravi Sethi Activation Records Dolores Zage.
Chapter 7 Runtime Environments. Relationships between names and data objects As execution proceeds, the same name can denote different data objects Procedures,
Chapter 3 :: Names, Scopes, and Bindings Michael L. Scott School of Computer & Information Engineering, Sangji University Kwangman.
Storage Bindings Allocation is the process by which the memory cell or collection of memory cells is assigned to a variable. These cells are taken from.
Introduction A variable can be characterized by a collection of properties, or attributes, the most important of which is type, a fundamental concept in.
Basic Semantics Associating meaning with language entities.
Copyright © 2009 Elsevier Chapter 3:: Names, Scopes, and Bindings Programming Language Pragmatics Michael L. Scott.
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 9.
COMP3190: Principle of Programming Languages
Concepts of programming languages Chapter 5 Names, Bindings, and Scopes Lec. 12 Lecturer: Dr. Emad Nabil 1-1.
Programming Languages and Design Lecture 6 Names, Scopes and Binding Instructor: Li Ma Department of Computer Science Texas Southern University, Houston.
CS 330 Programming Languages 10 / 23 / 2007 Instructor: Michael Eckmann.
LECTURE 13 Names, Scopes, and Bindings: Memory Management Schemes.
Names, Scope, and Bindings Programming Languages and Paradigms.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Operational Semantics (Slides mainly.
Run-Time Environments Presented By: Seema Gupta 09MCA102.
Code Generation Instruction Selection Higher level instruction -> Low level instruction Register Allocation Which register to assign to hold which items?
Object Lifetime and Pointers
Storage Allocation Mechanisms
Chapter 3:: Names, Scopes, and Bindings
Data Types In Text: Chapter 6.
Names and Attributes Names are a key programming language feature
CS 326 Programming Languages, Concepts and Implementation
CS 326 Programming Languages, Concepts and Implementation
Type Checking, and Scopes
CS 3304 Comparative Languages
Run-time organization
Run-Time Storage Organization
Run-Time Storage Organization
Names, Binding, and Scope
Memory Allocation CS 217.
Binding Times Binding is an association between two things Examples:
Lecture 13: The Procedure Abstraction; Run-Time Storage Organisation
UNIT V Run Time Environments.
Name Binding and Object Lifetimes
Run Time Environments 薛智文
CSE 3302 Programming Languages
point when a program element is bound to a characteristic or property
RUN-TIME STORAGE Chuen-Liang Chen Department of Computer Science
Run-time environments
Presentation transcript:

Programming Languages Tevfik Koşar Lecture - VII February 7th, 2006

Roadmap Names Scopes Binding Binding Times Static vs Dynamic Binding Object Lifetime & Storage Management

Name, Scope, and Binding A name is exactly what you think it is Most names are identifiers Constants, variables, functions symbols (like '+') can also be names A binding is an association between two things, such as a name and the thing it names The scope of a binding is the part of the program (textually)in which the binding is active

Binding Time Binding Time is the point at which a binding is created or, more generally, the point at which any implementation decision is made language design time program structure, control flow, possible types language implementation time Coupling of I/O to OS arithmetic overflow Maximum sizes of stack and heap Precision of the (number of bits) of fundamental types

Binding Time Implementation decisions (continued ): program writing time algorithms, names compile time Mapping of high level code to machine language link time layout of whole program in memory A name in one module refers to an object in another module load time OS loads the program into memory before running choice of physical addresses

Binding Time Implementation decisions (continued): run time value/variable bindings, sizes of strings subsumes program start-up time module entry time elaboration time (point at which a declaration is first "seen") procedure entry time block entry time statement execution time

Static vs Dynamic Binding The terms STATIC and DYNAMIC are generally used to refer to things bound before run time and at run time, respectively “static”  binding before run time "dynamic“  binding at run time

Binding In general, early binding times are associated with greater efficiency Later binding times are associated with greater flexibility Compiled languages tend to have early binding times Interpreted languages tend to have later binding times

Object Lifetime Key events creation of objects creation of bindings references to variables (which use bindings) (temporary) deactivation of bindings reactivation of bindings destruction of bindings destruction of objects

Object Lifetime The period of time from creation to destruction is called the LIFETIME of a binding If object outlives binding it's garbage If binding outlives object it's a dangling reference The textual region of the program in which the binding is active is its scope In addition to talking about the scope of a binding, we sometimes use the word scope as a noun all by itself, without an indirect object

Storage Management Object lifetimes correspond to one of three storage allocation mechanisms: Static: absolute address retained throughout program’s execution Stack: Allocated & deallocated in last-in, first-out order, with subroutine calls and returns) Heap: Allocated and deallocated at arbitrary times. Stack and heap is used for dynamic allocation

Static Allocation Static allocation for Machine language translation of the source code Global variables Local but static variables explicit constants (including strings, sets, etc) scalars may be stored in the instructions