Why do local variables have to be stack dynamic to support recursion?
Why do local variables have to be stack dynamic to support recursion?
Machine architecture and programming languages
� Programming languages reflect the underlying gadget
� Modern computers use van Neumann architecture
� There are number one additives
� Memory, which shops each this system instructions and the records
� The processor, which offers instructions to adjust the facts in memory
� In a programming language,
� The abstractions for the memory cells are the variables
� The abstractions for the processor are functions
Fundamental issues of variables
� The attributes of variables
� Name
� Address
� Type
� Value
� Lifetime
� Scope
� Concepts involving variables
� Alias
� Binding instances
� Type Checking
� Strong typing
� Type compatibility
� Static & dynamic scoping
Names � a fundamental attribute of variables
� Design issue of the programming language
� Should the names be case sensitive?
� Should special names be reserved words or keywords?
� A keyword can be used by the programmer as an identifier.
� A reserved word cannot.
� How many characters are allowed in a name?
� Which characters should be allowed in names?
Addresses � another fundamental attribute of variables
� The address of a variable is the memory address with which it is associated.
� This association is made in the symbol table for static variables.
� In some languages it is possible for the same name to be associated with different addresses at different time in the program
� Different subprograms may have local variables with the same name
� It is also possible to have multiple variables associated with the same address
� The variables that access the same memory location are called aliases
Step by step
Solved in 2 steps