parseBlock, steps of compiling

Lee Salzman lsalzman at telerama.com
Sun Jun 1 06:04:13 PDT 2003


You're overthinking this entirely too much. freeVariables just points
out which variables from other the parent environments the block is
using - nothing more, nothing less! It doesn't store any state at all,
nor should it, nor was it meant to.

As for the bytecode, that's most likely going to be rewritten
completely.

On Sun, Jun 01, 2003 at 03:41:44AM +0000, Paul Dufresne wrote:
> parseBlock seems not to contains any variables at all.
> At first glance, it seems to be because there is no clear distinction 
> between
> block (the parent received) and block (the block Node we are parsing).
> 
> But this make me ask many questions. freeVariables contains the environment 
> of the
> parent at the moment it is created? If so, when will we have actual values 
> for them.
> I means we are building an abstract syntax tree, the program won't have 
> actual values
> until we execute code.
> 
> So I think it goes like this:
> -We parse a file, while parsing, if we see a 'filename' fileIn, we should 
> parse filename
> -At the end, some check and optimizations can be done on the tree
> -Initial execution is done on the program, just to fill block freeVariables 
> with the
> variables of their parents, much like what I suppose it is going in the 
> interpreter
>  (inner blocks don't need to be interpreted)
> -Then, the syntax tree is transformed in Intermediate Representation
> -I guess it is saved in one big file (bytecode)
> -From IR, program can be interpreted by a bytecode interpreter, or compiled 
> lower-level
> 
> Problem: IR does not support addSlot, so expressive power of Slate seems 
> lost to me for
> IR code.
> 
> By the way, adding 8 bits values until we get 255 seems wrong to me. I 
> would prefer
> have bit 7 deciding if we continue to next byte, and bits 0-6 if in first 
> byte, bits 7-13 in byte2,
> bits 14-22 in byte3, etc.
> 
> _________________________________________________________________
> MSN Messenger : discutez en direct avec vos amis !  
> http://messenger.fr.msn.ca/
> 



More information about the Slate mailing list