<<

.

John . Ousterhout Sun Microsystems Laboratories Scripting: Higher-

Cybersquare Programming for the 21st Century

Increases in speed and changes in the application mix are making scripting and more important for the applications of the future. Scripting languages differ from system programming languages in that they are designed for “gluing” applications together. They use typeless approaches to achieve a higher level of programming and more rapid application development than system programming languages.

or the past 15 years, a fundamental change has been ated with system programming languages and glued Foccurring in the way people write computer programs. together with scripting languages. However, several The change is a transition from system programming recent trends, such as faster machines, better - languages such as or C++ to scripting languages such ing languages, the increasing importance of graphical as or . Although many people are participat- user interfaces (GUIs) and component architectures, ing in the change, few realize that the change is occur- and the growth of the Internet, have greatly expanded ring and even fewer know why it is happening. This the applicability of scripting languages. These trends article explains why scripting languages will handle will continue over the next decade, with more and many of the programming tasks in the next century more new applications written entirely in scripting better than system programming languages. languages and system programming languages used Scripting languages are designed for different tasks primarily for creating components. than are system programming languages, and this leads to fundamental differences in the languages. SYSTEM PROGRAMMING LANGUAGES System programming languages were designed for To understand the differences between scripting lan- building structures and from scratch, guages and system programming languages, it is starting from the most primitive computer elements important to understand how system programming such as of memory. In contrast, scripting lan- languages evolved. System programming languages guages are designed for gluing: They assume the exis- were introduced as an alternative to assembly lan- tence of a set of powerful components and are guages. In assembly languages, virtually every aspect intended primarily for connecting components. System of the machine is reflected in the program. Each - programming languages are strongly typed to ment represents a single machine instruction and pro- manage complexity, while scripting languages are - grammers must deal with low-level details such as less to simplify connections among components and register allocation and procedure-calling sequences. provide rapid application development. As a result, it is difficult to write and maintain large Scripting languages and system programming lan- programs in assembly languages. guages are complementary, and most major comput- By the late 1950s, higher-level languages such as ing platforms since the 1960s have included both kinds Lisp, , and Algol began to appear. In these lan- of languages. The languages are typically used together guages, statements no longer correspond exactly to in component frameworks, where components are cre- machine instructions; a translates each state-

0018-9162/98/$10.00 © 1998 IEEE March 1998 23 .

Scripting languages ment in the source program into a sequence of solely by the way it is used, not by any initial promises. binary instructions. Over a series of - Modern are fundamentally typeless. Any assume that a tem programming languages evolved from in memory can hold any kind of value, such as collection of useful Algol, including PL/1, Pascal, C, C++, and Java. an integer, a floating-point number, a pointer, or an components already System programming languages are less efficient instruction. The meaning of a value is determined by exist in other than assembly languages but they allow appli- how it is used. If the program counter points a word cations to be developed much more quickly. As of memory then it is treated as an instruction; if a word languages. They are a result, system programming languages have is referenced by an integer add instruction, then it is intended not for almost completely replaced assembly languages treated as an integer; and so on. The same word can applications for the development of large applications. be used in different ways at different . from scratch but In contrast, today’ system programming languages Higher-level languages are strongly typed. For example: rather for combining System programming languages differ from components. assembly languages in two ways: they are higher • Each variable in a system programming level and they are strongly typed. The term must be declared with a particular type such as “higher level” means that many details are han- integer or pointer to string, and it must be used dled automatically, so can write in ways that are appropriate for the type. less code to get the same job done. For example: • Data and code are segregated; it is difficult if not impossible to create new code on the fly. • Register allocation is handled by the compiler so • Variables can be collected into structures or that programmers need not write code to objects with well-defined substructure and pro- between registers and memory. cedures or methods to manipulate them. An • Procedure calling sequences are generated auto- object of one type cannot be used where an object matically; programmers need not worry about of a different type is expected. moving arguments to and from the . • Programmers can use simple keywords such as Typing has several advantages. First, it makes large while and if for control structures; the com- programs more manageable by clarifying how things piler generates all the detailed instructions to are used and differentiating among things that must be implement the control structures. treated differently. Second, use type infor- mation to detect certain kinds of errors, such as an On average, each line of code in a system pro- attempt to use a floating-point value as a pointer. gramming language translates to about five machine Third, typing improves performance by allowing com- instructions, compared with one instruction per line in pilers to generate specialized code. For example, if a an assembly program. (In an informal analysis of eight compiler knows that a variable always holds an inte- C files written by five different people, I found that the ger value, then it can generate integer instructions to ratio ranged from three to seven instructions per line;1 manipulate the variable; if the compiler does not know in a study of numerous languages, Capers Jones found the type of a variable, then it must generate additional that, for a given task, assembly languages require three instructions to check the variable’s type at runtime. to six times as many lines of code as system program- Figure 1 compares a variety of languages on the ming languages.2) Programmers can write roughly the basis of their level of programming and strength of same number of lines of code per year regardless of typing. language,3 so system programming languages allow applications to be written much more quickly than SCRIPTING LANGUAGES assembly languages. Scripting languages such as Perl,4 Python,5 ,6 Tcl,7 , and the shells represent a very Typing different style of programming than do system pro- The second difference between assembly languages gramming languages. Scripting languages assume that and system programming languages is typing. I use a collection of useful components already exist in other the term typing to refer to the degree to which the languages. They are intended not for writing applica- meaning of information is specified in advance of its tions from scratch but rather for combining compo- use. In a strongly typed language, the nents. For example, Tcl and Visual Basic can be used declares how each piece of information will be used, to arrange collections of controls on the and the language prevents the information from being screen, and Unix scripts are used to assemble fil- used in any other way. In a weakly typed language, ter programs into pipelines. Scripting languages are there are no a priori restrictions on how information often used to extend the features of components; how- can be used; the meaning of information is determined ever, they are rarely used for complex algorithms and

