Programming In Wiki

Why shouldn't programming be as easy as wiki?

Easy to navigate, easy to document, easy to share comments, easy to peer review, programming by gradual accretion ... massive re-use through linking to defining WikiWords, can be programmed linearly, chaotically, rapidly.

Why shouldn't an IntegratedDevelopmentEnvironment be like wiki?

Why shouldn't an IDE BE a wiki? (good question. See WikiIde.)

Why is programming harder than sketching algorithms and diagrams in a notebook?

Increasingly the PainOfProgramming comes from managing such rigid development environments. Think of the multiple files we manage, in different languages, in different file systems. The XML configuration files. The SQL scripts to build databases etc.

Now imagine all these different files replaced by WikiPages.

Imagine if we could

At the moment, WE do the hard job of arranging things for the environment. But a make script could easily crawl a wiki picking up various pieces of code, data in order to build source files, config files, etc.

The make script would itself be written on a wiki page for easy reference. It could save the various components in their traditional places before calling the compiler.


Are the LiterateProgramming people converging on something parallel to this?

But I want something less structured. Code embedded in wiki rather than comments embedded in code.

LiterateProgramming is supposed to be code embedded in documentation rather than comments embedded in code. Take a look at TexTheProgram. Granted, we're accustomed to BarelyLiterateProgramming (JavaDoc etc.), but that doesn't mean all programming has to be like that.

I wonder if an existing LiterateProgramming tool could be adapted to crawl a wiki. Seems like a good way to handle collaborative projects. There might potentially be a problem with dependencies (look how long it takes pages to get ReFactored here) or in ConcurrentEditing?, but in does seem like the ultimate in Bazaar-style development.

I love LiterateProgramming. Nonetheless, the biggest problem I have with LiterateProgramming, and the one thing that keeps me from using it beyond toy projects, is the difficulty of keeping the documentation and the code in sync. --SamuelFalvo

The first paragraph builds a vision far beyond just mixing code and documentation - it's programming in a collaborative environment: users and programmers changing code fragments or modules whenever needed. The WikiIDE will care for version control and data migration. In my opinion if ProgrammingInWiki becomes real this will change everything we knew about SoftwareDevelopment. CommunityProgrammedWiki could be a first step -- MirkoBlueming and the PfompVision.


Sean McGrath? on mixing code and data: http://www.itworld.com/nl/ebiz_ent/03112003/


I have taken the first steps down this path for a project which I have all but abandoned (attention deficit :) ). Over on my wiki, I have a utility called WikiExtract. It crawls my wiki and pulls out specially-formatted PHP code. You can look at (but not run) the source code at:

http://www.llamacom.com/~sky/wiki/phpwiki-1.3.3/index.php/WikiExtract (404 - File not found! Try http://web.archive.org/web/20050326181313/http://www.llamacom.com/~sky/wiki/phpwiki-1.3.3/index.php/WikiExtract. -- 20060328)

Note that it's tested only on my wiki, which runs under PhpWiki, and it only writes into my directory. Feel free to grab it and modify, though.

-- PatrickConnors


I have my own UnfinishedProject? here (a wiki with code generation): http://www.nooranch.com/synaesmedia/beach/wiki.cgi/CodeGenerationExperiment. (BrokenLink 20070402) -- PhilJones


Ned Gulley wrote an interesting article on a closed access wiki-like programming competition, really goes to show the speed benefits of such a system above a standard comparable OSS system; blowing away the (already pretty small) restrictions to editing placed on traditional OSS projects seems to make a huge difference. http://portal.acm.org/ft_gateway.cfm?id=986264&type=pdf&coll=GUIDE&dl=GUIDE&CFID=37969099&CFTOKEN=20840995

You can also find this paper at http://www.starchamber.com/gulley/pubs/tweaking/tweaking.html. Content is merely -> "Describe the new page here"



[EditHint: This discussion is something of a gem, and really needs its own page.]

Imagine if we could embed all code (Java, Perl, SQL, config data etc) in freeform text pages [...]

Q: Could MarkupLanguageNine be used for this?

A: Probably, though MarkupLanguageNine possesses a strong ErlangLanguage bias when it comes to values descriptions (in the metadata), and yet lacks strong referential semantics between meta-data components or from the meta-data into the source (creating the barrier discussed below). Something can be provided by the interpreter module, but making it meaningfully common across different interpreter modules would be a chore. Fortunately for ML9 (and, I'm sure, considered at great length in its design), the vast majority of languages don't reserve '@' in column 1 for anything - even those that do leverage the '@' symbol can place it in column 2 without problem. From what I've read, it wouldn't be a bad option as far as options go. That said, we'd need to extend it to support anchors and linking efforts, dependency specifications, etc. and that semantics barrier (especially across Java/Perl/SQL/config data/etc.) is something that needs looking at, as would be providing IDE support that crosses so many different languages in a single wiki (e.g. syntax highlighting, debugging, etc.)

ML9 also lacks, from what I can tell, the ability to nest tags. Maybe I'm missing something? --SamuelFalvo

ML9 provides full Erlang-value support for the meta-data associated with each tag. (@tag {name1=value1,name2=value2,...}). that is, every except the 'data' meta-value, which must be a flat string. This allows for arbitrarily complex data structures via use of tuples and/or lists. The 'data' meta-value is generally loaded from the text between the tags (though it may be loaded explicitly - (@tag {data="a flat string"})) and must be a flat string because it could be a description in any language (including text commentary) and even when describing Erlang code, this text is NOT describing an Erlang value). The author advertises this as being 'completely the opposite of XML' since in XML the attributes are flat while the 'data' section between tags has structure - and I have to agree that, regarding the purpose for which ML9 is intended, this is a good thing.

