parseBlock, steps of compiling

Paul Dufresne dufrp at hotmail.com
Sat May 31 20:41:44 PDT 2003


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