[Newcompiler] Properties for AST

Andrew Tween amtween at hotmail.com
Mon Apr 9 16:25:29 UTC 2007


Hi,
> > Could the source itself be considered to be a compressed
> > representation of the
> > AST? ;)
> >
>
> Yes... but not when you annotate the AST nodes with things that are
> inherently
> non-textual.
>
> Of course you could do some serialization into (non-human-readable)
> text, but the question is if it's not better to then searialize the
> objects without caring
> about text.

There is some of that going on already with TextActions stored in source as ...
    ]style[(30 6 481)f2,c000126000if2LObject Comment;,f2
for example.

> It's a bit a "point of view" question: How do I think about the
> system, and
> do I restrict my thinking by forcing myself to be text only?

Sure.
XML springs to mind here (and not in a good way).

>
> As I said: maybe in the end, people will not like it. In most
> languages Classes
> are not objects, too, as you can parse the code on demand like
> eclipse does....
> And people love it.

I actually think that people will like it, so long as ...
    1. they get some extra functionality
    2. they can stiil view and edit their methods as source.
    3. they can still open the .changes file in a text editor and search for
stuff.

>
> Same problem, same solution. Smalltalk opted to model Classes as
> object, with
> no source level representation at all. I think we should do the same
> for methods.

This is almost the case anyway. CompiledMethods contain enough info to browse
senders etc.
And you could ditch the source completely and just run with the CompiledMethods.
The problem comes when a compiledMethod cannot be decompiled into its original
source.

Cheers,
Andy



More information about the Newcompiler mailing list