Moin,
On Wednesday 05 April 2006 22:57, Magnus Manske wrote:
Tim Starling wrote:
In response to a campaign by users of the English Wikipedia to harrass developers by introducing increasingly ugly and inefficient meta-templates to popular pages, I've caved in and written a few reasonably efficient parser functions. There are two conditional functions and a mathematical expression function. The expression function should support uses such as time and date deltas, as well as floating point applications such as unit conversion. The conditional functions should replace most uses of {{qif}}, and improve the efficiency of similar templates.
Of course, the moment I get my XML converter working reasonably well, you have to go ahead and extend the syntax! ;-)
OTOH, why not think this through till the bitter end? Let's implement a whole programming language! What about WikiScript? Or a Perl implementation: Wiki + Perl = Wirl! It would be slow, but you could use wiki markup & HTML for the comments.
Sorry.
A wiki can already viewed as a collection of large programs:
* artikle = program with input (the wiki text) and output (the HTML) * executed by running it in the browser, output is cached as to not "run" the program if the output wouldn't change (clever!) * template = subroutine, takes input, outputs something different * params to subroutines (templates) * default params to subroutines (templates) * recursion (template includes itself, is that already possible?)
You can then view a wiki as a collection of programs (artikles) and subroutines (templates, some of them are used in multiple programs).
Now add conditional templates, and you got suddenly conditional subroutine execution.
I guess adding loops is not far away, and at that point it would be turing complete.
10 print "Hello World!" 20 goto 10
isn't that much different from:
Hello World! {{ {{{ARTICLENAME}}} }}
(No idea if that actually works, but one might imagine it)
:-)
Best wishes,
Tels