[WikiEN-l] MediaWiki is getting a new programming language

Aryeh Gregor Simetrical+wikilist at gmail.com
Fri Jul 3 21:23:48 UTC 2009


On Fri, Jul 3, 2009 at 4:28 PM, Apoc 2400<apoc2400 at gmail.com> wrote:
> The current template code is ugly, but it does work.

It uses up an enormous amount of CPU resources, and there have been
some cases where it's spectacularly failed.  Complicated templates
have been responsible for bringing down sites more than once.  If
[[Michael Jackson]] had been written in simple wikitext with no
templates, the rush to read it probably wouldn't have brought down
Wikipedia, for instance -- it was only so severe because the page took
many seconds to parse.

There have been previous incidents too.  In one case I can't recall
the specifics of, a sysadmin had to delete a template on eswiki after
it crashed at least that site (I think also affecting other sites on
the same cluster, can't recall).

Not to mention, of course, that there are plenty of people (especially
programmers) who would be happy to help out with some template coding
-- but don't because the code is so horrifying.

> I understand the developers want to replace it with a new template
> programming language, but we should be aware of the risks. Starting over
> from scratch and making it clean this time is one of the most common ways to
> begin a spectacular failure in software development. Joel Spolsky write a
> good column on it in 2000:
> http://www.joelonsoftware.com/articles/fog0000000069.html

No one is suggesting that ParserFunctions will be disabled.  The new
system will be added in parallel, and assuming it's really superior,
it will replace ParserFunctions over time.  (That essay is irrelevant
here anyway.  We're not talking about rewriting MediaWiki or any other
project from scratch.)

> Is it even possible to sandbox Lua to guard against any exploits, even the
> kind that just overloads the servers?

That's one of the major problems with the suggestion.  It's part of
why nothing has been finalized yet.  (The other key problem is making
sure Wikipedia content is easily usable by third parties on shared
hosting.)

> Will it integrate well with articles
> written in Wikicode?

That would depend on the implementation details, which are very far
from being worked out.

> How long will it take until we can use it?

This is all still purely theoretical at this point.  We haven't even
worked out if a solution is possible, let alone started setting even
the most preliminary timetables.

> Most people don't need to understand advanced templates, just use it. There
> is actually no lack of powerful templates. We have a lot of them. The
> problem is that they are too hard to use.

Partly because some things are too difficult to do in ParserFunctions.
 More intelligent parameter handling would be possible using a real
language.  Of course, StringFunctions would work as well, to a lesser
extent.

> It is used as
> {{Birth date and age|1993|2|4|mf=yes}}. If we had the StringFunctions
> extension enabled it could be simplified to take dates like 1993-02-04
> rather than 1993|2|4. Perhaps it could even take plain text dates like
> "February 4, 1993".

This should already work just fine using {{#time}}.  I'd say most
likely, nobody's bothered to do it because template programming is so
incredibly obnoxious that only a dedicated few can muster the
willpower to struggle through it.  A real language with normal syntax
would mean that someone like me -- a programmer -- could go over right
now and fix it up in a couple of minutes.  But I'm not even going to
try messing with such a mess of curly braces.

> We are stuck with templates that are hard to use because the developers are
> against allowing useful programming constructs in wikicode.

Not all are.



More information about the WikiEN-l mailing list