Function
Functions are abstract mathematical representation of relations between the domain and codomain. It can be represented as a key-value pairs, or in the lambda calculus[1] form.
Function can be used as a generic building block to represent information in general. It can be thought of as a primitive kind of data structure. This argument can be substantiated by thinking of Lambda calculus as a generalized way of encoding functions in an explicit structured data format.
A Critical Observation
In most cases, people think of MediaWiki as a generic note taking or a dictionary of relevant pieces of static information. However, knowing the capabilities of modern browsers, HTML 5, JavaScript, and the server side PHP + Lua (Scribuntu) extension of MediaWiki, not to mention Semantic MediaWiki and its MySQL/MariaDB data storage/retrieval capabilities, the overall functions of MediaWiki must not be just seen as a passive data browsing tool, but a full blown programming and data creating environment. In programmer's term, MediaWiki can be configured to be a full blown Integrated Development Environment, for any subject matter. This is what PKC strives to become, it tries to raise users' awareness of data elements as functions, so that all data are also functions in a hyperlinked context. In other words, hyplerink is a kind of data-oriented function, that allows users to incrementally construct small and large functions at many locations and across many time scales. On the Internet, everyone is constructing some piece of a bigger function that they may never be directly conscientiously aware, but never-the-less, all users, all computers are incrementally constructing functions of many kinds through accumulating data elements, all in the hyperlinked fashion as articulated by Ted Nelson.
Scale-Free, Time-like Structures, and Ordered Namespace of Functions
Function as a data structure is not only universal, but it can also be designed to be Scale-free, meanningly that the formal properties of a specific Function, don't have to be bounded to a specific spacetime physical scale. However, in the space of all functions, the containment relationship in terms of what functions are classified into what sub-class(es) of functions can be studied in terms of Category Theory, and more specifically, in the field of Lattice Theory or just think of them in terms of Partially ordered sets. Thinking of named functions in terms of lattice or Partially ordered set, a.k.a. Posets, is an important mental model for both software engineering, and in everyday life. Thinking of functions as elements in Posets will give them a consistent abstraction in an ordered or time-like structure, so that it will build a generically applicable mental model for causal relations and in terms of an ordered namespace.
Function as Causal Relation
Function can be represented as a key-value pair of inputs and outputs, which defines a way to represent causal relations.
Design Principle
PKC is designed with this idea in mind, that function is a kind of data, and can be recursively referenced to perform both computation and carry computational results. By thinking about this design principle at all times, all pages in PKC will be constructed and decomposed based on a functional style, a style that has a name, as the head of a function, and many key-value-pairs as its arguments. Thinking about functions at all times in this primitive, yet generic construct, allows users to think of all functions as hyperlinks or fiber bundles that relates objects from one to the other, revealing the topological structures, or the systematic structures of anything. Most importantly, users of PKC can think of writing down notes in various pages are effectively construction functions or conducting computational work in parallel and in an explicit functionally designed data storage.
Implementation
PKC is based on MediaWiki, which in term installs Scribunto to enable Lua programming. Lua defines functions as below:
f = function (op, a, b)
if op == 'add' then
return a + b
else if op == 'sub' then
return a - b
end
error("invalid operation")
end
References
- ↑ Abelson, Harold; Sussman, Gerald; Sussman, Julie (1985). Structure and Interpretation of Computer Programs (2nd ed.). local page: MIT Press. ISBN 0-262-51087-1.