Extension:WikiLambda - MediaWiki
Jump to content
From mediawiki.org
Translate this page
Languages:
polski
português
українська
MediaWiki extensions manual
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.
Database changes
Yes
Parameters
$wgWikiLambdaClientTargetAPI
$wgWikiLambdaEnableRepoMode
$wgWikiLambdaClientWikis
$wgWikiLambdaAbstractNamespaces
$wgWikiLambdaOrchestratorLocation
$wgWikiLambdaClientModeOffline
$wgWikiLambdaClientDefaultShowChanges
$wgWikiLambdaObjectCache
$wgWikiLambdaPersistBackendCache
$wgWikiLambdaEnableAbstractMode
$wgWikiLambdaEnableClientMode
Added rights
wikilambda-abstract-create
wikilambda-abstract-edit
wikilambda-bypass-cache
wikilambda-connect-implementation
wikilambda-connect-tester
wikilambda-create
wikilambda-create-arbitrary-zid
wikilambda-create-boolean
wikilambda-create-converter
wikilambda-create-enum-value
wikilambda-create-function
wikilambda-create-function-call
wikilambda-create-generic-enum
wikilambda-create-implementation
wikilambda-create-language
wikilambda-create-predefined
wikilambda-create-programming
wikilambda-create-tester
wikilambda-create-type
wikilambda-create-unit
wikilambda-disconnect-implementation
wikilambda-disconnect-tester
wikilambda-edit
wikilambda-edit-argument-label
wikilambda-edit-attached-implementation
wikilambda-edit-attached-tester
wikilambda-edit-boolean
wikilambda-edit-function-attached-implementation
wikilambda-edit-function-attached-tester
wikilambda-edit-builtin-function
wikilambda-edit-connected-converter
wikilambda-edit-converter
wikilambda-edit-enum-value
wikilambda-edit-error-key-label
wikilambda-edit-function-call
wikilambda-edit-generic-enum-type
wikilambda-edit-generic-enum-item
wikilambda-edit-generic-enum-id
wikilambda-edit-implementation
wikilambda-edit-key-label
wikilambda-edit-language
wikilambda-edit-object-alias
wikilambda-edit-object-description
wikilambda-edit-object-label
wikilambda-edit-object-type
wikilambda-edit-predefined
wikilambda-edit-programming
wikilambda-edit-running-function
wikilambda-edit-running-function-definition
wikilambda-edit-tester
wikilambda-edit-type
wikilambda-edit-unit
wikilambda-edit-user-function
wikilambda-execute
wikilambda-execute-unsaved-code
wikifunctions-run
Hooks used
getUserPermissionsErrors
MultiContentSave
NamespaceIsMovable
ParserFirstCallInit
HtmlPageLinkRendererEnd
Licence
MIT License
Download extension
Git
Browse repository
GitHub
Gerrit code review
Git commit log
Download source tarball
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 provides Wikimedia wikis with a wikitext parser function to make evaluations from Wikifunctions on their local wiki.
Introduction
The current working top-level architectural model for how Wikifunctions will work
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 (through a parser function
{{#function:…}}
).
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
and move the extracted
WikiLambda
folder to your
extensions/
directory.
Developers and code contributors should install the extension
from Git
instead, using:
cd
extensions/
git
clone
--recurse-submodules
Only when installing from Git, run
Composer
to install PHP dependencies, by issuing
composer install --no-dev
in the extension directory.
(See
T173141
for potential complications.)
Add the following code at the bottom of your
LocalSettings.php
file:
wfLoadExtension
'WikiLambda'
);
Run the
update script
which will automatically create the necessary database tables that this extension needs.
Done
– Navigate to
Special:Version
on your wiki to verify that the extension is successfully installed.
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
Maintained by
Abstract Wikipedia team
Live chat (
IRC
):
#wikipedia-abstract-tech
connect
Issue tracker:
Phabricator wikilambda
Report an issue
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
Coding Conventions
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
fr
ja
pl
pt
uk
wikilambda zlanguages table
wikilambda zobject function join table
wikilambda zobject join table
wikilambda zobject label conflicts table
wikilambda zobject labels table
wikilambda ztester results table
This extension is being used on one or more
Wikimedia projects
. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's
CommonSettings.php
and
InitialiseSettings.php
configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's
Special:Version
page.
Retrieved from "
Categories
Experimental extensions
Parser function extensions
ContentHandler extensions
GetUserPermissionsErrors extensions
MultiContentSave extensions
NamespaceIsMovable extensions
ParserFirstCallInit extensions
HtmlPageLinkRendererEnd extensions
MIT licensed extensions
Extensions in Wikimedia version control
All extensions
Extensions requiring Composer with git
Extensions used on Wikimedia
Hidden categories:
Extensions without an image
Extensions with release branches compatibility policy
Extension
WikiLambda
Add topic