[pypy-dev] scheme parser.
arigo at tunes.org
Thu May 10 14:59:15 CEST 2007
On Wed, May 09, 2007 at 07:24:19PM -0300, Leonardo Santagada wrote:
> > Now I am considering if the parser should generate some bytecode?
> > Maybe pickling (not rpythonic) AST tree will be just fine (like in js
> > interpreter)?
> I am pickling the tree only if running on top of CPython, because
> RPython don't support that. And even then, it is really just a hack
> because parsing took a lot of time running on top of cpython. Iam
> going to give you the same advice I got from armin when I started...
> begin with AST and then when you have your parser ready we can see if
> using bytecode really get you faster.
Yes, that's even more true for Scheme, where the AST is very simple.
For now you should just interpret it, and we can see later if speed-ups
can be achieved with bytecode. Also, if you are directly using
rlib.parsing, then you don't need any pickling: parse the source into an
AST, and pass the AST objects directly to the interpreter. (We can
think later if it makes sense to add an equivalent of the .pyc files,
but that's really questions for the very long term only.)
More information about the Pypy-dev