summaryrefslogtreecommitdiff
path: root/doc/todo
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2009-04-20 12:21:18 +0200
committerintrigeri <intrigeri@boum.org>2009-04-20 12:21:18 +0200
commit4558457402a4ab6bc795589a2e400fa66144f76e (patch)
tree8368320617a8febc3c9c9708f688b6591801f4c0 /doc/todo
parent9db2438b3a0366738ba2e1b6e23ad3d8ae2fe36e (diff)
parent2cc3f5d057c5882e08d16746985c49a7dd1a4c01 (diff)
Merge commit 'upstream/master' into pub/po
Conflicts: debian/changelog debian/control
Diffstat (limited to 'doc/todo')
-rw-r--r--doc/todo/darcs.mdwn534
-rw-r--r--doc/todo/hidden_links__47__tags.mdwn13
-rw-r--r--doc/todo/inline_postform_autotitles.mdwn (renamed from doc/todo/inline_autotitles.mdwn)5
-rw-r--r--doc/todo/need_global_renamepage_hook.mdwn2
-rw-r--r--doc/todo/rewrite_ikiwiki_in_haskell.mdwn68
-rw-r--r--doc/todo/rewrite_ikiwiki_in_haskell/discussion.mdwn14
6 files changed, 118 insertions, 518 deletions
diff --git a/doc/todo/darcs.mdwn b/doc/todo/darcs.mdwn
index 882a41379..985ae5f8b 100644
--- a/doc/todo/darcs.mdwn
+++ b/doc/todo/darcs.mdwn
@@ -1,529 +1,21 @@
-Here's Thomas Schwinge unfinished darcs support for ikiwiki.
-
-(Finishing this has been suggested as a [[soc]] project.)
-
-> I haven't been working on this for months and also won't in the near
-> future. Feel free to use what I have done so
-> far and bring it into an usable state! Also, feel free to contact me
-> if there are questions.
-
--- [Thomas Schwinge](mailto:tschwinge@gnu.org)
-
-[[!toggle text="show"]]
-[[!toggleable text="""
- # Support for the darcs rcs, <URL:http://darcs.net/>.
- # Copyright (C) 2006 Thomas Schwinge <tschwinge@gnu.org>
- #
- # This program is free software; you can redistribute it and/or modify it
- # under the terms of the GNU General Public License as published by the
- # Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
- #
- # This program is distributed in the hope that it will be useful, but
- # WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- # General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License along
- # with this program; if not, write to the Free Software Foundation, Inc.,
- # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
- # We're guaranteed to be the only instance of ikiwiki running at a given
- # time. It is essential that only ikiwiki is working on a particular
- # repository. That means one instance of ikiwiki and it also means that
- # you must not `darcs push' into this repository, as this might create
- # race conditions, as I understand it.
-
-
- use warnings;
- use strict;
- use IkiWiki;
-
- package IkiWiki;
-
-
- # Which darcs executable to use.
- my $darcs = ($ENV{DARCS} or 'darcs');
-
-
- # Internal functions.
-
- sub darcs_info ($$$) {
- my $field = shift;
- my $repodir = shift;
- my $file = shift; # Relative to the repodir.
-
- my $child = open(DARCS_CHANGES, "-|");
- if (! $child) {
- exec($darcs, 'changes', '--repo=' . $repodir, '--xml-output', $file) or
- error('failed to run `darcs changes\'');
- }
-
- # Brute force for now. :-/
- while (<DARCS_CHANGES>) {
- last if /^<\/created_as>$/;
- }
- ($_) = <DARCS_CHANGES> =~ /$field=\'([^\']+)/;
- $field eq 'hash' and s/\.gz//; # Strip away the `.gz' from `hash'es.
-
- close(DARCS_CHANGES) or error('`darcs changes\' exited ' . $?);
-
- return $_;
- }
-
-
- # Exported functions.
-
- sub rcs_update () {
- # Not needed.
- }
-
- sub rcs_prepedit ($) {
- # Prepares to edit a file under revision control. Returns a token that
- # must be passed to rcs_commit() when the file is to be commited. For us,
- # this token the hash value of the latest patch that modifies the file,
- # i.e. something like its current revision. If the file is not yet added
- # to the repository, we return TODO: the empty string.
-
- my $file = shift; # Relative to the repodir.
-
- my $hash = darcs_info('hash', $config{srcdir}, $file);
- return defined $hash ? $hash : "";
- }
-
- sub rcs_commit ($$$) {
- # Commit the page. Returns `undef' on success and a version of the page
- # with conflict markers on failure.
-
- my $file = shift; # Relative to the repodir.
- my $message = shift;
- my $rcstoken = shift;
-
- # Compute if the ``revision'' of $file changed.
- my $changed = darcs_info('hash', $config{srcdir}, $file) ne $rcstoken;
-
- # Yes, the following is a bit convoluted.
- if ($changed) {
- # TODO. Invent a better, non-conflicting name.
- rename("$config{srcdir}/$file", "$config{srcdir}/$file.save") or
- error("failed to rename $file to $file.save: $!");
-
- # Roll the repository back to $rcstoken.
-
- # TODO. Can we be sure that no changes are lost? I think that
- # we can, if we make sure that the `darcs push' below will always
- # succeed.
-
- # We need to revert everything as `darcs obliterate' might choke
- # otherwise.
- # TODO: `yes | ...' needed? Doesn't seem so.
- system($darcs, "revert", "--repodir=" . $config{srcdir}, "--all") and
- error("`darcs revert' failed");
- # Remove all patches starting at $rcstoken.
- # TODO. Something like `yes | darcs obliterate ...' seems to be needed.
- system($darcs, "obliterate", "--quiet", "--repodir" . $config{srcdir},
- "--match", "hash " . $rcstoken) and
- error("`darcs obliterate' failed");
- # Restore the $rcstoken one.
- system($darcs, "pull", "--quiet", "--repodir=" . $config{srcdir},
- "--match", "hash " . $rcstoken, "--all") and
- error("`darcs pull' failed");
-
- # We're back at $rcstoken. Re-install the modified file.
- rename("$config{srcdir}/$file.save", "$config{srcdir}/$file") or
- error("failed to rename $file.save to $file: $!");
- }
-
- # Record the changes.
- # TODO: What if $message is empty?
- writefile("$file.log", $config{srcdir}, $message);
- system($darcs, 'record', '--repodir=' . $config{srcdir}, '--all',
- '--logfile=' . "$config{srcdir}/$file.log",
- '--author=' . 'web commit <web-hurd@gnu.org>', $file) and
- error('`darcs record\' failed');
-
- # Update the repository by pulling from the default repository, which is
- # master repository.
- system($darcs, "pull", "--quiet", "--repodir=" . $config{srcdir},
- "--all") and error("`darcs pull' failed\n");
-
- # If this updating yields any conflicts, we'll record them now to resolve
- # them. If nothing is recorded, there are no conflicts.
- $rcstoken = darcs_info('hash', $config{srcdir}, $file);
- # TODO: Use only the first line here, i.e. only the patch name?
- writefile("$file.log", $config{srcdir}, 'resolve conflicts: ' . $message);
- system($darcs, 'record', '--repodir=' . $config{srcdir}, '--all',
- '--logfile=' . "$config{srcdir}/$file.log",
- '--author=' . 'web commit <web-hurd@gnu.org>', $file) and
- error('`darcs record\' failed');
- my $conflicts = darcs_info('hash', $config{srcdir}, $file) ne $rcstoken;
- unlink("$config{srcdir}/$file.log") or
- error("failed to remove `$file.log'");
-
- # Push the changes to the main repository.
- system($darcs, 'push', '--quiet', '--repodir=' . $config{srcdir}, '--all')
- and error('`darcs push\' failed');
- # TODO: darcs send?
-
- if ($conflicts) {
- my $document = readfile("$config{srcdir}/$file");
- # Try to leave everything in a consistent state.
- # TODO: `yes | ...' needed? Doesn't seem so.
- system($darcs, "revert", "--repodir=" . $config{srcdir}, "--all") and
- warn("`darcs revert' failed.\n");
- return $document;
- } else {
- return undef;
- }
- }
-
- sub rcs_add ($) {
- my $file = shift; # Relative to the repodir.
-
- # Intermediate directories will be added automagically.
- system($darcs, 'add', '--quiet', '--repodir=' . $config{srcdir},
- '--boring', $file) and error('`darcs add\' failed');
- }
-
- sub rcs_recentchanges ($) {
- warn('rcs_recentchanges() is not implemented');
- return 'rcs_recentchanges() is not implemented';
- }
-
- sub rcs_notify () {
- warn('rcs_notify() is not implemented');
- }
-
- sub rcs_getctime () {
- warn('rcs_getctime() is not implemented');
- }
-
- 1
-"""]]
-
-This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to much) but seems to work. It uses just one repo, like the mercurial plugin (unlike the above version, which AIUI uses two).
-
-`rcs_commit()` uses backticks instead of `system()`, to prevent darcs' output being sent to the browser and mucking with the HTTP headers (`darcs record` has no --quiet option). And `rcs_recentchanges()` uses regexes rather than parsing darcs' XML output.
-
-[[!toggle text="show" id="bma"]]
-[[!toggleable id="bma" text="""
-
- #!/usr/bin/perl
-
- use warnings;
- use strict;
- use IkiWiki;
- use Date::Parse;
- use open qw{:utf8 :std};
-
- package IkiWiki;
-
- sub rcs_update () {
- # Do nothing - there's nowhere to update *from*.
- }
-
- sub rcs_prepedit ($) {
- }
-
- sub rcs_commit ($$$;$$) {
- my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
-
- # $user should probably be a name and an email address, by darcs
- # convention.
- if (defined $user) {
- $user = possibly_foolish_untaint($user);
- }
- elsif (defined $ipaddr) {
- $user = "Anonymous from $ipaddr";
- }
- else {
- $user = "Anonymous";
- }
-
- $message = possibly_foolish_untaint($message);
-
- # BUG: this outputs one line of text, and there's not a -q or --quiet
- # option. Redirecting output to /dev/null works, but I still get the
- # HTTP status and location headers displayed in the browser - is that
- # darcs' fault or ikiwiki's?
- # Doing it in backticks *works*, but I'm sure it could be done better.
- my @cmdline = ("darcs", "record", "--repodir", "$config{srcdir}",
- "-a", "-m", "$message", "--author", "$user", $file);
- `darcs record --repodir "$config{srcdir}" -a -m "$message" --author "$user" $file`; # Return value? Output? Who needs 'em?
- #if (system(@cmdline) != 0) {
- # warn "'@cmdline' failed: $!";
- #}
-
- return undef; # success
-
- sub rcs_add ($) {
- my ($file) = @_;
-
- my @cmdline = ("darcs", "add", "--repodir", "$config{srcdir}", "-a", "-q", "$file");
- if (system(@cmdline) != 0) {
- warn "'@cmdline' failed: $!";
- }
- }
-
- sub rcs_recentchanges ($) {
- # TODO: This is horrible code. It doesn't work perfectly, and uses regexes
- # rather than parsing Darcs' XML output.
- my $num=shift;
- my @ret;
-
- return unless -d "$config{srcdir}/_darcs";
-
- my $changelog = `darcs changes --xml --summary --repodir "$config{srcdir}"`;
- $changelog = join("", split(/\s*\n\s*/, $changelog));
- my @changes = split(/<\/patch>.*?<patch/m, $changelog);
-
-
- foreach my $change (@changes) {
- $change =~ m/hash='(.*?)'/;
- my $rev = $1;
- $change =~ m/author='(.*?)'/;
- my $user = $1."\n";
- my $committype = "web";
- if($user =~ m/&lt;/) {
- # Author fields generated by darcs include an email address: look for the "<".
- $committype = "darcs";
- use HTML::Entities;
- $user = decode_entities $user;
- }
- $change =~ m/local_date='(.*?)'/;
- my $when = $1;
- $when=time - str2time($when, 'UTC');
- $change =~ m/<name>(.*?)<\/name>/g;
- my @message = {line => $1};
- foreach my $match ($change =~ m/<comment>(.*?)<\/comment>/gm) {
- push @message, {line => $1};
- }
-
- my @pages;
- foreach my $match ($change =~ m/<.*?_(file|directory)>(.*?)(<(added|removed)_lines.*\/>)*<\/.*?_(file|directory)>/g) {
- # My perl-fu is weak. I'm probably going about this all wrong, anyway.
- push @pages, {page => pagename($match)} if ( -f $config{srcdir}."/".$match || -d $config{srcdir}."/".$match) and not $match =~ m/^$/;
- }
- push @ret, { rev => $rev,
- user => $user,
- committype => $committype,
- when => $when,
- message => [@message],
- pages => [@pages],
- }
- }
- return @ret;
- }
-
- sub rcs_notify () {
- # TODO
- }
-
- sub rcs_getctime ($) {
- error gettext("getctime not implemented");
- }
-
- 1
-
-
-
-"""]]
-
----
-
-Well, here's my version too. It only does getctime -- using a real XML parser, instead of regexp ugliness -- and maybe recentchanges, but that may be bitrotted, or maybe I never finished it, as I only need the getctime. As for actual commits, I have previously voiced my opinion, that this should be done by the plugin generating a patch bundle, and forwarding it to darcs in some way (`darcs apply` or even email to another host, possibly moderated), instead of the hacky direct modification of a working copy. It could also be faster to getctime in a batch. Just reading in all the changes the first time they're needed, might not be a big improvement in many cases, but if we got a batch request from ikiwiki, we could keep reaing the changes until all the files in this batch request have been met. --[[tuomov]]
-
-[[!toggle text="show" id="tuomov"]]
-[[!toggleable id="tuomov" text="""
-<pre>
-#!/usr/bin/perl
-# Stubs for no revision control.
-
-use warnings;
-use strict;
-use IkiWiki;
-
-package IkiWiki;
-
-sub rcs_update () {
-}
-
-sub rcs_prepedit ($) {
- return ""
-}
-
-sub rcs_commit ($$$) {
- return undef # success
-}
-
-sub rcs_add ($) {
-}
-
-sub rcs_recentchanges ($) {
- my $num=shift;
- my @ret;
-
- eval q{use Date::Parse};
- eval q{use XML::Simple};
-
- my $repodir=$config{srcdir};
-
- if (-d "$config{srcdir}/_darcs") {
- my $child = open(LOG, "-|");
- if (! $child) {
- exec("darcs", "changes", "--xml",
- "--repodir", "$repodir",
- "--last", "$num")
- || error("darcs changes failed to run");
- }
- my $data=<LOG>;
- close LOG;
-
- my $log = XMLin($data, ForceArray => 1);
-
- foreach my $patch ($log->{patch}) {
- my $date=$patch->{local_date};
- my $hash=$patch->{hash};
- my $when=concise(ago(time - str2time($date)));
- my @pages;
-
- my $child = open(SUMMARY, "-|");
- if (! $child) {
- exec("darcs", "annotate", "-s", "--xml",
- "--match", "hash: $hash",
- "--repodir", "$repodir")
- || error("darcs annotate failed to run");
- }
- my $data=<SUMMARY>;
- close SUMMARY;
-
- my $summary = XMLin("<lame>$data</lame>", ForceArray => 1);
-
- # TODO: find @pages
-
- push @ret, {
- #rev => $rev,
- user => $patch->{author},
- #committype => $committype,
- when => $when,
- #message => [@message],
- pages => [@pages],
- }; # if @pages;
- return @ret if @ret >= $num;
- }
- }
-
- return @ret;
-}
-
-sub rcs_notify () {
-}
-
-sub rcs_getctime ($) {
- my $file=shift;
-
- eval q{use Date::Parse};
- eval q{use XML::Simple};
- local $/=undef;
-
- # Sigh... doing things the hard way again
- my $repodir=$config{srcdir};
-
- my $filer=substr($file, length($repodir));
- $filer =~ s:^[/]+::;
-
- my $child = open(LOG, "-|");
- if (! $child) {
- exec("darcs", "changes", "--xml", "--reverse",
- "--repodir", "$repodir", "$filer")
- || error("darcs changes $filer failed to run");
- }
-
- my $data=<LOG>;
- close LOG;
-
- my $log = XMLin($data, ForceArray => 1);
-
- my $datestr=$log->{patch}[0]->{local_date};
-
- if (! defined $datestr) {
- warn "failed to get ctime for $filer";
- return 0;
- }
-
- my $date=str2time($datestr);
-
- debug("found ctime ".localtime($date)." for $file");
-
- return $date;
-}
-
-1
-</pre>
-"""]]
-
----
-
-I merged the two versions above and made some fixes; it is recording my web edits in darcs and showing a recent changes page.
-It is in a [darcs repository](http://joyful.com/darcsweb/darcsweb.cgi?r=ikiwiki-darcs), please send patches. --[[Simon_Michael]]
-
-> I'd like to see at least the following fixed before I commit this: --[[Joey]]
-> * Running `darcs record $filename` in backticks is not good (security)
-> The thing to do is to open stdout to /dev/null before execing darcs.
-> * Get `rcs_recentchanges_xml` working, parsing xml with regexps does
-> not seem like a maintenance win.
-> * `rcs_notify` should be removed, it's no longer used.
-> * Some form of conflict handling. Using darcs to attempt to merge
-> the changes is I gusss optional (although every other rcs backend,
-> including svn manages to do this), but it needs to at *least* detect
-> conflicts and return a page with conflict markers for the user to fix
-> the conflict.
-
-I have addressed the recentchanges bit, you can find my hacked up darcs.pm at <http://web.mornfall.net/stuff/web-root/IkiWiki/Rcs/darcs.pm>.
-
-It's got couple of FIXMEs, and a very site-specific filter for recentchanges. Not sure how to do that better though. I will eventually add web commits, probably of my own (and mention it here).
-
----
-
-And here's yet another one, including an updated `ikiwiki-makerepo`. :)
-
<http://khjk.org/~pesco/ikiwiki-darcs/> (now a darcs repo)
-> Note that there's a 'darcs' branch in git that I'm keeping a copy of your
-> code in. Just in case. :-)
-
-I've taken all the good stuff from the above and added the missing hooks. The code hasn't seen a lot of testing, so some bugs are likely yet to surface. Also, I'm not experienced with perl and don't know where I should have used the function `possibly_foolish_untaint`.
-
-Regarding the repository layout: There are two darcs repositories. One is the `srcdir`, the other we'll call `master`.
-
- * HTML is generated from `srcdir`.
- * CGI edits happen in `srcdir`.
- * The backend pulls updates from `master` into `srcdir`, i.e. darcs commits should happen to `master`.
- * `master` calls ikiwiki (through a wrapper) in its apply posthook, i.e. `master/_darcs/prefs/defaults` should look like this:
-
- apply posthook ikiwrap
- apply run-posthook
-
- (I'm not sure, should/could it be `ikiwrap --refresh` above?)
- * The backend pushes CGI edits from `srcdir` back into `master` (triggering the apply hook).
- * The working copies in `srcdir` and `master` should *not* be touched by the user, only by the CGI or darcs, respectively.
+I've taken all the good stuff from the above (now deleted --[[Joey]]) and added the missing hooks. The code hasn't seen a lot of testing, so some bugs are likely yet to surface. Also, I'm not experienced with perl and don't know where I should have used the function `possibly_foolish_untaint`.
> Review of this one:
>
-> * Should use tab indentation.
+> * Should use tab indentation. (fixed)
> * `rcs_getctime` should not need to use a ctime cache (such a cache should
> also not be named `.ikiwiki.ctimes`). `rcs_getctime` is run exactly
-> once per page, ever, and the data is cached in ikiwiki's index.
+> once per page, ever, and the data is cached in ikiwiki's index. (fixed)
> * I doubt that ENV{DARCS} will be available, since the wrapper clobbers> the entire
-> environment. I'd say remove that.
+> environment. I'd say remove that. (fixed)
> * I don't understand what `darcs_info` is doing, but it seems to be
> parsing xml with a regexp?
> * Looks like `rcs_commit` needs a few improvements, as marked TODO
-> * `rcs_remove` just calls "rm"? Does darcs record notice the file was removed
-> and automatically commit the removal? (And why `system("rm")` and not
-> `unlink`?)
-> * Is the the darcs info in [[details]] still up-to-date re this version?
+> * `rcs_remove` just calls unlink? Does darcs record notice the file was removed
+> and automatically commit the removal?
+> * Is the the darcs info in [[rcs/details]] still up-to-date re this version? (fixed)
> --[[Joey]]
> Update:
@@ -537,6 +29,8 @@ Regarding the repository layout: There are two darcs repositories. One is the `s
> this version works. It's similar, but the details differ slightly.
> You could copy my description above to replace it.
>
+>> done --[[Joey]]
+>
> There is still some ironing to do, for instance the current version doesn't allow for
> modifying attachments by re-uploading them via CGI ("darcs add failed"). Am I assuming
> correctly that "adding" a file that's already in the repo should just be a no-op?
@@ -548,4 +42,12 @@ Regarding the repository layout: There are two darcs repositories. One is the `s
>>> Done. --pesco
-[[!tag patch]]
+----
+
+I've finally merged this into ikiwiki master. The plugin looks quite
+complete, with only the new `rcs_receive` hook missing, and I
+hope it works as good as it looks. :) If anyone wants to work on improving
+it, there are some TODOs as mentioned above that could still be improved.
+--[[Joey]]
+
+[[!tag patch done]]
diff --git a/doc/todo/hidden_links__47__tags.mdwn b/doc/todo/hidden_links__47__tags.mdwn
new file mode 100644
index 000000000..43d7a8797
--- /dev/null
+++ b/doc/todo/hidden_links__47__tags.mdwn
@@ -0,0 +1,13 @@
+[[!tag wishlist]]
+
+I would like to have the possibility for hidden tags or links.
+Using the tag functionality I could group some news items for including them into other subpages. But I don't want the links or tags to show (and I don't want Tag lists like "Tags: ?mytag").
+The tagged items should not differ from the items, that are not tagged.
+I didn't find any way to hide the tag list or links and I don't want to have to create a "hidden" page containing links to the pages and then using the backlink functionality, because this is more prone to errors. It's easier to forget adding a link on a second page than forgetting to add a needed tag to a new newsitem.
+
+> I found out, that using the meta plugin it is possible to create the hidden link, that I wanted.
+-- [[users/Enno]]
+
+>> Yes, meta link will not show up as a visible link on the page, while
+>> also not showing up in the list of tags of a page, so it seems what you
+>> want. [[done]] --[[Joey]]
diff --git a/doc/todo/inline_autotitles.mdwn b/doc/todo/inline_postform_autotitles.mdwn
index 8bf71deae..5005208be 100644
--- a/doc/todo/inline_autotitles.mdwn
+++ b/doc/todo/inline_postform_autotitles.mdwn
@@ -1,8 +1,9 @@
[[!tag wishlist]]
[[!tag patch]]
-for inlines of pages which follow a certain scheme, it might not be required to
-set the title for each individual post, but to automatically set the title.
+for postforms in inlines of pages which follow a certain scheme, it might not
+be required to set the title for each individual post, but to automatically set
+the title and show no input box prompting for it.
this can either be based on timestamp formatting, or use the already existing
munging mechanism, which appends numbers to page titles in case that page
already exists.
diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn
index 874460b29..e3cec4a9b 100644
--- a/doc/todo/need_global_renamepage_hook.mdwn
+++ b/doc/todo/need_global_renamepage_hook.mdwn
@@ -111,3 +111,5 @@ hashes is desired, it could return the full set of hashes.
>>>> It looks good. I made some small changes to it in my own po branch.
>>>> Nothing significant really. If this were not tied up in the po branch,
>>>> I've have merged it to master already. --[[Joey]]
+
+>>>> Thanks, this is great :) --[[intrigeri]]
diff --git a/doc/todo/rewrite_ikiwiki_in_haskell.mdwn b/doc/todo/rewrite_ikiwiki_in_haskell.mdwn
new file mode 100644
index 000000000..204c48cd7
--- /dev/null
+++ b/doc/todo/rewrite_ikiwiki_in_haskell.mdwn
@@ -0,0 +1,68 @@
+[[!tag wishlist blue-sky]]
+
+In the long term, I have been considering rewriting ikiwiki in haskell.
+It's appealing for a lot of reasons, including:
+
+* No need to depend on a C compiler and have wrappers. Instead, ikiwiki
+ binaries could be built on demand to do the things wrappers are used for
+ now (cgi, post-commit, etc).
+* Potentially much faster. One problem with the now very modular ikiwiki is
+ that it has to load up dozens of perl modules each time it runs, which
+ means both opening lots of files and evaluating them. A haskell version
+ could run from one pre-compiled file. Other speed efficienies are also
+ likely with haskell. For example, pandoc is apparently an order of
+ magnitude faster than perl markdown implementations.
+* Many plugins could be written in pure functional code, with no side
+ effects. Not all of them, of course.
+* It should be much easier to get ikiwiki to support parallel compilation
+ on multi-core systems using haskell.
+* A rewrite would be an opportunity to utterly break compatability and
+ redo things based on experience. Since the haskell libraries used for
+ markdown, templates, etc, are unlikely to be very compatable with the perl
+ versions, and since perl plugins obviously wouldn't work, and perl setup
+ files wouldn't be practical to keep, a lot of things would unavoidably
+ change, and at that point changinge everything else I can think of
+ probably wouldn't hurt (much).
+
+ - Re templates, it would be nice to have a template library that
+ doesn't use html-ish templating tags, since those are hard for users to
+ edit in html editors currently.
+ - This would be a chance to make WikiLinks with link texts read
+ "the right way round" (ie, vaguely wiki creole compatably).
+ - The data structures would probably be quite different.
+ - I might want to drop a lot of the command-line flags, either
+ requiring a setup file be used for those things, or leaving the
+ general-purpose `--set var=value` flag.
+ - Sometimes the current behavior of `--setup` seems confusing; it might
+ only cause a setup file to be read, and not force rebuild mode.
+ - Hard to say how the very high level plugin interface design would change,
+ but at the least some of the names of hooks could stand a rename, and
+ their parameter passing cleaned up.
+
+We know that a big, break-the-world rewrite like this can be a very
+bad thing for a project to attempt. It would be possible to support
+external plugins written in haskell today, without any rewrite; and a few
+of the benefits could be obtained by, eg, making the mdwn plugin be a
+haskell program that uses pandoc. I doubt that wouod be a good first step
+to converting ikiwiki to haskell, because such a program would have very
+different data structures and intercommuniucation than a pure haskell
+version.
+
+Some other things to be scared about:
+
+* By picking perl, I made a lot of people annoyed (and probably turned
+ several people away from using ikiwiki). But over time there turned out
+ to be a lot of folks who knew perl already (even if rustily), and made
+ some *very* useful contributions. I doubt there's as large a pool of haskell
+ programmers, and it's probably harder for a python user to learn haskell
+ than perl if they want to contribute to ikiwiki.
+* It might be harder for users of hosting services to install a haskell based
+ ikiwiki than the perl version. Such systems probably don't have ghc and
+ a bunch of haskell libraries. OTOH, it might be possible to build a
+ static binary at home and upload it, thus avoiding a messy installation
+ procedure entirely.
+* I can barely code in haskell yet. I'm probably about 100x faster at
+ programming in perl. I need to get some more practical experience before
+ I´m fast and seasoned enough in haskell to attempt such a project.
+ (And so far, progress at learning has been slow and I have not managed
+ to write anything serious in haskell.) --[[Joey]]
diff --git a/doc/todo/rewrite_ikiwiki_in_haskell/discussion.mdwn b/doc/todo/rewrite_ikiwiki_in_haskell/discussion.mdwn
new file mode 100644
index 000000000..1edebe4e8
--- /dev/null
+++ b/doc/todo/rewrite_ikiwiki_in_haskell/discussion.mdwn
@@ -0,0 +1,14 @@
+Ok, I have to admit, I have no idea if this is an April fool's joke or not.
+Congratulations for demonstrating that April fools jokes can still be subtle
+(whether intentionally or not!) -- [[Jon]]
+
+> Having said all that, have you looked at erlang? Have you heard of couchdb?
+> I'd strongly recommend looking at that. -- [[Jon]]
+
+>> I've glanced at couchdb, but don't see how it would tie in with ikiwiki.
+>> --[[Joey]]
+
+
+>>> It doesn't really. I recently (re-)read about couchdb and thought that
+>>> what it was trying to do had some comparisons with the thinking going on
+>>> in [[todo/structured_page_data]]. -- [[Jon]]