Lua scripting: Difference between revisions
Tag: Rollback |
|||
| (33 intermediate revisions by 18 users not shown) | |||
| Line 1: | Line 1: | ||
{{historical|'''You might be looking for [[Lua]] instead.'''}} |
|||
{{Wikimedia engineering project information |
{{Wikimedia engineering project information |
||
| name = Lua scripting |
| name = Lua scripting |
||
| description = Support for Lua as a scripting language for MediaWiki end-users |
| description = Support for Lua as a scripting language for MediaWiki end-users |
||
| start = 2011-08 |
| start = 2011-08 |
||
| end = |
| end = 2013-04 |
||
| group = Platform |
| group = [[Wikimedia Platform Engineering |Platform]] |
||
| lead = [[User:Tim Starling|Tim Starling]] |
| lead = [[User:Tim Starling|Tim Starling]] |
||
| team = |
| team = Brad Jorsch (anomie) |
||
| previous = |
| previous = |
||
| next = |
| next = |
||
| Line 12: | Line 13: | ||
| display = {{{display|}}} |
| display = {{{display|}}} |
||
}}<noinclude> |
}}<noinclude> |
||
[[File:Lua-Logo.svg|right|200px]] |
|||
[[Lua]] is supported as a scripting language in all Wikimedia Foundation sites (since March 2013), via the [[Extension:Scribunto|Scribunto]] extension. Lua modules are maintained in the Module: namespace; you can see [https://en.wikipedia.org/w/index.php?namespace=828&tagfilter=&title=Special%3ARecentChanges recent changes to Lua modules in English Wikipedia], for example. See also [[Lua/Tutorial|the tutorial]] and the [[Extension:Scribunto/Lua reference manual|reference manual]]. |
|||
We're working to support Lua as a scripting language for MediaWiki end users, including Wikipedia editors. You can try out the prototype now at http://scribunto.wmflabs.org/ , and we don't yet have a schedule for enabling it on any wikis other than mediawiki.org and test2.wikipedia.org. It will be early 2013 by the time of rollout to most WMF sites. |
|||
We plan to let Lua incubate on mediawiki.org while we test the performance characteristics with key templates, and work out a deployment plan for larger wikis that includes community involvement. The Scribunto extension has been deployed to test2.wikipedia.org and www.mediawiki.org, and several editors are porting existing templates such as Cite over to Lua (see [//test2.wikipedia.org/w/index.php?namespace=828&associated=1&title=Special%3ARecentChanges recent changes in the "Module:" namespace] and [[Lua scripting/Tutorial|the tutorial]]). |
|||
== Status == |
|||
* {{Wikimedia project status line|Lua scripting}} |
|||
== Rationale == |
== Rationale == |
||
Templates and [[Extension:ParserFunctions|ParserFunctions]] were introduced to allow end users of MediaWiki to replicate content easily and build tools using basic logic, effectively turning wikitext into a limited programming language. |
Templates and [[Extension:ParserFunctions|ParserFunctions]] were introduced to allow end users of MediaWiki to replicate content easily and build tools using basic logic, effectively turning wikitext into a limited programming language. |
||
| Line 30: | Line 26: | ||
See also [[Scripting]], [[Extension:Scribunto]]. |
See also [[Scripting]], [[Extension:Scribunto]]. |
||
The example of Lua's use in World of Warcraft is promising; even novices |
The example of Lua's use in World of Warcraft (WoW) is promising; even novices without any programming experience were able to make large changes to their graphical experiences by quickly learning some Lua. |
||
: <marktraceur> hashar, sumanah, also Minetest (http://minetest.net) has recently implemented a similar system, though it mods the server more than the client, from what I've seen it's driving people to learn Lua so they can add in their ideas, something not possible with C++ |
|||
: <hashar> sumanah: the secret of WoW is that they managed to expose an API which is very easy to understand |
|||
: <YuviPanda> hashar: heard of Celestia? It's a planaterium software of sorts. Uses Lua for scripting. When I was in 9th grade, me and (also!) everyone around were able to learn and use it without much of a problem at all. |
|||
== Roadmap == |
|||
There is no timetable, at present, for deployment of Scribunto to specific wikis. From the Platform Engineering part of the [[Roadmap]] and the site performance part of [[Wikimedia_Engineering/2012-13_Goals#Milestones_by_quarter_7|the yearly goals]], here are upcoming milestones: |
|||
=== Milestones by quarter === |
|||
== Open tasks == |
|||
{| class="wikitable" |
|||
| '''July-September 2012''' || |
|||
* Experimental, limited deployment of Lua to the production cluster. |
|||
|- |
|||
| '''October-December 2012''' || |
|||
* Ramping up Lua to play gradually larger role on site, supporting common templates with poor performance characteristics |
|||
* Page rendering performance tools to help assess impact of Lua |
|||
|- |
|||
| '''January-March 2013''' || |
|||
* Full deployment of Lua to the production cluster (contingent upon October assessment) |
|||
|} |
|||
;Product tasks |
|||
* Where are the lists of templates that need to be converted? Help wikis gather those lists, and link to them on this page. For instance, [http://en.wikipedia.org/wiki/Wikipedia:Lua_requests English Wikipedia lists its Lua requests here.] (Once parsercountfunction.py [[phab:T66878|is available again in Pywikibot 3.0]] you could also help create those lists to find wikitext templates that currently parse slowly and thus would be worth converting to Lua.) |
|||
* Improve the "getting started" [[Extension:Scribunto/Lua_reference_manual#Getting_started|part]] of the Lua reference manual in response to novice developers' requests. |
|||
* Spread the word about available reference material (such as that linked to in [https://blog.wikimedia.org/2013/03/11/lua-templates-faster-more-flexible-pages/ the blog post]). |
|||
== Documents == |
== Documents == |
||
| Line 61: | Line 41: | ||
* User requirements: [[Lua scripting/Requirements|notes]] |
* User requirements: [[Lua scripting/Requirements|notes]] |
||
* [[{{FULLPAGENAME}}/status|Status updates]] |
* [[{{FULLPAGENAME}}/status|Status updates]] |
||
* [[Lua |
* [[Lua/Tutorial|Tutorial on using Lua for MediaWiki templates]] |
||
* Planning documents: |
* Planning documents: |
||
** [[/Meeting_2012-01-25]] |
** [[/Meeting_2012-01-25]] |
||
| Line 68: | Line 48: | ||
* Software design document: [[User:Sumanah/Lua_vs_Javascript|Explanation of why Tim's preferred language is Lua]] |
* Software design document: [[User:Sumanah/Lua_vs_Javascript|Explanation of why Tim's preferred language is Lua]] |
||
* [[/Benchmarking]] |
* [[/Benchmarking]] |
||
* Release management plan: [[Lua scripting/Release management]] |
|||
== |
== Lua modules on this wiki == |
||
* '''<span class="plainlinks">[{{fullurl:Special:AllPages|namespace=828}} List of all modules on this wiki]</span>''' |
* '''<span class="plainlinks">[{{fullurl:Special:AllPages|namespace=828}} List of all modules on this wiki]</span>''' |
||
== Communications == |
== Communications == |
||
<!-- List here the public communications (by the team or the media) about this project --> |
<!-- List here the public communications (by the team or the media) about this project --> |
||
* [[mailarchive:wikitech-l/2012-January/057774.html|Agreement on Lua]] (and [[mailarchive:wikitech-l/2012-February/057860.html|later replies]]) |
|||
* [http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/58479 Agreement on Lua] |
|||
* [https://meta.wikimedia.org/wiki/File:Monthly_Metrics_Meeting_May_3,_2012.ogv Patrick Reilly spoke about the Lua scripting work in a presentation on 3 May 2012 (scroll to about 22:00 or 27:00 to see it)] |
* [https://meta.wikimedia.org/wiki/File:Monthly_Metrics_Meeting_May_3,_2012.ogv Patrick Reilly spoke about the Lua scripting work in a presentation on 3 May 2012 (scroll to about 22:00 or 27:00 to see it)] |
||
* [https://commons.wikimedia.org/wiki/File:Berlin_Hackathon_2012_-_Lua_introduction_%28Tim_Starling%29.ogv Tutorial session, Berlin, June 2012] |
* [https://commons.wikimedia.org/wiki/File:Berlin_Hackathon_2012_-_Lua_introduction_%28Tim_Starling%29.ogv Tutorial session, Berlin, June 2012] |
||
| Line 83: | Line 62: | ||
[[Category:WMF Projects 2012q1]] |
[[Category:WMF Projects 2012q1]] |
||
[[Category:Wikitext]] |
[[Category:Wikitext]] |
||
[[Category:Lua]] |
|||
</noinclude> |
</noinclude> |
||
Latest revision as of 19:16, 14 September 2020
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. You might be looking for Lua instead. |
|
Lua scripting
Support for Lua as a scripting language for MediaWiki end-users
|

Lua is supported as a scripting language in all Wikimedia Foundation sites (since March 2013), via the Scribunto extension. Lua modules are maintained in the Module: namespace; you can see recent changes to Lua modules in English Wikipedia, for example. See also the tutorial and the reference manual.
Rationale
[edit | edit source]Templates and ParserFunctions were introduced to allow end users of MediaWiki to replicate content easily and build tools using basic logic, effectively turning wikitext into a limited programming language.
However, complex templates have caused performance issues and bottlenecks.
This project aims to make it possible for MediaWiki end-users to use a proper scripting language that will be more powerful and efficient than ad-hoc ParserFunctions-based logic.
See also Scripting, Extension:Scribunto.
The example of Lua's use in World of Warcraft (WoW) is promising; even novices without any programming experience were able to make large changes to their graphical experiences by quickly learning some Lua.
Open tasks
[edit | edit source]- Product tasks
- Where are the lists of templates that need to be converted? Help wikis gather those lists, and link to them on this page. For instance, English Wikipedia lists its Lua requests here. (Once parsercountfunction.py is available again in Pywikibot 3.0 you could also help create those lists to find wikitext templates that currently parse slowly and thus would be worth converting to Lua.)
- Improve the "getting started" part of the Lua reference manual in response to novice developers' requests.
- Spread the word about available reference material (such as that linked to in the blog post).
Documents
[edit | edit source]- Extension:Scribunto - MediaWiki extension page for this tool
- Extension:Scribunto/Lua reference manual - Documentation for Lua as available in MediaWiki.
- User requirements: notes
- Status updates
- Tutorial on using Lua for MediaWiki templates
- Planning documents:
- Software design document: Explanation of why Tim's preferred language is Lua
- /Benchmarking