Lingo Scripting Language

Lingo is the ScriptingLanguage used in MacromediaDirector. It is surprisingly flexible and fast, although its support of ObjectOriented techniques is pretty weak.


History:

Lingo has roots in Hypertalk and LISP. Director (originally Videoworks) was designed to extend Apple's Hypercard Authoring tool by providing accelerated animation features based on a (loose) 'movie' metaphor and using a spreadsheet-like timeline interface. When scripting was added, it made sense to copy the syntax and structures of Hypertalk, where objects are referred to in the so called 'verbose' form i.e. 'the property of object' or 'item 2 of word 3 of field 5'.

Primitive 'collection' and object-oriented features called 'factories' were first added to the language in Director 3, the first version to support playback (but not authoring) under Windows. In Director 4 these were replaced with lists, property lists and parent scripts. The implementation of these has similarities with LISP, although recursion is not a central technique in Lingo programming. Garbage collection is performed using reference counts.

The OOP implementation works by using the first parameter sent as an object reference, known by convention as 'me', and in whose scope the handler executes. Inheritance chains can be set up (and modified on-the-fly), whereby unknown calls are passed to the object referenced by an optional 'ancestor' property but otherwise there is no provision for a default handler of unknown calls. If nobody knows the message, it doesn't get handled, and you either get an error or not, depending on the syntax of the call. Beyond the basic requirement that handlers be targeted to the correct object reference, security features and 'visibility modifiers' are almost non-existent.

It was not until Director 6, with the introduction of 'drag and drop' sprite 'behaviors' that object-oriented Lingo became popular and widespread. These scripts are attached to sprite objects, extending them with additional properties and message handlers in a consistent fashion. Behaviors may also be configured on a 'per sprite' basis, which greatly reduces the need for the large quantities of almost identical scripts which plagued most projects made in earlier versions.

In Director 7, the various runtimes, authoring tools and browser plugins for the various platforms (Mac 68k, Windows16, Windows32, Mac PowerPC), having forked to an unacceptable level, were consolidated at the expense of support for the older processors. At the same time, the syntax was reworked to support 'dot syntax', i.e. 'object.property', which is more familiar to programmers in other popular languages, such as those in the C and Pascal family.

A rudimentary exception handling mechanism called 'the alertHook' was also introduced at this time, but it is practically useless because when invoked, it pops the call stack, with no way of re-entering the part of the system where the error occurred.

Very few and small changes have been introduced to the Lingo language since version 7, although the API was hugely expanded with the addition of a hardware accelerated 3D engine in version 8.5. Since then, it is notable that Macromedia's attention has focused on the more lucrative and popular MacromediaFlash tool whose scripting language, ActionScript, and authoring metaphor is significantly different. Each new iteration of Director offers improved Flash integration, which is clearly an attempt to cross market the two products.

At time of writing (Director MX / 9), verbose syntax is still supported, and dot syntax equivalents of a handful of features are still lacking. After loading the Flash runtime, it is now possible to manipulate the core Actionscript API, using such classes as math or XML from within Lingo, but most Lingo programmers would prefer to see these features strengthened and boosted within the core language because calls to the Flash API can have noticeable performance overheads.


CategoryProgrammingLanguage


EditText of this page (last edited June 21, 2005) or FindPage with title or text search