develooper Front page | perl.perl6.language | Postings from September 2005

[RELEASE] WWW::Kontent 0.02: Release and revelations

Brent 'Dax' Royal-Gordon
September 1, 2005 17:38
[RELEASE] WWW::Kontent 0.02: Release and revelations
Message ID:
= WWW::Kontent 0.02

I am happy to announce the release of WWW::Kontent 0.02:

    File: $CPAN/authors/id/B/BR/BRENTDAX/WWW-Kontent-0.02.tar.gz
    Size: 62121 bytes
     MD5: 513018f0f2f8a0533a79d0b642323f2b


Please note that it may take some time for the distribution to reach
your local CPAN mirror.

Kontent is a flexible web content management system written in Perl 6
and executable with Pugs.  I am writing it with the help of The Perl
Foundation and Google's Summer of Code program.  This release is an
early alpha, largely feature-complete but requiring a good deal of
work, including security work.  However, it is suitable to be tested
out and run on localhost.

In its initial configuration, Kontent looks quite similar to a wiki,
with the ability to create and edit pages through a web interface and
view a revision history.  Examination of the code, however, will
reveal a fairly sophisticated architecture capable of giving each page
unique behavior and rendering the same content in multiple formats.  A
command-line tool is provided which can manipulate pages at a low
enough level to change a page's class.

Although the distribution is on the CPAN, it cannot be automatically
installed by or CPANPLUS, largely because I haven't decided
what should be installed where.  I recommend you simply download the
tarball and extract it in your home directory.  The INSTALL file
included in the distribution will explain how to get it running.  Note
that you will need both a copy of Pugs configured with Perl 5 interop,
and a copy of Parrot to execute Perl 6 regular expressions.  You will
also need a SQL database engine and the Perl 5 DBI drivers to access

= Perl 6 Notes

Part of the purpose of this project was to test Perl 6, and I'm happy
to report that it passed with flying colors.  Perl 6 feels like a
much-enhanced Perl 5, with all the wrinkles removed and very few new
ones added.  It seems to be a very solid design, and is a joy to
program in.

A few specific points:

* gather/take is one of the hidden wins of Perl 6.

If you've ever written a function that builds up data throughout its
entire body (for example, a bunch of [X|HT]ML), you will *adore*
gather/take.  It turns what used to require declaring a variable and
repeatedly pushing (or concatenating) into something akin to good ol'
fashoned print statements.

* Object programming is a dream.

The new object system fits together very well; I never felt that I
wanted to do something Perl 6 wouldn't let me do (although there are
some things I want to do that Pugs doesn't implement yet).  Although
roles aren't really available to me yet, I can already see some very
useful places to to use them in later versions of this system.

Two comments on the object system, however:
  * In one class, I wanted to initialize an attribute with data that
wouldn't be available until its subclass had its turn BUILDing; I
ended up having to write a private method to initialize the attribute
and then arrange to call it before using the attribute anywhere in the
class, which wasn't exactly optimal.  There may be a place for some
sort of POSTBUILD method which is called after the entire BUILD chain
is finished.
  * Prior to writing Kontent, I saw submethods as something of a hack,
and actual use of Perl 6 hasn't changed my opinion about them.  I
never used or wanted to use a submethod except to handle BUILD,
DESTROY, and the like; it might be better to replace submethods with
some sort of "cascade method" construct which implicitly calls all the
way up the inheritence tree.

* Junctions are useful just the way they are.

I only used junctions a few times, but where I used them they saved a
lot of code duplication.  I sometimes, but certainly not always, found
myself using them simply for their autothreading side effect and
ignoring the boolean meaning of the junction.  I don't think junctions
were ever critical to the system's logic, but they helped reduce
duplication and made things quite a bit clearer.

* The new pattern-matching engine is a win for small regexes, too.

Due to its half-implemented state, I was not able to write a
substantial grammar (although I definitely have a place I can use
one).  However, I did use the Perl 6 pattern engine wherever I could,
and even on short regexes it resulted in clearer, more concise code
than the Perl 5 equivalent.

I could not have done this project without the support of Google and
the Perl Foundation, especially my mentor at TPF, Ovid.  Nor would
this project be possible wtihout the efforts of the Perl 6 design team
and the Pugs implementation team.  Thanks to everyone involved.

Share and enjoy,
Brent 'Dax' Royal-Gordon <>
Perl and Parrot hacker Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About