24 Computer .

data structures, which are usually provided by the com- ponents. Scripting languages are sometimes referred to 1,000 as glue languages or system integration languages. Scripting Visual Basic Scripting languages are generally typeless To simplify the task of connecting components, scripting languages tend to be typeless. All things look 100 and behave the same so that they are interchangeable. Tcl/Perl For example, in Tcl or Visual Basic a variable can hold Java a string one moment and an integer the next. Code C++ and data are often interchangeable, so that a program can write another program and then execute it on the 10 C

fly. Scripting languages are often string-oriented, as Instruction/statement this provides a uniform representation for many dif- Assembly ferent things. System programming A typeless language makes it much easier to hook 1 together components. There are no a priori restrictions on how things can be used, and all components and None Strong values are represented in a uniform fashion. Thus any Degree of typing component or value can be used in any situation; com- ponents designed for one purpose can be used for This command creates a new button control that dis- Figure 1. A compari- totally different purposes never foreseen by the plays a text string in a 16-point Times font and prints son of various designer. For example, in the Unix shells all filter pro- a short message when the user clicks on the control. programming grams read a stream of bytes from an input and write The command mixes six different types of things in a languages based on a stream of bytes to an output. Any two programs can single statement: a command name (button), a but- their level (higher- be connected by attaching the output of one program ton control (.b), property names (-text, -font, and level languages exe- to the input of the other. The following shell command -command), simple strings (Hello! and hello), a cute more machine stacks three filters together to count the number of lines font name (Times 16) that includes a typeface name instructions for each in the selection that contain the word “scripting”: (Times) and a size in points (16), and a Tcl script language statement) (puts hello). Tcl represents all of these things uni- and their degree of select | grep scripting | wc formly with strings. In this example, the properties typing. System pro- can be specified in any order and unspecified proper- gramming languages The select program reads the text that is currently ties are given default values; more than 20 properties such as C tend to be selected on the display and prints the text on its out- were left unspecified in the example. strongly typed and put; the grep program reads its input and prints on The same example requires seven lines of code in medium level (five to its output the lines containing “scripting”; the wc pro- two methods when implemented in Java. With C++ 10 instructions per gram counts the number of lines on its input. Each of and Microsoft Foundation Classes (MFC), it requires statement). Scripting these programs can be used in numerous other situa- about 25 lines of code in three procedures.1 Just set- languages such as Tcl tions to perform different tasks. ting the font requires several lines of code in MFC: tend to be weakly The strongly typed nature of system programming typed and very high languages discourages reuse. It encourages program- CFont *fontPtr = new CFont(); level (100 to1,000 mers to create a variety of incompatible interfaces, each fontPtr->CreateFont(16, 0, 0, 0, 700, instructions per state- of which requires objects of specific types. The com- 0, 0, 0, ANSI_CHARSET, ment). piler prevents any other types of objects from being OUT_DEFAULT_PRECIS, used with the interface, even if that would be useful. So CLIP_DEFAULT_PRECIS, to use a new object with an existing interface, the pro- DEFAULT_QUALITY, grammer must write conversion code to translate DEFAULT_PITCH|FF_DONTCARE, between the type of the object and the type expected by “Times New Roman”); the interface. This in turn requires recompiling part or buttonPtr->SetFont(fontPtr); all of the application; many applications today are dis- tributed in binary so this is not possible. Much of this code is a consequence of the strong typ- To appreciate the advantages of a typeless language, ing. To set the font of a button, its SetFont method consider the following Tcl command: must be invoked, but this method must be passed a pointer to a CFont object. This in turn requires a new button .b -text Hello! -font {Times object to be declared and initialized. To initialize the 16} -command {puts hello} CFont object its CreateFont method must be

