On Tue, May 3, 2011 at 1:33 PM, Trevor Parscal <tpars...@wikimedia.org> wrote:
> I think the idea that we might break the existing PHP "parser" out into a
> library for general use is rather silly.
>

Well, if that's the case, why was it brought up in the discussion to
begin with? Here's the comment Tim made:

"Now that we have HipHop support, we have the ability to turn
MediaWiki's core parser into a fast, reusable library. The performance
reasons for limiting the amount of abstraction in the core parser will
disappear. How many wikitext parsers does the world really need?"

He tends to think it's an option. Domas mentioned in IRC that he made
a standalone version of the parser a while back, as well.

> The "parser" is not a parser, it's a macro expander with a pile of
> regular-expressions used to convert short-hand HTML into actual HTML. The
> code that it outputs is highly dependent on the state of the wiki's
> configuration and database content at the moment of "parsing". It also is
> useless to anyone wanting to do anything other than render a page into HTML,
> because the output is completely opaque as to where any of it
> was derived. Dividing the "parser" off into a library would require an
> substantial amount of MediaWiki code to be ported too just to get it
> working. On it's own, it would be essentially useless.
>

The parser has a configuration state, takes wikitext in, and gives
back html. It pulls additional data from the database in these steps
as well, yes. However, I don't see how this would be different than
any other implementation of the parser. All implementations will
require configuration state, and will need to deal with things like
templates and extensions.

Though I prefer the concept of alternative parsers (for all the
reasons mentioned in the other threads), I do think having our
reference implementation available as a library is a good concept. I
feel that making it available in a suitable license is ideal.

- Ryan

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to