User:Xenwolf/Lua: Difference between revisions

Xenwolf (talk | contribs)
rem newline
Xenwolf (talk | contribs)
Now we have real cat in the wiki!
Line 3: Line 3:
MediaWiki supports Modules written in Lua (by the extension Scribunto, bundled with 1.34+) which can simplify writing templates a lot. Especially in cases where a lot of calculations must be done efficiently or when loops are inevitable, Lua is the better choice (if not the only one).
MediaWiki supports Modules written in Lua (by the extension Scribunto, bundled with 1.34+) which can simplify writing templates a lot. Especially in cases where a lot of calculations must be done efficiently or when loops are inevitable, Lua is the better choice (if not the only one).


Currently (Dec. 2020) Lua is evaluated on dev.xen.wiki, see [[:dev:Category:Lua modules]] for examples.
Lua modules are currently (Dec. 2020) evaluated on dev.xen.wiki:
 
* Can this feature help us building tables info boxes etc?
* Is it easy to use and easy to maintain?
* Is it safe?
 
... see [[:dev:Category:Lua modules]] and [[:dev:User:Xenwolf/SandBox]] for examples


== Notes ==
== Notes ==
=== Performance ===
The performance is really great, compared to templates.
As far as I know, modules are actually the measure taken by Wikipedia/MediaWiki to deal with the load caused by templates:
[[File:Server-kitty.jpg|400px]]
=== Limiting the impact ===
in [[mw: Extension:Scribunto#Configuration]] there are some parameters to limit the impact/load of Lua scripts may have
in [[mw: Extension:Scribunto#Configuration]] there are some parameters to limit the impact/load of Lua scripts may have