March 1998 25 .

invoked, but CreateFont has a rigid interface length strings in situations where a system programming It might seem that that requires 14 different arguments to be spec- language would use a binary value that fits in a single the typeless nature of ified. In Tcl, the essential characteristics of the machine word, and they use hash tables where system scripting languages font (typeface Times, size 16 points) can be used programming languages use indexed arrays. could allow errors to immediately with no declarations or conversions. Fortunately, the performance of a Furthermore, Tcl allows the button’s behavior is not usually a major issue. Applications for scripting go undetected, but in to be included directly in the command that cre- languages are generally smaller than applications for practice scripting ates the button, while C++ and Java require it to system programming languages, and the performance languages are just as be placed in a separately declared method. of a scripting application tends to be dominated by the safe as system (In practice, a trivial example like this would performance of the components, which are typically probably be handled with a graphical develop- implemented in a system . programming ment environment that hides the complexity of Scripting languages are higher level than system pro- languages. the underlying language. The user enters prop- gramming languages in the that a single state- erty values in a form and the development envi- ment does more work on average. A typical statement ronment outputs the code. However, in more in a scripting language executes hundreds or thou- complex situations, such as conditional assign- sands of machine instructions, whereas a typical state- ment of property values or interfaces generated pro- ment in a system programming language executes grammatically, the developer must write code in the about five machine instructions (as Figure 1 illus- underlying language.) trates). Part of this difference is because scripting lan- It might seem that the typeless nature of scripting lan- guages use interpreters, but much of the difference is guages could allow errors to go undetected, but in prac- because the primitive operations in scripting languages tice scripting languages are just as safe as system have greater functionality. For example, in Perl it is programming languages. For example, an error will about as easy to invoke a substitu- occur if the font size specified for the button example tion as it is to invoke an integer addition. In Tcl, a above is a noninteger string such as xyz. Scripting lan- variable can have traces associated with it so that set- guages do their error checking at the last possible ting the variable causes side effects; for example, a moment, when a value is used. Strong typing allows trace might be used to keep the variable’s value errors to be detected at compile time, so the cost of run- updated continuously on the screen. time checks is avoided. However, the price to be paid Scripting languages allow rapid development of glu- for efficiency is restrictions on how information can be ing-oriented applications. Table 1 provides anecdotal used; this results in more code and less flexible programs. support for this claim. It describes several applications that were implemented in a system programming lan- Scripting languages are interpreted guage and then reimplemented in a scripting language Another key difference between scripting languages or vice versa. In every case, the scripting version and system programming languages is that scripting lan- required less code and development time than the sys- guages are usually interpreted, whereas system pro- tem programming version; the difference varied from gramming languages are usually compiled. Interpreted a factor of two to a factor of 60. Scripting languages languages provide rapid turnaround during development provided less benefit when they were used for the first by eliminating compile times. Interpreters also implementation; this suggests that any reimplementa- applications more flexible by allowing users to program tion benefits substantially from the experiences of the the applications at runtime. For example, many synthe- first implementation and that the true difference sis and analysis tools for integrated circuits include a Tcl between scripting and system programming is more ; users of the programs write Tcl scripts to like a factor of five to 10, rather than the extreme specify their designs and control the operation of the points of the table. The benefits of scripting also tools. Interpreters also allow powerful effects to be depend on the application. In the last example in Table achieved by generating code on the fly. For example, a 1, the GUI part of the application is gluing-oriented Tcl-based can parse a Web page by trans- but the simulator part is not; this might explain why lating the HTML for the page into a Tcl script using a the application benefited less from scripting than other few regular expression substitutions. It then executes the applications. Tcl script to render the page on the screen. The information in the table was provided by vari- Scripting languages are less efficient than system pro- ous Tcl developers in response to an article posted on gramming languages, in part because they use inter- the .lang.tcl newsgroup.1 preters instead of compilers but also because their components are chosen for power and ease of use rather DIFFERENT TOOLS FOR DIFFERENT TASKS than an efficient mapping onto the underlying hardware. A scripting language is not a replacement for a sys- For example, scripting languages often use variable- tem programming language or vice versa. Each is

