Hi Jean-Marc,

On Thu, Sep 17, 2009 at 3:02 PM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
>> This is kind of a chicken-and-egg situation. It is hard to have
>> confidence in a one-man show even if I promise to maintain eLyXer for
>> the foreseeable future.
>
> This is where having built-in support for lyx2lyx would really increase
> confidence.It means that eLyXer will continue to work even if you do not
> update it for some release. In the current scheme, you would have to
> update it at each format change in trunk if you want it to work with
> trunk.

True, if the format changes the parser needs to change. However it is
quite configurable without changing any code, in part due to the
lyx-devel concerns about maintainability -- well, it paid off. For
example in the great Inset transition around 1.6.0, when
  \begin_inset LatexCommand bibtex:BibTeX
became
  \begin_inset CommandInset bibtex:BibTeX
(maybe it's the opposite, cannot really remember). You know how many
lines of code had to be changed? None at all, just add one line to the
configuration file. Plus, the old format still works. eLyXer can parse
any arbitrary combination of old and new commands, and it doesn't use
the version number at the top. To me that is added value in the form
of flexibility.

Now, a big format change would require code modifications, like the
proposed new XML format. I have one thing to say about that: please
don't do it. I say this after working with XML for several years, and
even writing a complete parser. XML is great for some things, like
machine-to-machine communication using a fixed format; but it is
really lousy for expression. Too verbose and annoying. And terrible
for parsing by humans, or even worse writing it. One typo and it all
goes to hell -- you cannot locate the error, and what's worse, quite
often the machine cannot find the error for you. But if you go this
route, somebody would probably write an XSL to produce
(horrible-looking) XHTML automatically and eLyXer would not last much
longer -- probably followed afterwards by LyX itself after ceasing to
produce acceptable LaTeX.

But back to Earth: right now eLyXer seems to parse everything from
2.0svn correctly, so there is not much trouble on the horizon. If it's
not doing something correctly for you just let me know.

> I know this has been discussed in the past, but it might be worth
> reconsidering.

Sure, why not. But I really don't see why it would be better (by my
own ignorance). Does lyx2lyx create an in-memory representation of a
document before outputting the result? Is this in-memory
representation flexible enough to accommodate any kind of LyX entity?
Can it parse just a little bit and then output it? Does it parse fast?
Does it consume little memory? eLyXer is designed with all these
constraints in mind.

Alex Fernández.

Reply via email to