Submissions/Converting templates to Lua

From Wikimania 2014 • London, United Kingdom

After careful consideration, the Programme Committee has decided not to accept the below submission at this time. Thank you to the author(s) for participating in the Wikimania 2014 programme submission, we hope to still see you at Wikimania this August.

Submission no. 5012
Title of the submission

Converting templates to Lua

Type of submission (discussion, hot seat, panel, presentation, tutorial, workshop)


Author of the submission

Mr. Stradivarius

E-mail address

Special:EmailUser/Mr. Stradivarius


Mr. Stradivarius

Country of origin



In March 2013, the Scribunto extension was activated on Wikimedia wikis, giving users access to the Lua programming language from wiki pages. Lua-based templates can be anywhere from twice as fast to 50 times as fast as their wikitext counterparts, and Lua gives template writers access to many useful programming techniques. However, the barrier to entry to learning Scribunto is quite high. While there is an excellent reference manual for the extension, and while there are plenty of good Lua tutorials available online, there is a lack of a decent tutorial that deals specifically with Scribunto. This presentation will attempt to bridge this gap by explaining the template conversion process step by step.

Topics covered will include:

  • A history of Scribunto in 60 seconds
    A quick overview of Scribunto, what it is, and why it was developed.
  • When not to convert a template
    Not all templates need converting to Lua. Simple templates are often faster and easier to understand when left as wikitext. This section will introduce things to look out for when considering whether or not to convert a template.
  • Hello world and beyond
    The traditional way of starting to learn a programming language is by running a "hello world" program. This section will demonstrate a Scribunto hello world program, and will explain why it is different from a hello world program written in standard Lua.
  • The invisible parameter: how frame objects work
    One thing that can confuse people new to Scribunto is that you don't need to "pass through" parameters in the same way that you do in templates. This section explains how this works and why the functionality was introduced.
  • Blank arguments and other gremlins
    In wikitext templates, blank arguments are treated as false. However, in Lua, they are treated as true. This has some interesting consequences that can trip up the unwary programmer. This section explains how to avoid headaches caused by this and other differences between wikitext and Lua code.
  • How do I do that in Lua? Tips and tricks compared
    Wikitext templates have access to a wide array of syntax, including parser functions, magic words, and other templates. Some of these have direct equivalents in Scribunto, while others require programmers to be more creative. This section will demonstrate how to replicate some popular template coding tricks in Lua.

Technology, Interface & Infrastructure

Length of session

30 minutes

Will you attend Wikimania if your submission is not accepted?


Slides or further information

The presentation will have slides, which will be uploaded here when they are completed.

Special requests


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 a hash and four tildes. (# ~~~~).

  1. Tpt (talk) 16:13, 16 February 2014 (UTC)[reply]
  2. Vogone (talk) 22:19, 17 February 2014 (UTC)[reply]
  3. --Base (talk) 05:58, 20 February 2014 (UTC)[reply]
  4. --Xelgen (talk) 12:28, 2 March 2014 (UTC)[reply]
  5. Legoktm (talk) 21:16, 3 March 2014 (UTC)[reply]
  6. Husky (talk) 11:01, 4 March 2014 (UTC)[reply]
  7. AdamBMorgan (talk) 14:42, 10 March 2014 (UTC)[reply]
  8. Ireas (talk) 01:41, 17 March 2014 (UTC)[reply]
  9. MichaelMaggs (talk) 10:30, 21 March 2014 (UTC)[reply]
  10. --Sannita (talk) 16:56, 26 March 2014 (UTC)[reply]
  11. --Jayantanth (talk) 18:34, 28 March 2014 (UTC)[reply]
  12. --se4598 (talk) 17:20, 29 March 2014 (UTC)[reply]
  13. --Mglaser (talk) 11:31, 30 March 2014 (UTC)[reply]
  14. OwenBlacker (talk) 15:12, 6 April 2014 (UTC)[reply]
  15. Micru (talk) 19:55, 14 April 2014 (UTC)[reply]
  16. Romaine (talk) 15:57, 14 May 2014 (UTC)[reply]
  17. Add your username here.