26 Computer .

Table 1. Comparing applications implemented in both system programming languages and scripting languages.

Application (contributor) Comparison Code ratio* Effort ratio** Comments

Database application C++ version: 2 months 60 C++ version (Ken Corey) Tcl version: 1 day implemented first; Tcl version had more functionality Computer system test and installation C test application: 47 22 C version implemented first; (Andy Belsey) 272,000 lines, 120 months Tcl/Perl version replaced both C FIS application: 90,000 lines, C applications 60 months Tcl/Perl version: 7,700 lines, 8 months C++ version: 2-3 months 8-12 C++ version implemented first (Ken Corey) Tcl version: 1 week Security scanner C version: 3,000 lines 10 C version implemented first; (Jim Graham) Tcl version: 300 lines Tcl version had more functionality Display oil well production curves C version: 3 months 6 Tcl version implemented first (Dan Schenck) Tcl version: 2 weeks Query dispatcher C version: 1,200 lines, 4-8 weeks 2.5 4-8 C version implemented first, (Paul Healy) Tcl version: 500 lines, 1 week uncommented; Tcl version had comments, more functionality tool C version: 1,460 lines 4 Tcl version implemented first Tcl version: 380 lines Simulator and GUI Java version: 3,400 lines, 3-4 weeks 2 3-4 Tcl version had 10 to 20 percent (Randy Wang) Tcl version: 1,600 lines, <1 week more functionality and was implemented first

* Code ratio is the ratio of lines of code for the two implementations (<1 means the system programming language required more lines). ** Effort ratio is the ratio of development times. In most cases the two versions were implemented by different people.

suited to a different set of tasks. For gluing and system tion. On the other hand, affirmative answers to the integration, applications can be developed five to 10 following questions suggest that an application is bet- times faster with a scripting language; system pro- ter suited to a system programming language: gramming languages require large amounts of boiler- plate and conversion code to connect the pieces, • Does the application implement complex - whereas this can be done directly with a scripting lan- rithms or data structures? guage. For complex algorithms and data structures, • Does the application manipulate large datasets, the strong typing of a system programming language for example, all the pixels in an image, such that makes programs easier to manage. Where execution speed is critical? speed is key, a system programming language can • Are the application’s functions well defined and often run 10 to 20 times faster than a scripting lan- slow to change? guage because it makes fewer runtime checks. In deciding whether to use a scripting language or Most of the major computing platforms over the a system programming language for a particular task, past 30 years have provided both system program- consider the following questions: ming and scripting languages. For example, one of the first scripting languages, albeit a crude one, was Job • Is the application’s main task to connect preex- (JCL), which was used to sequence isting components? job steps in OS/360. The individual job steps were • Will the application manipulate a variety of dif- written in PL/1, Fortran, or assembler languages, ferent things? which were the system programming languages of the • Does the application include a GUI? day. In the Unix machines of the 1980s, C was used for • Does the application do a lot of string manipulation? system programming and shell programs such as sh • Will the application’s functions evolve rapidly and csh for scripting. In the PC world of the 1990s, over time? C and C++ are used for system programming and • Does the application need to be extensible? Visual Basic for scripting. In the Internet world that is taking shape now, Java is used for system program- Affirmative answers to these questions suggest that ming and languages such as JavaScript, Perl, and Tcl a scripting language will work well for the applica- are used for scripting.

March 1998 27 .

Scripting and system Scripting and system programming are sym- Perl has become popular for writing CGI scripts and biotic. Used together, they produce program- JavaScript is popular for scripting in Web pages. programming are ming environments of exceptional power. symbiotic. Used System programming languages are used to cre- Component frameworks together, they ate exciting components that can then be assem- The third example of scripting-oriented applications produce bled using scripting languages. For example, is component frameworks such as ActiveX and Java- much of the attraction of Visual Basic is that Beans. Although system programming languages programming system programmers can write ActiveX com- work well for creating components, the task of assem- environments of ponents in C and less sophisticated program- bling components into applications is better suited to exceptional power. mers can then use the components in Visual scripting. Without a good scripting language to Basic applications. In Unix it is easy to write manipulate the components, much of the power of a shell scripts that invoke applications written in component framework is lost. This might explain in C. One of the reasons for the popularity of Tcl part why component frameworks have been more suc- is the ability to extend the language by writing C code cessful on PCs, where Visual Basic provides a conve- that implements new commands. nient scripting tool, than on other platforms such as Unix/CORBA, where scripting is not included in the SCRIPTING IS ON THE RISE component framework. Scripting languages have existed for a long time, but in recent years several factors have combined to Better scripting technology increase their importance. The most important factor Another reason for the increasing popularity of is a shift in the application mix toward gluing appli- scripting languages is improvements in scripting tech- cations. Three examples of this shift are GUIs, the nology. Modern scripting languages such as Tcl and Internet, and component frameworks. Perl are a far cry from early scripting languages such as JCL. For example, JCL did not even provide basic iter- Graphical user interfaces ation and early Unix shells did not support procedures. GUIs first appeared in the early 1980s and became Scripting technology is still relatively immature even widespread by the end of the decade; GUIs now today. For example, Visual Basic is not really a script- account for half or more of the total effort in many ing language; it was originally implemented as a simple programming projects. GUIs are fundamentally gluing system programming language, then modified to make applications. The goal is not to create new - it more suitable for scripting. Future scripting languages ality but to make connections between a collection of will be even better than those available today. graphical controls and the internal functions of the Scripting technology has also benefited from the application. everincreasing speed of . It used I am not aware of any rapid-development environ- to be that the only way to get acceptable performance ments for GUIs based on a system programming lan- in an application of any complexity was to use a sys- guage. Whether the environment is Windows, Mac- tem programming language. In some cases, even sys- intosh Toolbox, or Unix Motif, GUI toolkits based on tem programming languages were not efficient languages such as C or C++ have proven hard to learn, enough, so the applications had to be written in assem- clumsy to use, and inflexible in the results they produce. bler. However, machines today are 100 to 500 times Some of these systems have nice graphical tools for faster than the machines of 1980, and performance designing screen layouts that hide the underlying lan- doubles every 18 months. Today, many applications guage, but things become difficult as soon as the designer can be implemented in an interpreted language and has to write code, for example, to provide the behav- still have excellent performance. For example, a Tcl iors for the interface elements. All of the best rapid-devel- script can manipulate collections with several thou- opment GUI environments are based on scripting sand objects and still provide good interactive languages: Visual Basic, HyperCard, and Tcl/. response. As computers get faster, scripting will become attractive for larger and larger applications. Internet The growth of the Internet has also popularized Casual programmers scripting languages. The Internet is nothing more than One final reason for the increasing use of scripting a gluing tool. It does not create any new computations languages is a change in the programmer community. or data; it simply makes a huge number of existing Twenty years ago, most programmers were sophisti- things easily accessible. The ideal language for most cated programmers working on large projects. Pro- Internet programming tasks is one that makes it pos- grammers of that era expected to spend several sible for all the connected components to work months to master a language and its programming together; that is, a scripting language. For example, environment, and system programming languages

28 Computer .

