Monday, October 12, 2009

curlgen using Rebol QuarterMaster

Over at aule-browser.com I have the 3.11 version of Rebol QuarterMaster generating some Curl web content.

Two minor changes were required to tweak the qm.r source for the Content-Type to be "text/vnd.curl" and to share Apache with other web frameworks.  As with Django, you will need the final forward slash on the URL paths such as /qm/ or /macros/.

The QuarterMaster file structure is quite plain by the time you are 2 levels deep and it lies outside my web container. The lower level is the expected ./controllers and ./models and ./views that you would expect with a web-style MVC framework.  Compared to Django on the same host, there was minimal configuration required.

The Curl code that you see at aule-browser.com/qm/ resides in an RSP file within the views/pages folder which reflects this QM install being configured to use a pages controller.  That code resides in ./controllers/pages.r and is simply:
REBOL [   title: "Pages Controller"
  type: 'controller
  default: "index"
]
action "index" does [
    render %welcome.rsp]
If you are not familiar with Rebol, it is (among other uses) the scripting language of the Syllable operating system and is currently in alpha-88 and moving towards a beta for version 3.0 at http://www.rebol.net/

Like ICON and Curl, Rebol is a reflective expression-based object language but without ICON's keywords.
While recently ObjectIcon has brought a ICON dialect up to UNICODE, Rebol will be UNICODE with version 3.0 and will have modular facilities suited to PITL.  Curl, of course, has had both since its inception almost a decade ago.

Rebol3 will see various extensions to parse which is how Rebol scans a string or series datatype.  And like ICON, Rebol has many data types: I count 58 at this point of the Rebol3 alpha.  In Rebol, the values have the data types and an effort has been made to provide useful types for web development, such as tag! and url!

When Rebol3 goes to beta, the author of QuarterMaster can be expected to release a new version.

When all was said and done, less effort was required to get QuarterMaster generating Curl than was required to get the same result from Django at www.aule-browser/macros/ (which is intended eventually to showcase Curl macros).

If you would like to try QuarterMaster on a localhost, I would sugggest either Jetty or the Cheyenne Rebol server. I should note that Syllable Server's documentation states that it includes the "QuarterMaster web application framework, configured to run on Cheyenne." and, at a glance, I would guess that http://www.syllable.org/ is itself running on QuarterMaster.

No comments: