Related articles |
---|
[8 earlier articles] |
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-18) |
Re: How is the concept of scope implemented? kamalpr@hp.com (kamal) (2008-11-18) |
Re: How is the concept of scope implemented? DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-11-19) |
Re: How is the concept of scope implemented? yangjunpro@gmail.com (yangjunpro: Target locked-->Ruby++) (2008-11-18) |
Re: How is the concept of scope implemented? j.vimal@gmail.com (Vimal) (2008-11-19) |
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-19) |
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-19) |
Re: How is the concept of scope implemented? tony@my.net (Tony) (2008-11-19) |
Re: How is the concept of scope implemented? lkrupp@pssw.com (Louis Krupp) (2008-11-21) |
From: | "Tony" <tony@my.net> |
Newsgroups: | comp.compilers |
Date: | Wed, 19 Nov 2008 23:23:01 -0600 |
Organization: | at&t http://my.att.net/ |
References: | 08-11-054 08-11-062 08-11-089 08-11-100 |
Keywords: | storage, symbols |
Posted-Date: | 20 Nov 2008 17:47:23 EST |
"Vimal" <j.vimal@gmail.com> wrote in message
news:08-11-100@comp.compilers...
>> I like the multiple table method, or some kind of
>> hierarchial/multi-data-structure thing. It seems to me though that
>> keeping track of the current scope can be a potential source of
>> inefficiency. For example:
>
> I think the compiler keeps the multiple table method only during
> compilation time, to *fix* the addresses. In your example:
That's 3! I feel so dumb! This is great! (I like learning and knowing
stuff).
>> Developer writes:
>>
>> void my_func()
>> {
>> // func code
>> }
>>
>
> Say we have an `int a;' inside my_func(); the compiler knows that its
> offset is x bytes from the stack pointer (say). It needn't know the
> absolute address and needn't have to output code to compute the
> address during run time. So, I doubt there is much of *computation*
> (at run time) that takes place in statically scoped languages.
I just recently "got a clue" about assembly language that I could relate to
my HP15C RPN calculator. As someone who has done a lot of programming at a
high level (read, above assembly), "the stack" has been rather nebulous
until just recently for me. I DO understand what you are saying though.
To a "high level" developer like me, I just ACCEPT the opening brace of a
function, but that opening (and closing) brace represents all the hidden
details of what the code is doing, curtesy of the compiler, and while my
real goal is being able to code in the language I envision, I am curious
enough about what's going on there to potentially "render it into
submission". ( ;) on the last analogy).
Tony
Return to the
comp.compilers page.
Search the
comp.compilers archives again.