were designed for such programmers. However, since OO programming does not provide a large Implementation the arrival of the PC more and more casual program- improvement in productivity because it neither mers have joined the programmer community. For raises the level of programming nor encourages inheritance causes these people, programming is not their main job func- reuse. In an OO language such as C++, pro- the same tion; it is a tool they use occasionally to help with their grammers still work with basic units that intertwining and main job. Examples of casual programming are sim- must be described and manipulated in great brittleness that have ple database queries or macros for a spreadsheet. detail. In principle, powerful library packages Casual programmers are unwilling to spend months could be developed, and if these libraries were been observed when learning a system programming language, but they can used extensively they could raise the level of pro- statements are often learn enough about a scripting language in a few gramming. However, few such libraries exist. overused. As a hours to write useful programs. Scripting languages The strong typing of most OO languages encour- are easier to learn because they have simpler syntax ages narrowly defined packages that are hard to result, OO systems than system programming languages and they omit reuse. Each package requires objects of a specific often suffer from complex features like objects and threads. For exam- type; if two packages are to work together, con- complexity and lack ple, compare Visual Basic with Visual C++; few casual version code must be written to translate of reuse. programmers would attempt to use Visual C++, but between the types required by the packages. many have built useful applications with Visual Basic. Another problem with OO languages is their Even today, the number of applications written in emphasis on inheritance. Implementation inher- scripting languages is much greater than the number itance, in which one class borrows code that was writ- of applications written in system programming lan- ten for another class, is a bad idea that makes software guages. On Unix systems, there are many more shell harder to manage and reuse. It binds the implementa- scripts than C programs, and under Windows there tions of classes together so that neither class can be are many more Visual Basic programs and applica- understood without the other. A subclass cannot be tions than C or C++. Of course, most of the largest understood without knowing how the inherited meth- and most widely used applications are written in sys- ods are implemented in its superclass, and a superclass tem programming languages, so a comparison on the cannot be understood without knowing how its meth- basis of total lines of code or number of installed ods are inherited in subclasses. In a complex class hier- copies might still favor system programming lan- archy, no individual class can be understood without guages. Nonetheless, scripting languages are already understanding all the other classes in the hierarchy. Even a major force in application development and their worse, a class cannot be separated from its hierarchy market share will increase in the future. for reuse. Multiple inheritance makes these problems even worse. Implementation inheritance causes the same THE ROLE OF OBJECTS intertwining and brittleness that have been observed Scripting languages have been mostly overlooked when goto statements are overused. As a result, OO by experts in programming languages and software systems often suffer from complexity and lack of reuse. engineering. Instead, the experts have focused their Scripting languages, on the other hand, have actu- attention on object-oriented system programming lan- ally generated significant software reuse. The model guages such as C++ and Java. Object-oriented (OO) they follow is one in which interesting components programming is widely believed to represent the next are built in a system programming language and then major step in the evolution of programming lan- glued together into applications with a scripting lan- guages. OO features such as strong typing and inher- guage. This division of labor provides a natural frame- itance are often claimed to reduce development time, work for reusability. Components are designed to be increase software reuse, and solve many other prob- reusable, and there are well-defined interfaces between lems including those addressed by scripting languages. components and scripts that make it easy to use com- How much benefit has OO programming actually ponents. For example, in Tcl the components are cus- provided? Unfortunately I have not seen enough quan- tom commands implemented in C; they look just like titative data to answer this question definitively. In my the built-in commands so they are easy to invoke in opinion, objects provide only a modest benefit: perhaps Tcl scripts. In Visual Basic, the components are a 20 to 30 percent improvement in productivity but cer- ActiveX extensions, which can be used by dragging tainly not a factor of two, let alone a factor of 10. C++ them from a palette onto a form. now seems to be reviled as much as it is loved, and some Nonetheless, OO programming does provide at least language experts are beginning to speak out against two useful features. The first is encapsulation: objects OO programming.8 Objects do not improve produc- combine data and code in a way that hides implemen- tivity in the dramatic way that scripting does, and the tation details. This makes it easier to manage large sys- benefits of OO programming can be achieved in script- tems. The second useful feature is interface inheritance, ing languages. where classes provide the same methods and applica-

March 1998 29 .

