This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Python transformer for Guile?
earlier i wrote:
> one thing i have wondered about in the past is whether the parsing
> code used to implement the source language (in this case python) can't
> be re-used for the task -- at least from a technical perspective.
neil> I have wondered exactly this for Elisp. It seems like it should work:
neil> all you have to do (using the Elisp case as an example - I don't know
neil> Python) is branch the reader code at the point where it creates a
neil> LispObject for whatever it has just read so that it creates either a
neil> LispObject or a SCM. I suspect that the main problem would be code
neil> management - how do you make sure that the two branches stay up to
neil> date with each other? (This problem applies independently of whether
neil> the Guile code is in the Emacs codebase or in a copy of Emacs' read.c
neil> in the Guile codebase.)
neil> Or am I being seriously naive here?
well, i don't think i have a good answer for you because i was
wondering the same thing [whether i was being naive, not you of
course!] :-)
as far as the code management goes, it might be nice if both the
source language and the translator used a common library for the
parsing code.
if i understood one of lalo martins' comments correctly, it isn't
necessarily going to be easy to re-use the parsing code for an
arbitrary implementation of a source language.
i don't suppose language implementors can be encourage to implement
their languages so that the parsing portions can be reused nicely by
translators...