Friday, November 7, 2008

Curl with SQLite and style skins

Last night I was setting up a Curl 6.0 desktop application and in the course of editing my DCURL file realized that some of what I had to do for styling was not obvious.

For my own stuff, it is my habit to locate projects initially in a root folder for the Curl version, so the folder for this project was in my /Curl6 (later, what I keep can move into version control on a box of mine or on the web.)

Even then I have to remind myself that by Curl6, what I mean is Curl 6.0 (in this case 6.0.4+) because in the internal surge files you will see that curl6 is Curl 5.o and Curl 6.0 is curl7 ... but you only see that if you look into the Curl Surge install directories themselves.

So when I created the new project in the Curl IDE I chose to place a new folder in my /Curl6 and I was careful to select 6.0 as my version and to choose style sheets and to use the default.

So when my project opens in the Curl IDE, the start.dcurl file contains

{manifest-url "file", "DEFAULT-STYLE-SHEET"}
Now you have to think. First, I have a folder in /Curl6 which I had renamed COM.CURL.GUI.STYLED from its original (which was tagged with versioning info) and it is the PCurl "deploy" version that came in the zip file from

But what I need is the default stylesheet from the styles package folder. I go copy that default-style.scurl into my new folder. Oh yes, I also go get the dss-defs.scurl file as well. Now I use the IDE's Project menu to add them to my project as file resources.

But I am not there yet. My new project's manifest does not yet have an entry for a resource which actually matches "DEFAULT-STYLE-SHEET"

What my new manifest must have is

{component file DEFAULT-STYLE-SHEET,
location = "default-style.scurl"
So in I click on my projetc's name in the project pane and edit the project's manifest to create that identifier. Think of it as a URI. Note that it is not quoted. It could have been any useful tag of my choosing, but they need to match so as to map URI to the resource as that location. This concept of resources is part of the great flecibility of developing and deploying Curl: you are not working directly with physical file includes as in a zipped java JAR file. And you are not having to use XML.

Now to think of what more is needed: I need to delegate to my CDK and to my STYLE packages.

Up on the Project menu there is an option to add delegates, so I add two of them by selecting the manifest.mcurl file found in the folder for the CDK for SQLite and the folder for styles and skins.

Those manifest entries are now

{delegate-to COM.CURL.CDK,
location = "../COM.CURL.CDK/manifest.mcurl"

{delegate-to COM.CURL.GUI.STYLED,
location = "../COM.CURL.GUI.STYLED/manifest.mcurl"
So what more could be needed? Ah, yes, import those packages into my new DCURL text file.

The first thing I did was to add || errors next

{import * from COM.CURL.CDK}
{import * from COM.CURL.GUI.STYLED} Oops! F5 key kicks up red error messages.

If I had clicked on the "delegate" icons that were added to my prject pane, I would have seen that those manifests contain such entries as
{component package COM.CURL.CDK.SQLITE,
location = "SQLITE/load.pcurl"

{component package COM.CURL.GUI.STYLED-CONTROLS,
location = "skinned-controls/load.pcurl"
so what I need to decalre as my imports in my start.dcurl are
{import * from COM.CURL.CDK.SQLITE}
Now a click on F5 to run my project and all is well.

Now to open Mike Gordon's Style Designer (itself a DCURL desktop app) and away I go ...

You might also want to look over the page at Curl on style sheets - if you click the button up right to "view as PDF" ypu can also save it as a PDF if that is your preference for handy docs.

Of course, docs are always online at although my preference is to use bookmarks in the the Curl Documentation Viewer that comes with the IDE (and is itself a DCURL desktop application - and so can be opened more than once on your desktop.)

Sunday, November 2, 2008

Curl and the future of the starter kit

With the passing of Ralph Griswold, an author of SNOBOL and the ICON language, I became much more aware of the importance of archiving the history of the evolution of computing. Some of this work is actual library archive tasks (boxes of paper) and some is digital.

It is my hope that the Curl4 (which means Curl 3.0) Starter Kit will find a place first in opensource and then in a proper archive as part of the evolution of the Curl language.

In general I found that the the 3.0 Curl Starter Kit (CSK) ported easily to Curl6 (Curl 5.0) except for actually using the IPC (inter-process communication) from applet to subapplet. The biggest change between the CSK and the current Curl opensource projects is probably in the XML parsing toolset. Curl has now moved to the XML Document Model (XDM) so the code is out-dated but not uninteresting to anyone interested in programming language change. At the moment I am watching the emergence of 2 languages and a major transition in a language rather like Curl, that being REBOL which is now moving from 2.0 to 3.0. REBOL has just come through the pain of moving to UNICODE (which I think should have been what the UNICON version of the ICON language should both have meant and have accomplished) but Curl has been UNICODE since its commercial release in 2001. In the case of REBOL, we should have access eventually to the message exchanges among the key players and the language community as critical choices were made. I do not know what will be made available eventually for archive for Curl.

Every project has its challenges and perhaps Curl 4.0 was such a problem child for the Curl team. That transition deserves to have its documents preserved. The evolution to Curl 7.0 and the on-going discussion of what the Curl developer community might want to see in Curl 8.0 is part of the history of a programming language: some of its virtual documents will be preserved by the very nature of the web as was the case with internet news.

The unexpected death of the chair of CS at MIT early in the life of Curl no doubt had some impact at the time. David Kranz, the chief architect of Curl, may already have his account of the early days of the language. But in history, such reporting only constitutes another document. The Curl initiative was spun-off as a commercial enterprise at a time when opensource was just emerging. And it had been the early authors of SNOBOL at Bell Labs who may have inadvertently started the process when they placed SNOBOL in the hands of their listeners in an early public talk (at least that is the legend as I know it ...)

Yesterday I had a moment to comment to some young artists that the looms in their school had a connection with the computers in their media lab. And there, too, is a connection with the last days of Ralph Griswold: weaving and computing.