On Fri, Sep 24, 2004 at 04:03:46PM +0200, KJ wrote:
> Hello,
> 
> I've been wondering for some time about this, so I thought, why not ask.
> 
> The thing is, I've been playing a few times with (Parrot, but also .NET)
> compilers, and my conclusion was that the most difficult part is getting 
> assignments
> right (when by value, when by ref, etc.). (that is, any construct, such 
> as while, is
> only a set of labels, the most important thing is assignments. Even 
> translating
> function calls are easier than assignments).
> 
> Anyway, when one creates a simple language, compiling local variables
> can easily be done through PIR's ".local" syntax. However, when 
> assigning to
> locals, you're really just assigning to registers, not actually storing
> variables in local pads. (and when registers run out, they're being spilled
> to an array in P31, right?).
> 
> So, my question is, why would one need lexical pads anyway (why are they 
> there)?
> 
> Klaas-Jan
> 
> 

If your language has no equivalent of string eval, lexical values
can live directly in registers. If it has some string eval
statement, you need to provide the appropriate context when such
an eval is used. That's what scratchpads is about. Hopefully, in
many places, we will be able to do without scratchpad at run time.

--
 stef


Reply via email to