SourceForge.net Logo
July 5, 2006
GPL
ProWikiCenter
Programmers Roadmap

UnderConstruction. This page gives an overview for persons interested in programming the ProWikiScript or understanding its implementation aspects.

General Information

The ProWikiScript is a relatively small piece of software, well below 20.000 lines of Perl code (or 0.5 MB of source).

Although Perl is a great programming tool, we always felt that at some point we might want to translate the script to a more efficient, natively compiling language like C or D. That's the reason why everything is kept focused and the number of imported Perl modules is kept at a minimum.

This is also the main reason that, although the ProWiki code is very object-orientated and supports various forms of inheritance (for example: pages inherit the properties of their ancestors), the Perl code itself doesn't use OO features for implementation. There never seemed enough benefits to come from it compared to the effects of locking us into the language.

All important symbols (function names, global variables) are unique. By a simple search through ProWikiScript you get the place of definition and all places of use. Consider ProWikiScript a database that you access by searching. Compared to typical OO code there are no syntax constructions "->write(...)" that get their meaning from a context.

Language Independent Programming

ProWikiScript uses a "language independent programming" in TheLop style (with a few exceptions). It's very typical for this way of programming that what you do can be expressed by a single function call because you don't need to create objects (implementation objects) before you use them.

In short this means:

  • The parts (words) of function names are controlled vocabulary. E. g. everything related to Unicode will have "Unicode" in its name.
  • Function names reflect their meaning. E. g. FileAppStr("filename","some text\n"); will append ("App") a string ("Str") to a file ("File"). It can be considered isomorphic to an OO file.appendString.
  • Functions reflect their parameters and return value. E. g. $size=PageRetSize("FrontPage"); returns ("Ret") the page length in bytes ("Size") of a given page name ("Page").
TheLop is based on OO thinking and more transformational. This means that a wiki, a server, a databae, a string, an array or a file (and many other real world objects) are considered objects, whether they are handled by a formal object reference, a symbolic reference (like a file name), a primary key (like in a database) or even implicitely (e. g. when the object is unique).

The Storage System

ProWiki uses normal files to store wiki data, no database is needed. Accessing a page content is exactly as efficient as accessing a raw file. There is no technical difference: a page content is a raw file.

For quick access in a database-like manner, certain data is cached in various log files. To give an example: the page index is read from the PageLog file which contains entries for "page creation" and "page deletion" events. Therefore ActionIndex can be very quick because it does simple processing of a small file instead of processing database records.

Of course, there are many aspects of "database vs. filesystem" and both systems have their advantages. Currently the FileSystem serves ProWiki very well and only scaling problems (if a customer really wanted to handle a million pages in a single wiki) would create a need for a database interface.

Programming Guidelines

When contributing code, please:

  • make global symbols CamelCase and use the controlled vocabulary
  • make local symbols either lowercase or at least starting lowercase
  • use 2-character indentation levels
  • write all logic and loops using braces
  • write simple code (avoid deeply nested constructions)
  • write simple data structures (avoid nested hashes or arrays)
  • write common-sense well-performing code (without complicated optimizations)

Details


FolderProgramming FolderStartingPoints