Multi-Language + Coordinator vs. Single Extensible Language with integrated InternalDomainSpecificLanguages

The scenario above ("imagine if we could embed all code (Java, Perl, SQL, config data etc) in freeform text pages [...]") favors implicitly the use of multiple languages. Ignoring consideration of whether ML9 could accomplish it for a moment (though I don't doubt it could - ML9 was designed for exactly this purpose), the question of whether using multiple independent languages is a GoodThing deserves some extremely critical consideration of its own. Further, the use of a 'coordinator' language, be it ML9 or not, also deserves scrutiny. My own conclusion is that the decision to coordinate multiple independent languages would be a BadThing (for a number of reasons), but that the extensible single-language solution can (if certain provisions are made) be quite elegant yet still provide the vast majority of the power you'd be looking for with multiple languages (and possibly even more). But I'll attempt to present the evidence for you to make your own judgement.

There are several implications in coordinating multiple independent languages. Even if we limited everything to one single language plus coordinator, the Wiki coordinator language itself becomes a layered preprocessor for that language with semantics barriers and referential barriers reaching into the core language.

If I were ProgrammingInWiki, what I'd want is a single, common language in which all code AND all commentary and annotations are written. Obviously this imposes some requirements on this language; among them is required support for markup annotations that affect only the display of code and commentary, not the meaning. Another is the need for configuration-builder support - i.e. the linker and set of available services needs to be controlled from within the language. In addition, on a per-configuration basis it would be useful to control all sorts of aspecting (to allow for aspect-oriented programming).

The main benefit is that the WikiIde suddenly gets a single, common processor, a common reference space, common syntax highlighting, the ability to reference any piece of code or commentary from any other piece of code or commentary (especially with anchors), a single debugger, code-stepper, compiler, etc., a single bootstrap, OS independence (no need to modify or intercept calls to the OS to support injected referential URIs back into the Wiki when referencing some pieces of code from others; no need for a panoply of shell tools to support 'makefile' configuration specs, etc.), the ability to reference any algorithm on the WikiIde and know it will work in your piece of code, and the ability to do so without naming a language (as opposed to needing to reference TheAlgorithmInLanguageX, or needing to use complicated references through obtuse ForeignFunctionInterfaces?, or need to perform communications to other processes through pipes or sockets, etc. - all with combined comms, security, type-safety, and optimization costs.)

But this doesn't exclude the possibility for getting your java/erlang/smalltalk/perl/SQL/Prolog/makefile/pseudo-code syntax where you want it. If the core language used for ProgrammingInWiki is an extensible language (extensible syntax and semantics), especially a non-monotonically extensible language (such that parts of the syntax and semantics can be removed from the language from within the language). It wouldn't be bad at all if one simply said (in something similar to ML9) '@JavaLanguage', and had it automatically capture most of the syntax and semantics of JavaLanguage, yet providing the necessary extensions for commentary and markup. The 'JavaLanguage' WikiWord page in the WikiIde would include the basic syntax and semantics transforms and post-processor-wrapper support to get from Java back into the core extensible language, and further provide commentary about the Java language, the reasons behind the syntax and semantics, etc. The syntax highlighting for the code under the '@JavaLanguage' tag could either be performed automatically from the specification of the Java syntax, or could involve a secondary specialized markup-annotations post-processor for Java (or could use the latter if available, and the former if not - the latter allowing for programmers to drop in their own preferences for viewing the WikiIde - e.g. DavidBarbour might have in his special page DavidBarbour:Prefs a line such as 'use WikiView.JavaLanguage.SyntaxHighlighting = AnotherPopularJavaSyntaxHighlighter').

More likely, of course, such a language would discourage the creation of other general purpose languages within it. You don't need JavaLanguage syntax and semantics within the language all that much (though it'd be useful to include when writing a JavaLanguage compiler within the language, since it'd then become a very short process... almost like a MetaCircularEvaluator). Instead, it'd be the mini-languages for various purposes - data descriptions, GUI configurations, communications hookups, etc.

As to how one gets a nice, extensible language? Well, ExtensibleAttributeGrammars atop a TuringComplete core language with nice communications support (e.g. ActorModel based) is a very a viable option, possibly with TypeChecking (be it optional or not), plus need for annotations (for markup, but also useful for any other post-processor of the language - such as optimizers), compile-time executives (to support anything a makefile would need to do), and the ability to modify the post-processor (for aspect-oriented programming, injecting typecheckers, full language redesign based on annotations - e.g. adding unit-tests to a language that was missing it, injecting optimizations, etc.). There is plenty of research in this area regarding LanguageOrientedProgramming. It is likely that AwelonProgrammingLanguage would work in this role (it already has the support for annotating code, including marking it up, built into the language design... along with support for control of the linker, access to services at compile-time, and extension of the language) but there are no promises from the author as to whether that particular language shall ever grow beyond its infancy. Maybe if it does, a WikiIde will be designed for it (as the primary development environment).

And commentary itself needn't be so 'independent' of the code - no binary division of code and commentary. Commentary can just be written in a specialized commentary language (much as you see with the various documentation-readers today, plus support for markup), which creates annotations of the code, which is utilized by the post-processor when it comes time to display said commentary. Post-processors would still be able to investigate the code with which the commentary is associated in order to create interface descriptors and whatnot.

-- DavidBarbour


ProgrammingInWiki -- DonaldNoyes 20080222.1345.m06


See WikiWithProgrammableContent, SoftWiki, XpSystem, SelfProgrammingWiki, HyperPerl, LanguageOrientedProgramming, WikiIde

EditText of this page (last edited August 17, 2008)
FindPage by searching (or browse LikePages or take a VisualTour)