Raising the level of tion programming interfaces () even though I hope the programming language research community they have different implementations. This makes will shift some of its attention to scripting languages and programming should the classes interchangeable and encourages reuse. help develop even more powerful scripting languages. be the single most Fortunately, the benefits of objects can be Raising the level of programming should be the single important goal for achieved in scripting languages as well as sys- most important goal for language designers, as it has language designers, tem programming languages, and virtually all the greatest effect on programmer productivity. It is not scripting languages have some support for OO clear that strong typing contributes to this goal. ❖ as it has the programming. For example, Python is an OO greatest effect on scripting language; Perl v5 includes support for Acknowledgments programmer objects; Object Rexx is an OO version of Rexx; and is an OO extension to Tcl. One This article has benefited from many people’s com- productivity. It is difference is that objects in scripting languages ments, including Joel Bartlett, Bill Eldridge, Jeffrey not clear that strong tend to be typeless, while objects in system pro- Haemer, Mark Harrison, Paul McJones, David typing contributes gramming languages tend to be strongly typed. Patterson, Stephen Uhler, Hank Walker, Chris Wright, to this goal. the Computer referees, and dozens of others who par- OTHER LANGUAGES ticipated in a heated -news discussion of an early This article is not intended as a complete draft. Colin Stevens wrote the MFC version of the but- characterization of all programming languages. ton example and Stephen Uhler wrote the Java version. There are many other attributes of programming lan- guages besides strength of typing and the level of pro- gramming, and there are many interesting languages References that cannot be characterized cleanly as a system pro- 1. J. Ousterhout, “Additional Information for Scripting gramming language or a scripting language. For exam- White Paper,” http://www.scriptics.com/people/john. ple, the Lisp family of languages lies somewhere ousterhout/scriptextra.. between scripting and system programming, with 2. C. Jones, “Programming Languages Table, Release 8.2,” some of the attributes of each. Lisp pioneered con- Mar. 1996, http://www.spr.com/library/0langtbl.htm. cepts such as interpretation and dynamic typing that 3. B. Boehm, Economics, Prentice are now common in scripting languages, as well as Hall, Englewood Cliffs, N.J., 1981. automatic storage management and integrated devel- 4. L. Wall, . Christiansen, and . Schwartz, Programming Perl, opment environments, which are now used in both 2nd ed., O’Reilly & Associates, Sebastopol, Calif., 1996. scripting and system programming languages. 5. M. Lutz, Programming Python, O’Reilly & Associates, Sebastopol, Calif., 1996. cripting languages represent a different set of 6. R. O’Hara and . Gomberg, Modern Programming trade-offs than system programming languages. Using REXX, Prentice Hall, Englewood Cliffs, N.J., 1988. S They give up execution speed and strength of typ- 7. J. Ousterhout, Tcl and the Tk Toolkit, Addison-Wesley, ing relative to system programming languages but pro- Reading, Mass., 1994. vide significantly higher programmer productivity and 8. S. Johnson, “Objecting To Objects,” Invited Talk, Usenix software reuse. This trade-off makes more and more Technical Conf., San Francisco, Jan. 1994. sense as computers become faster and cheaper in com- parison to programmers. System programming lan- John K. Ousterhout is the CEO of Scriptics Corp. He guages are well suited to building components where was previously a Distinguished Engineer at Sun the complexity is in the data structures and algorithms, Microsystems Inc., where the work for this article while scripting languages are well suited for gluing was carried out. His interests include scripting lan- applications where the complexity is in the connec- guages, Internet programming, user interfaces, and tions. Gluing tasks are becoming more and more operating systems. He created the Tcl scripting lan- prevalent, so scripting will become an increasingly guage and the Tk toolkit. He received a BS in physics important in the next century. from Yale University and a PhD in I hope this article will impact the computing com- from Carnegie Mellon University. Ousterhout is a fel- munity in three ways. First, I hope programmers will low of the Association for Computing Machinery and consider the differences between scripting and system has received many awards, including the ACM Grace programming when starting new projects and choose Murray Hopper Award, the US National Science the most powerful tool for each task. Second, I hope Foundation Presidential Young Investigator Award, designers of component frameworks will recognize the and the University of California at Berkeley importance of scripting and ensure that their frame- Distinguished Teaching Award. works include not only facilities for creating compo- nents but also facilities for gluing them together. Finally, Contact Ousterhout at [email protected].

30 Computer