This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Translators/parsing Python


On Mon, Jan 24, 2000 at 02:13:07PM -0500, bickiia@earlham.edu wrote:
> I think there's reason to be optimistic that it will be possible to use
> existing Python interpreter code to parse.  In particular, I'd look to
> whatever portion of Python compiles to .pyc.
> 
> Though I haven't looked at it specifically, my impression of compiled
> Python code is that it speeds up loading by parsing the code into
> something fast to read, without performing any other fancy compiling.  I

It's called ``marshall'' format. It's more or less well
documented. I never tried to read it, yet.

> would imagine that it would be possible to retarget this to create SCM
> objects instead of .pyc files, but in the short term it would probably
> be a good place to start by taking a .pyc file and parsing it into a
> Scheme object -- no doubt a bunch of lists.  I'd even go so far as to

Hmm no. I disagree. I don't think we should touch the pyc
marshalled files at all. Instead, get the code that does the
marshalling retargeted to generate Scheme.

That's because the code to marshall the source and the code to
read marshalled data are almost completely independent. So
getting one of them to work doesn't help a bit on getting the
other one. So getting to read .pyc doesn't help on
interpretting Python. So it's a waste of time IMHO.

However, you bring up the point that _all_ code is marshalled
before execution. If the marshalling stage is mandatory, then
it probably can be ripped off.


[]s,
                                               |alo
                                               +----
--
      I am Lalo of deB-org. You will be freed.
                 Resistance is futile.

http://www.webcom.com/lalo      mailto:lalo@webcom.com
                 pgp key in the web page

Debian GNU/Linux       ---       http://www.debian.org
Brazil of Darkness   --   http://zope.gf.com.br/BroDar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]