Extension:WikiLambda
WikiLambda Release status: experimental |
|
---|---|
Implementation | Parser function , ContentHandler |
Description | Providing Wikimedia wikis with a wikitext parser function to call evaluation of functions written, managed, and evaluated on a central wiki. |
Author(s) | Wikimedia Foundation |
Compatibility policy | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | >= 1.42 |
Database changes | Yes |
License | MIT License |
Download | |
|
|
|
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Translate the WikiLambda extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
The WikiLambda extension provides for a wiki to host functions written, managed, and evaluated by users, which is used to power wikifunctions.org. It forms the core of the "Wikifunctions" software stack, as part of the work towards Abstract Wikipedia. The system is currently in active development, with the front-end written in Vue.js and using the new Codex interface library. Wikifunctions via WikiLambda will later provide Wikimedia wikis with a wikitext parser function to make evaluations from Wikifunctions on their local wiki.
Introduction
Wikifunctions is a MediaWiki installation on which function content, but not output, is stored. This content takes the form of programmatic descriptions of each available function ("Functions"), actual user-written code for these functions ("Implementations"), test suites for these functions ("Testers"), and human-facing documentation about these functions, alongside the usual wiki community management content like village pumps, discussion areas, and policy pages.
Requests for function calls can come in directly via a Web request, or via MediaWiki (probably through a parser function like {{#wikifunction:…}}
, but this is not yet decided). The function orchestrator determines the specifics of the request, checks the cache to see if the output value has been recently provided, and either returns that or proceeds to trigger an evaluation. To do that, it fetches all relevant content from the cluster, be that published function content (or mid-edit as-yet-unpublished function content being "previewed") from Wikifunctions, or structured content on which functions can operate from Wikidata and Wikimedia Commons. The complete bundle of code to execute and inputs on which to execute are then passed to the appropriate function executor, which then securely tries to execute the input and returns the output (or a failure error). The orchestrator then writes the successful result to the cache and transmits it to the consumer.
The WikiLambda extension is responsible for content management of the content on the Wikifunctions wiki (like the Wikibase Repository extension), providing editing interfaces, restricting users from or warning about certain actions, and providing a reading and test execution interface, and the integration of content requests on all Wikimedia wikis (like the Wikibase Client extension). User-written code is never executed in the context of the production environment, and thus never has access to sensitive content, but is only run in isolated, disposable instances.
Getting started
Install
- <translate> [[<tvar name=2>Special:ExtensionDistributor/WikiLambda</tvar>|Download]] and move the extracted <tvar name=name>
WikiLambda
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone --recurse-submodules https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiLambda - <translate> Only when installing from Git, run <tvar name=composer>Composer</tvar> to install PHP dependencies, by issuing <tvar name=code>
composer install --no-dev
</tvar> in the extension directory.</translate> <translate> (See <tvar name=phab><translate> task <tvar name=1>T173141</tvar></translate></tvar> for potential complications.)</translate> - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'WikiLambda' );
- <translate> Run the [[<tvar name=update>Special:MyLanguage/Manual:Update.php</tvar>|update script]] which will automatically create the necessary database tables that this extension needs.</translate>
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
Installing the back-end services
If you wish you install the back-end services to use the WikiLambda software, you must do so and configure them. Instructions are subject to change, and so only provided within the repo.
Testing locally
(TODO)
Code stewardship
- <translate> Maintained by <tvar name=1>Abstract Wikipedia team</tvar>.</translate>
- <translate> Live chat ([[<tvar name=1>Special:MyLanguage/MediaWiki on IRC</tvar>|IRC]]): <tvar name=2><span class="plainlinks" style="font-family: monospace,Courier; white-space: pre-wrap !important; word-wrap: break-word; max-width: 1200px; overflow: auto;" title="<translate nowrap> <tvar name=1>#wikipedia-abstract-tech</tvar> on Libera.Chat IRC</translate>">#wikipedia-abstract-tech <translate> connect</translate></tvar></translate>
- <translate> Issue tracker: [<tvar name=url>https://phabricator.wikimedia.org/tag/wikilambda/</tvar> Phabricator <tvar name=phab>wikilambda</tvar>] ([<tvar name=url2>https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=wikilambda</tvar> Report an issue])</translate>
See also
- MediaWiki-Docker/Extension/WikiLambda
- Code documentation:
- For PHP
- For JS
- Code coverage (PHP)
- function-evaluator service
- function-orchestrator service
- functon-schemata shared library
- Abstract Wikipedia Architecture
- Abstract Wikipedia developer cheatsheet
Subpages
- API
- Approving Implementations and Testers
- Approving Implementations and Testers/de
- Approving Implementations and Testers/en
- Approving Implementations and Testers/ru
- Approving Implementations and Testers/uk
- CLI
- Core objects
- Creating Objects
- Development environment
- Discovery needs
- Frontend Architecture
- Granular Edit Authorization
- Jupyter kernel proposal
- Metrics
- Metrics Implementation
- User stories
- de
- en
- examples/multiply.json
- uk
- wikilambda zlanguages table
- wikilambda zobject function join table
- wikilambda zobject label conflicts table
- wikilambda zobject labels table
- wikilambda ztester results table
File:Wikimedia-logo black.svg | <translate> This {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is being used on one or more [[<tvar name=2>m:Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]].</translate> <translate> This probably means that the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is stable and works well enough to be used by such high-traffic websites.</translate> <translate> Look for this {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension's|skin's}} name in Wikimedia's <tvar name=2>CommonSettings.php</tvar> and <tvar name=3>InitialiseSettings.php</tvar> configuration files to see where it's installed.</translate> <translate> A full list of the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extensions|skins}} installed on a particular wiki can be seen on the wiki's <tvar name=ver>Special:Version</tvar> page.</translate> |
- Pages with script errors
- Pages with broken file links
- Experimental extensions
- Extensions without an image
- Parser function extensions
- ContentHandler extensions
- Extensions with release branches compatibility policy
- MIT licensed extensions
- Extensions in Wikimedia version control
- GetUserPermissionsErrors extensions
- MultiContentSave extensions
- NamespaceIsMovable extensions
- ParserFirstCallInit extensions
- HtmlPageLinkRendererEnd extensions
- All extensions
- Extensions used on Wikimedia