I’m a fan of a design pattern for software where in a very large, complex, rich data-type creates the meat of the application and then over that you pour a gravy of scripting.
In the most delightful manifestations of this pattern the languages carry a deep and complementary flavor over from the meat. Examples of that happening are cases like SQL query languages, Hypercard, APL, Perl’s string handling syntax, Awk, Erlang, Mathmatica. One of the sweeter aspects of AppleScript is how that language is flavored by the application/document model that informs the user experience of the Mac.
A scripting layer creates a huge range of affordances for the the users (or more likely their agents the developers) to leverage the underlying data-type. The scripting lets me, the software designer, delegate searching the space of opportunities that data type presents. In the limit the scripting creates an infinity of possibly extensions while the universe users/developers provides an infinity of search agents. Additionally as developers become fluent in the scripting language (so they become more loyal) and the population of users grows (so the audience for developers grows) a network effect can emerge.
You can see this same design pattern cast in a slightly different light has emerged around Internet middle-ware. A middle-ware programming language like PHP, Perl, etc. etc. provides the gray on top of the rich data stored in locally and in the Web.
There is a competing design pattern were we focus not on the synergy between the data and the scripting language but instead on the boundary between them. Focusing on that boundary leads to talking about APIs or protocols. This is not without it’s benefits, for example it can leave the choice of scripting language unbound. That’s good for at least two reasons. First it enlarges the pool of developers you get to draw upon. Second it lightens the design load; both in the short-term (you don’t have to design a scripting language to get going) and the longterm (you don’t have to evolve your scripting language to keep going).
I got to discussing this with a colleague the other day. He was advocating that we play of the scripting card in a certain context. Surprisingly, my intuition was opposed.
Like most people working on a problem I reach into my bag of tricks pulling out various tools and seeing if they help. These days I’m in a bit of a rut. Every time I reach in the bag I seem to pull out this damn power-law model.
So I notice that on the Unix platform there is a huge diversity of scripting languages; it’s a part of the Unix story going way back. I’d assume if you collected some statistics about the popularity of various languages in the Unix you’ll find a power-law curve who’s parameters are reasonably egalitarian. Of course it’s a stretch to claim that any power-law curve is egalitarian but some are more monotheistic than others!
Over on the PC platform the story is quite different. There the one true scripting language is Basic (which marketing in a classic ‘new and improved’ upgrade ploy decided to call Visual Basic); it’s a part of the DOS story going right back to the beginning. So it is a huge uphill fight to introduce an application specific language into that climate. Where in the Unix culture a learning a bit of a new scripting language is a common experience in the PC culture it’s an unusual one. If we had statistics about the scripting community scale on the PC, Then, like most everything else on the PC, it wouldn’t be particularly egalitarian.
It’s interesting to recall that when the Mac was first introduced Gates made a point of horse trading with Apple so that the Basic implementation Apple had lined up, finished, and ready-to-go was never shipped.
People tend to get all fixated on the role of protocols (XML et. al.) as the tool for creating openness and interoperability across the Internet. That maybe a mistake. It maybe we should be a lot more conscience about the role of a diverse population of languages in this game. That a world of one language is, in time, a monotheistic world. That world, while possibly somewhat more efficient, encourages a monopoly.
Unix is more a world of small gods. Let’s hope we can keep the Internet that way.