The Functional Wiki

Navigation

Project plan


Project background

Wikis allow people over the Internet to collaborate on documents using a markup language called "wikitext". Although there are many different kinds of wikitexts, they are commonly not designed to be programmer-friendly. For example, the wikitext used by MediaWiki, which is the wiki engine used by Wikipedia and many other wikis, contains many ambiguities and there isn't a complete specification of the language yet1. Also, there is no concept of data types in wiki texts, which make complicated wiki markups hard to debug.

Our project, "the functional wiki", aims to create a new wiki language which solves the above shortcomings, allowing both non-programmers and programmers to write easy-to-read wikiprograms which can perform powerful computations. The word "functional" in our project title comes from the fact that our wiki language will be a pure functional language, i.e. variables mutations do not exist in our language. The purpose of omitting mutations out of our language, contradicting to most other programming languages, is to ease people's understanding and implementation as direct substitution from variable to value is possible only without mutation.

Project objective

The objective of our project is to design a wikiprogramming language which has the following features:

Also, a basic implementation which can be run in web browsers for people to try out this new language will be developed.

Project methodology

Currently, we plan to split the whole project into following parts:

  1. a language specification, which both serves as the user guide and forms the basis of our
  2. interpreter, which runs our language, with the result fed into
  3. page generator, which takes the result of our program and generates HTML for the web server, and also
  4. a standard library, which contains commonly-used functions like arithmetic and conditionals.

These parts form different phases of the developing process. The whole process will follow the principles of iterative and incremental development.

Language specification

The language specification shall be a formal document which forms the basis of our interpreter. The interpreter will be tested against this language specification for correctness. It shall also contain the specification for the standard library which will later be relied on by all implementations.

Interpreter

The interpreter serves as a reference implementation of the language. It does not generate HTML directly. Instead, it feeds the output of the wikiprogram to a generator, which produces an output in a particular format, for example, HTML.

The interpreter should be able to run both on servers and inside web browsers. When editing pages in a web browser, a copy of the interpreter running inside the web browser will give real-time feedback to users. However, when serving the page, server-side interpreter will be used to improve performance.

Page generator

The page generator serves as a front-end of our language as the language runs in a fully-protected environment with no I/O operations. An HTML generator which generates HTML and a plain text generator which produces the result as plain text will be written. We will consider writing other kinds of generators if time permitted.

The HTML generator should be able to run both on servers and inside web browsers. When run in the web browser, the HTML generator directly changes the DOM of the web page to give real-time feedback of users' modification. On server side, it generates the DOM and serialises it in form of HTML document and serves it to the client.

Standard library

The standard library will include commonly-used functions which cannot be written or modified otherwise, including but not limited to arithmetic, conditionals, and functions that interact with the environment which could be date/time, page title, etc.

Project schedule and milestones

By this time, users should be able to see the result of program execution locally when a wikiprogram is typed into a browser.

--- lunar new year break ---

By this time, users should be able to save a wikiprogram to a server and view it later on a web browser without scripting.

------------------------------------------------------------------------------------------

1 MediaWiki Markup spec, https://www.mediawiki.org/wiki/Markup_spec