Russ Lipton Documents Radio
simplex veri sigillum

Learning Scripting

This topic pulls together material already posted on this weblog, plus several useful links to additional Userland documentation. More to come in the future as opportunity and need dictates. I over-simplify here. What do you expect? I'm just an end-user.

What Is Scripting?

Scripting is really just programming by another name. (Don't tell a programmer I said that).

Scripting emerged originally within the UNIX community as a way to write extremely short programs. These five to fifty-line scripts enabled narrow, well-defined tasks to be completed more quickly and improvisationally than could be done with most traditional, compiled programming languages.

By contrast to assembler, Fortran, or C, scripting languages offered a simpler syntax with a correspondingly simpler learning curve. They executed interpretatively (immediately) when run. End-users could generally do something with them fairly quickly or at least utilize scripts written by scripting hackers.

The original BASIC programming language would probably today be considered more of a scripting language. We forget how revolutionary Bill Gates' rewrite and popularizing of BASIC as a 'serious' language was back in the late 70s and early 80s. People began writing large 500-line (heck 5,000 line) applications in this toy dialect.

(Needless to say, today's Visual Basic is generations removed from early BASIC and is no longer truly a scripting language at all).

During the 1980s and 1990s, a plethora of scripting languages were created on all major personal computer platforms - from HyperCard and later AppleTalk on the Macintosh to Perl and Python for UNIX (these latter spread virally across all platforms). Userland's UserTalk began life on the Mac but has long been equally serviceable on both Macintosh and Windows machines.

Javascript (ironically, bearing no true relation to Java) has become the major scripting language for direct programming within browser-readable HTML texts.

Scripting languages execute up to ten times more slowly than compiled languages like C and C++. Still, advanced scripting languages like UserTalk can now be used to develop full-blown deliverable applications, not to mention major prototypes later targeted for recoding in C or C++. Indeed, excluding certain low-level primitives, Frontier and Radio are UserTalk applications themselves. This says it all. 

As computer hardware speeds continue to exemplify Moore's Law for the next decade (doubling in speed every 18 months), use of scripting langages as a primary development language grow more compelling for many vendors and, certainly, many serious programmers and end-users.

What Is UserTalk?

Userland's UserTalk is a full-blown scripting language suitable for executing simple tasks - or building entire tools and applications - within the company's Frontier-Manila and Radio platforms. While features have been borrowed from AppleTalk, Perl and Python, it is an original language that stands on its own.

UserTalk itself cannot be easily separated from the object-oriented, hierarchical and table-driven databases at the root (pun intended) of Frontier and Radio. Even more precisely, UserTalk is tightly integrated with the outlining model that is - for Userland - a way of organizing not only their products but the way that human beings think and manage knowledge.

UserTalk offers not only the usual collection of control structures but a wide array of verbs that can iterate through Frontier database tables.  Programmers and end-users can create scripts that retrieve database values, manipulate word processing or outline texts, conditionally execute templates and - of course - render and publish the results of these operations either locally or externally to the Internet.

How Do I Learn UserTalk?

Unfortunately, Userland has always been far more interested in pushing the envelope of its products than in documenting what it has already done in the past.

While documentation is not lacking, it is often sparse or rather poorly organized. You will find this directory of scripting documents as well as sample scripts useful. This sub-directory of Manila resources offers a look at more recent Userland work than some of the other materials included.

Userland's somewhat casual approach to documentation is rather strikingly counter-balanced by the visibility Userland offers its users into the internals of its products.

Nearly all UserTalk code, not to mention the actual data used to construct Frontier and Radio, is directly visible to us within database tables.  The best way to learn UserTalk is to inspect these tables. Once we grasp the disciplined hierarchical model behind Frontier and Radio's internal design and the way Userland's script processor executes, the UserTalk model becomes comprehensible.

Obviously, those who come to UserTalk with programming experience have a huge head-start over those of us who don't know an if-then-else from, say, a bundle. However, the annals of Userland are replete with testimonials from end-users who began mucking around in the Frontier toolbox and came away able to write amazingly useful scripts for themselves and fellow end-users.

The three best sources for learning UserTalk and related Userland database concepts are:

1. Matt Neuberg's Frontier: The Definitive Guide. This was originally published by O'Reilly but has been out-of-print for a few years. Happily, you can read the entire text online.

The Guide is somewhat obsolete as these things go. It knows nothing of Manila and less of Radio. Still, I agree with Matt's estimate that 85-90% of the content applies to these products today. UserTalk has been extended in some ways since the book was written but remains backwardly compatible. Even more to the point, the Guide offers a superb look at Frontier database tables and the model for executing scripts. These still apply as written to the newer Userland products.

Not least, Matt is a superb technical writer. Very few technical texts dare claim the word 'elegant' but this one comes close.

2. The Doctor Is In! Can you say .... Matt Neuberg?

This is Matt's hyperlinked personal website further explaining UserTalk, Frontier and ... happily ... a bit of Manila and Radio as well. While Matt seems to have drifted off the scene in the last year or so, you will find a wealth of tips, tidbits and the same lucid style that so happily marked his book.

3. Userland's own Scripting Tutorial. If scripting intimidates you (for instance, you checked out the links above and your eyes bugged out), this tutorial will soothe your nerves. While it won't turn you into a UserTalk hacker, it will give you a deeper understanding and appreciation for the sophisticated way that web design and scripting work together in all Userland products.

(Try my Using Radio for Userland's Scripting Tutorial to help you get started with the tutorial).

And Now For Something Completely Different ... Python

Python, as mentioned briefly above, is another full-blown scripting language. Indeed, its popularity utterly dwarfs UserTalk. This is scarcely surprising. UserTalk is a proprietary language created by a for-profit software vendor. Python is an open-source programming language that runs on every platform known to man.

Learning Python will not help you directly with UserTalk. However, if you want to become a serious scripter, I strongly recommend your developing competency in Python.

I recommend this because, In My Humble end-user Opinion, Python is the most elegant, readable, flexible and powerful scripting language ever designed.

I recommend this because, In My Humble end-user Opinion, Python attracts many of the world's best, or at least most interesting, scripting hackers - meaning it increasingly features thousands of the world's best scripts and application prototypes.

I recommend this to you and me because the wealth of available tutorials and samples enables us to learn what scripting really is and why it matters - especially for the Internet. Although UserTalk and Python exhibit numerous differences, it is possible to transfer (at least) our conceptual understanding of Python scripts fairly readily to their counterparts in UserTalk. It also enables us to envision how we might clone a Python script in UserTalk.

Python's creator, Guido Van Rossum, a Rick Moranis clone, did not name Python after the snake but after the British comedy troupe. He himself has written extensively on Python, including a literate tutorial.

I find sometime Radio-user and critic Mark Pilgrim's online book to be a superb introduction to Python. It will give you an appreciation for HTML and XML processing as well. In fairness, Mark's book is intended for professional programmers.

Not least, How To Think Like A Computer Scientist using Python isn't really just for computer scientists. Heck, I read it and even claim to understand some of it.

Lots of books printed from dead trees are also available at your local big-chain bookstore.

You can understand from my comments why I am excited by the interest being taken by Python hackers in Radio. David Brown's experimental Python IDE and now Philip Pearson's Python-RCS clone stand out. In my judgment, Userland would do well to design a tight programmatic interface between its products and Python. While that is perhaps unlikely, Dave Winer and the gang have a healthy respect and apreciation for the Python community. Future alliances and partnerships, if only of the friendly variety, are likely.

Why Bother?

Scripting is not for everyone or even for most of us. You can master Radio as a user (that is, as a writer) without knowing a thing about scripting.

If, on the other hand, you have a passion for getting under the hood and customizing the engine, Userland and UserTalk offer you a complete toolkit for getting your hands dirty.

Don't say I didn't invite you. And warn you.

 <-- Return to Home Page

Copyright 2002 © Russ Lipton.
Last update: 4/13/02; 10:06:17 PM.
3 page reads.