Lingo (programming language)
Lingo is a verbose object-oriented (OO) scripting language developed by John H. Thompson for use in Adobe Director (formerly Macromedia Director). Lingo is used to develop desktop application software, interactive kiosks, CD-ROMs and Adobe Shockwave content.[1][2]
Lingo is the primary programming language on the Adobe Shockwave platform, which dominated the interactive multimedia product market during the 1990s.[3] Various graphic adventure games were developed with Lingo during the 1990s, including The Journeyman Project, Total Distortion, Mia's Language Adventure, Mia's Science Adventure, and the Didi & Ditto series. Hundreds of free online video games were developed using Lingo, and published on websites such as Miniclip and Shockwave.com.
Lingo can be used to build user interfaces, to manipulate raster graphics, vector graphics and 3D computer graphics, and other data processing tasks.[4][5] Lingo supports specialized syntax for image processing and 3D object manipulation.[6] 3D meshes can also be created on the fly using Lingo.[6]
History
Lingo was invented by John H. Thompson at MacroMind in 1989, and first released with Director 2.2. Jeff Tanner developed and tested Lingo for Director 2.2 and 3.0, created custom XObjects for various media device producers, language extension examples using XFactory including the XFactory application programming interface (API), and wrote the initial tutorials on how to use Lingo. Dave Shields tested and documented Object-based Lingo for Director 3.13 and 4.0. He ran build scripts to create weekly releases for testing, originated the Macromedia KnowledgeBase, created examples of how to write Lingo XTRA plug-ins in C++, and assembled the Golden Master disks of Macromedia Director that were shipped to the duplicator.
Lingo was quickly adopted by burgeoning multimedia community during the 1990s and the already popular Director product. Initially, about 90% of the users only used 10% of Lingo's features; primarily go to the frame
by multimedia authors of tutorials and presentations. However, 10% of the users were game developers who took a wider interest in the other 90% of its abilities, including their own function extensions by creating their own XFactories/XObjects. The Journeyman Project is a prominent example of this.
Features
Lingo is embedded into Adobe Director, and can be added as scripts on objects or on the timeline. Lingo is an object-oriented programming (OOP) language, and supports Smalltalk-like verbose syntax, OO dot syntax, and inheritance.
Verbose syntax
When Lingo was created, a verbose syntax was designed to mimic spoken language, so it would be easy for new users. Users could write HyperTalk-like sentences such as:
if the visibility of sprite 5 then go to the frame
In go to statements, the "to" is optional, and unlike other programming languages, go statements reference frames in Director's Score, not specific code lines.
Lingo was also initially very robust by providing object generation through a notion called factory
, which led to the language's extensibility through External Factories (XFactories) or XObjects. For Director 3.13 and later versions, extensibility occurred via a different type of plug-in called an XTRA, based upon the Microsoft Component Object Model (COM).
Dot syntax
Although it is still possible to use the verbose syntax, the current version of the language fully supports OO dot syntax, so that the code looks more like standard programming languages such as JavaScript or C++.
The equivalent in new scripting style would be:
if sprite(5).visible then _movie.go(_movie.frame)
This format uses elements of the Director Object Model, introduced in Director MX 2004. The syntax in prior versions would be like:
if sprite(5).visible then go the frame
Scripting
There are 4 types of Lingo scripts in Director, each with a specific purpose. Each type of script may be added to certain types of compatible objects.
- Cast scripts work only with their member, not all events can be used with them.
- Behavior scripts are attached to a sprite or inserted into a frame. Sprite behaviors are often used to give control of the sprite's properties and movement. Frame behaviors can be used to create a pause or delay within a certain frame in the score. Behaviors make it easy to program in an object-oriented way, as you can directly see the relationship between the programming and the item they are attached to. They can also control or interact with other sprites, making them a true object.
- Movie scripts are not attached to sprites nor can they be instantiated as Objects. They are available throughout the program (movie) and are especially useful for holding global handlers and initializing global variables at the start or end of the movie.
- Parent scripts are used to birth (create instances of) an object into a variable using the new command. These objects can control sprites and other media remotely, without being attached to any one sprite, may be used to control data or other non-displayed items, and are useful for recursion routines such as pathfinding. A Parent script can be used to create or destroy an object at any time, freeing them from the confines of the score that a Behavior is limited to.
Behavior and parent scripts encourage good object-oriented programming. Movie scripts are not as OOP-oriented. However, they can still be used to make black-box handlers, where other objects can input raw data and receive answers back, without knowing the inner workings of the box. Using the strengths and ease-of-use of Director's programming methodology, with the advantages of OOP makes for a powerful and fast programming environment.
Inheritance
Lingo supports object inheritance by a slightly idiosyncratic system: a script can have an ancestor
property which references another object (usually also a script, although other objects such as cast members can also be ancestors). Properties and methods of the ancestor are inherited by the parent. Behavior scripts are also a kind of ancestor of the sprites to which they are attached, since properties and methods of the behavior can be accessed by reference to the sprite itself. In this case, it is a kind of multiple inheritance, as one sprite may have several behaviors.
Extensibility
XObjects
Lingo 3.0 was also extensible through External Factories (XFactories) or XObjects (later replaced by Lingo Xtras), which provided programmatic extensions to Director. For example, controlling external media devices such as CD-ROM and Video tape players through Macintosh SerialPort. XObject API was openly available to developers and media device producers, which added to the popularity and versatility of Lingo. Macromind was very active in positioning the XObject API as standard for external media devices to collaborate through Lingo; and its interest as a standard achieved a lot of involvement from prominent and burgeoning media product companies through an ad hoc group called the Multimedia Association.
Xtras
Starting with Director version 4.0, Lingo was extensible through a new improved class of external plugin called Xtras. Xtras were developed in C++ using the Microsoft Component Object Model (COM). The standardization with COM helped attract developers to creating a market for such plug-ins.
Imaging Lingo
Imaging Lingo was introduced with Director 8.0, and allowed developers to write high-performance image manipulation commands using a simple syntax. There are some similarities to functions of image applications (like Photoshop), that make it easy to create dynamic, code-based visual effects. Image manipulation was also added into ActionScript 3.0 with the BitmapData class. As this included more sophisticated commands, Director was also updated to allow conversion between the BitmapData object and its own Image objects.
3D
Director 8.5 introduced a DirectX 3D engine that could be scripted with Lingo. Lingo was updated substantially to support the new 3D objects and now includes a full-featured set of 3D commands. An Xtra was also created to enable use of the Havok 3D Physics engine, and later the AGEIA PhysX engine, in Director 11.
Other languages
These other languages are perhaps not as well known as the Macromedia language. However, a legal anomaly remains in the UK that the trademark of the word 'Lingo' is held by Linn Smart Computing.
- A language called Lingo was released for software development under Windows. This version was designed as a compilable high level programming language.
- A programming language based on Smalltalk was developed for the Rekursiv processor developed by Linn Smart Computing in Scotland, UK. This language was named Lingo[7] and is significant because its makers successfully obtained a trademark in the UK.
- LINGO is also a programming language for solving linear, nonlinear and integer optimization problems, first developed in 1988 by LINDO Systems Inc. This language is still in production.
References
- Macromedia Shockwave for Director User's Guide, Volume 1, New Riders Pub., 01-Jan-1996
- Macromedia Shockwave for Director, Volume 1, Hayden Books, 1996
- Kelly Hart; Mitch Geller (2008). New Perspectives on Dreamweaver CS3, Comprehensive. Cengage Learning. p. 429. ISBN 1-4239-2531-9.
- Macromedia Director 8: Creating Powerful Multimedia, Prentice Hall, 2001
- Inside Macromedia Director 6 with Lingo, New Riders Pub., 01-Jan-1997
- Macromedia Director 8.5 Shockwave Studio for 3D: Training from the Source, Macromedia Press, 2002
- "Rekursiv Project - Lingo Language". June 7, 2007. Archived from the original on 7 June 2007.
External links
- Official website, at Adobe.com, Director Support Center