[WikiEN-l] MediaWiki is getting a new programming language
David Gerard
dgerard at gmail.com
Thu Jul 2 19:02:14 UTC 2009
2009/7/2 Carcharoth <carcharothwp at googlemail.com>:
> Can someone explain in layman's terms what this programming language
> thing is and how it relates to templates?
OK. Open a complicated template. Let's use {{infobox actor}} here.
Look at the wikitext, and you'll see a sea of goop like this:
|image =
{{#if:{{{image|}}}|[[File:{{{image|}}}|{{#if:{{{image_size|{{{imagesize|}}}}}}|{{{image_size|{{{imagesize|}}}}}}|220px}}]]}}
That horrible collection of braces is actually the ParserFunctions
programming language:
http://www.mediawiki.org/wiki/Extension:ParserFunctions
It lets you make a template that is actually a program to produce nice
results from relatively simple template parameters. The language
itself is documented here:
http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
It was created in a completely ad-hoc manner with little planning. So
it's (a) all but unreadable (b) hard to program (c) hard to optimise
on the server end (where these programs actually run).
So the discussion is about picking a new programming language that
wasn't just made up as someone went along. This will have the benefits
of allowing more people to get into template programming. This assists
the encyclopedia as it lets us make nice templates that do useful
things without non-geeks having to understand all the plumbing, it
lets geeks do the plumbing behind such things better, and it lets WMF
sysadmins run the servers without them melting quite as often.
- d.
More information about the WikiEN-l
mailing list