On Tue, May 13, 2008 at 5:23 AM, Fabio Kung <[EMAIL PROTECTED]> wrote:
> charles, perhaps it's time to give git/mercurial/bazaar a chance!
> Much more easier to contribute for those kind of branches.
>
> (btw, great job, again!)
>
>
>
>
>  On Tue, May 13, 2008 at 6:57 AM, Charles Oliver Nutter
> <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > Man, I don't know why I start into these things in the middle of the
> night.
> >
> > I refactored the interpreter to be a pure tree-walker. Each Node now has
> an "interpret" method, which means no double-dispatching visitors, no giant
> switch...just polymorphic dispatch from one node to the next. This does a
> couple things:
> >
> > - halves the size of interpreted stack traces in the interpreter (since
> evalInternal is now gone)
> > - eliminates the suspected overhead of the big switch
> > - makes interpreted mode execution faster than Ruby 1.8.6 in every
> benchmark I've tried, and as much as 25-50% faster than the previous
> interpreter.
> >
> > But it's not complete, and I could use some help completing it.
> >
> > - Because it walks the tree directly, null nodes are VERY BAD. I've
> started in a few nodes to replace them with a default singleton NilNode, but
> I don't know how that will affect IDEs using the AST nor whether it's
> entirely kosher. But I think it's worth eliminating the terminal nulls
> finally, since it means we never have to null check anywhere in the
> tree-walk.
> > - I had to disable the RewriterVisitor tests in MainTestSuite since they
> depend on certain sequences of nodes terminating in nulls. Obviously these
> would probably need to be fixed.
> > - I had to disable testPositions in test_index because it failed wherever
> it expected terminal nulls to produce specific output.
> > - The provided patch has some extra logging on in LoadService that will
> need to be removed later. You'll get some stack traces during the early
> phases of testing that can be ignored...they're expected failovers in some
> bogus file loading tests.
> >
> > I'm attaching the patch containing the current work, which I have
> committed to a local branch. I think it's worth getting it 100% for 1.1.2,
> since it means that even if not compiled, we execute code much faster than
> Ruby 1.8.6.
> >
> > - Charlie
> >

I thought about doing this in the past, but I had a couple reservations:
1. IDE consumers will get more than they need.  We could extend each node:
   class AliasNode { ... }
   class AliasNodeInterp extends AliasNode { ... }

   I guess this is pretty easy

2.  Mainly killing nulls in AST nodes before they leave parse.  We could
post-process and create NoopNode or something similiar, but it is not easy
to kill them in parser.  Though possible.

-Tom

-- 
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: [EMAIL PROTECTED] , [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to