Jump to content

Philosophical Research:MediaWiki and functional programming

From Philosophical Research
Revision as of 11:38, 19 August 2025 by Reversedragon (talk | contribs) (Templates and lambda calculus)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

One very important concept you need to know for editing this wiki is MediaWiki templates. While a Template may seem like a mere way to simplify wiki markup, it is actually much more. Once you actually know how to use Templates, you will realize that what Templates actually do is turn spoken language into functional programming. This has a lot of further implications, both in the sense of how immensely useful Templates can be and potential caveats of using them.

Templates and Ontology entries

Each Item or Term entry on this wiki (these are pages within the Ontology: and Term: namespaces) contains a resident Template, generally always parked at the top of the page. These Templates are used to reference that Item or Term in data tables or numbered lists on other pages. This means that whenever the main outward-facing label of an Item changes, it will automatically be updated on every single other page that uses it, and if the Template contains multiple languages, it may be able to automatically display the title in another language based on the language set on the page which is calling it. (This localization feature is not well tested or implemented currently.)

Currently, the top Template inside each Item page is more or less unique to each page. The goal is for this to eventually not be the case, and for all pages to use one particular Template to define their top Template. Currently, the structure of resident Templates is slowly evolving each time a new page is created through various pages copying the best versions of each sub-section of the Template from each other. The WaveScore Template is the first real "success story" on this, as it is one of the few parts of the top Template that has stabilized early on and then hardly changed. The second partial success story is the Item icons — while not every single ideology which has been given a swatch color and two to three letter code has an icon template, the useful MediaWiki feature of subpages quickly made the syntax for specifying swatch colors and icon markup solid. A few pages contain a demo of a single unified Item-Template Template, but this is not being widely used yet in case it ends up with bugs. Very early on, there was an attempt to design a unified Item template before creating enough pages, and for certain reasons this ended up with a lot of buggy pages where on every single page the Template had to be replaced with manual markup to start the process of making the Template over again, so this time around the process is now going more gradually with a careful use of alternate options and backwards compatibility. As much as this may make Template pages a little harder to read and interpret, it is strictly necessary for splitting up work into tiny increments to prevent having to change thousands and thousands of pages all on one day.

Simplicity is one way to consistency

If you are in doubt about what parameter names a Template should use, never overlook the power of numbered arguments. If the parameters of a particular Template are always being textually entered in a certain order with no deviation from that order, and all the markup around them is only fluff toward that basic structure, turn that part of the page into a simple bar-separated array. When there is any doubt about what order things should go in, you can bring back parameter names on the optional or .

Templates and lambda calculus

There is a field of mathematics called lambda calculus — in practical terms this name approximately means "function mathematics". This field of mathematics is basically the practice of constructing everything in mathematics from functions, including booleans and integer numbers. With the correct mildly-frightening tree-branch figure of functions, any function ever invented in other fields of mathematics can be reconstructed out of functions and calculated using the function tree and a few simple rules.

This is about what Templates have done to communication. A Template can contain almost anything. It is simply a name and a slot, like a lambda function, but whatever goes into the slot will come out in a particular presentation or go through other Templates inside, or branching paths of which things to show and hide. This makes Templates very powerful. A Template can practically turn into a small math problem full of simple propositions and beta reductions that interpret them. In practice it may be important to optimize computations by making sure Templates do not go too many levels deep, but at the same time, the number of computations that can safely go on in each Template is surprising. If you want Templates to remove the confusion of putting links and Templates together, with a little effort you can do it, and give a Template a href parameter in imitation of HTML links. If you feel like new users will be slightly overwhelmed by the HTML cite tag, you can create a Template that makes it a little easier, and also has the ability to throw in the Item link associated with a book. Templates can redesign the whole paradigm of HTML the way it "really should have been". They can potentially make code more legible to screen readers. They can take the nonsense out of things, although only if the person writing them first has sense.


(unfinished)