Submissions/Template scripting


Information

This is an open submission for Wikimania 2010.


Title of the submission

Template scripting

Type of submission (workshop, tutorial, panel, presentation)

Panel

Author of the submission

Victor Vasiliev

E-mail address or username (if username, please confirm email address in Special:Preferences)

vasilvv@gmail.com

Country of origin

Russia

Affiliation, if any (organization, company etc.)

None.

Personal homepage or blog

None.

30-word contribution & benefits statement

???

Abstract

MediaWiki uses its own markup language (which usually referred to as "wikitext"). It was originally intended to be a markup language. However, templates the pages use are written in that markup language as well, so when need of more complex templates arose, parser functions like {{#if}} and {{#expr}} were added. This rapidly turned wikitext into programming language which uses markup syntax. When we faced the need of string functions, the parser's developer refused to enable them and called wikitext with parser functions "the ugliest, most inefficient programming language known to man" (see bug 6455). Another problem with our templates is the fact that they are unreadable. en:Template:Citation/core, having 4642 curly braces (about 25% of non-whitespace characters in this template) and 786 pipe signs ("|"), may be a good example. There are two approaches to solve this problem:

  • Replace specific templates (like mapping templates or citation templates) with parser extensions written in PHP;
  • Introduce a real programming language which may be embedded into the wikitext.

The first way has very limited applicability (though it may be the best approach for some problems). Therefore, the panel will be focused on the latter. On Wikimedia Conference 2010, several issues were discussed. It was decided that we should implement our own language, since existing languages and their interpreters do not fit our requirements (they have dangerous things like loops, platform-dependant limits like execution time, etc.). We already have an existing implementation of such an extension called InlineScripts. It is well-adopted to the MediaWiki environment and has a framework for relatively easy changes of the syntax. At WMCON-2010 we have decided that we need a detailed language description, documentation and use cases investigation before we discuss details. All of them should be ready by July, so panel will be dedicated to the details of the language: syntax, built-in functions, user-defined function system, limits, etc.

Track (People and Community/Knowledge and Collaboration/Infrastructure)

Infrastructure

Will you attend Wikimania if your submission is not accepted?

Yes.

Slides or further information (optional)


Interested attendees

If you are interested in attending this session, please sign with your username below. This will help reviewers to decide which sessions are of high interest. Sign with four tildes. (~~~~).

  1. --Church of emacs 09:16, 10 May 2010 (UTC)[reply]
  2. guillom 21:43, 17 May 2010 (UTC)[reply]
  3. Catrope 21:46, 17 May 2010 (UTC)[reply]
  4. Drbug 14:05, 19 May 2010 (UTC)[reply]
  5. --Ravidreams 07:09, 20 May 2010 (UTC)[reply]
  6. Marclaporte 21:32, 14 June 2010 (UTC)[reply]
  7. Waldir 07:53, 16 June 2010 (UTC)[reply]
  8. Natbrown 13:59, 29 June 2010 (UTC)[reply]