[Newcompiler] Properties for AST

Andrew Tween amtween at hotmail.com
Mon Apr 9 13:51:54 UTC 2007


Hi Marcus,
----- Original Message ----- 
From: "Marcus Denker" <denker at iam.unibe.ch>
To: "The New Compiler, AST, IRBuilder,Closures..."
<newcompiler at lists.squeakfoundation.org>
Sent: Monday, April 09, 2007 12:14 PM
Subject: Re: [Newcompiler] Properties for AST


> >
> > Today, the source is gettable from .sources and .changes. So there
> > is no need to
> > store it in an AST, or to use an AST to produce it.
> > Can I infer from what you have said that you are intending to get
> > rid of method
> > source from .changes and .sources?
> >
>
> just some researchy stuff... nothing really finished, so it's not in
> a state to be defended ;-)
> I know that most people's reaction to the stuff will be "just parse
> the source". But that's ok,
> I think I will be able to make my point as soon as it's finished.

Ok. Thanks.
I remember a discussion after a UK smalltalk User group meeting last year where
the question of whether it was better to store source or an AST came up. From
what I remember, most people thought that storing an AST was better. I made the
point then that if an AST can be transformed into source, and if source can be
transformed into an AST, then the two are equivalent, and it doesn't matter
which is stored except for considerations of memory/disk space, the overhead of
performing each transformation, etc.
    If one of these transformations is not ~always~ possible, then some
information has been lost that it might be beneficial to retain, possibly by
storing the other representation instead (or store both representations, or a
third representation).

>
> I need an AST-like representation, possibly compressed later, for the
> whole image.
> Currently the image is 204MB large, our of which way over 100MB are
> tokens, which are not
> needed... some information of these is needed, but not the tokens
> themselves.

Could the source itself be considered to be a compressed representation of the
AST? ;)

Cheers,
Andy



More information about the Newcompiler mailing list