myers mitsw96.pdf

Transcript

1 A LSO : A Language for Extensible Multi-user Systems Andrew C. Myers [email protected] MIT Laboratory for Computer Science A LSO is currently executed by a fairly fast interpreter 1 Introduction (about as fast as Perl), but the execution model is compatible is designed to support safely extensible The language A LSO operator eval with compilation. In particular, it has an multi-user servers. It was originally designed for writing that, like the same operator in Scheme and Lisp, explicitly MUD servers (programmable multi-user virtual worlds), but compiles program text into code. Only eval can add new it is also applicable to other servers. For example, it provides code to a running server. much of the key functionality of languages like Safe-Tcl This section has discussed similarities between A LSO exible MUD and JavaScript. A LSO supports even more fl and some popular programming languages. Now we will systems than MOO [1], and can be used to implement other consider some differences. LSO contains kinds of servers too (e.g., HTTP, SMTP). A several uncommon or unique features that make it easier to safely extend a running system. This note provides an 3 Identi fi ers overview and rationale for A LSO ’ S design. More details are Most interpreted languages (e.g., Scheme, Tcl) have a read- server can be experimented LSO available [2]. A running A fi loop that inserts identi eval-print er bindings into a global with at . telnet://also.lcs.mit.edu:4201 namespace. A global namespace is inappropriate for a multi- user system, since it leads to name clashes — users may want 2 Overview different names for the same objects, or the same names for is designed to be familiar in those areas where being A LSO different objects. An extreme example is users who speak different yields no bene t. For example, its syntax is fi different languages, but the A model provides support for LSO similar to that of C++ and Java, though there are some even this case. compatible extensions (e.g., semicolons are optional and it , each user (in fact, each separate invocation LSO In A rst-class gcc supports LSO -like block expressions). A has fi of eval ) can supply their own naming environment for lambda expressions and lexical scoping, but functions can be ers in code. This environment is then fi interpreting identi conveniently declared in a C-like syntax. The language is ers. used consistently for interpreting and reporting identi fi not statically typed. Functions may return multiple results, The naming environment can be an object that performs and may return either normally or with an exception. The fi ers, which arbitrarily complex computation to locate identi following example is the Fibonacci function: provides a powerful hook into the workings of the compiler. fi ( b(x) Since A is designed for extensible systems, it is always LSO if (x 0) fail(range error, x) possible to examine compiled code (i.e., function values) in 2) 1 if (x sprint operator. This operator can source form, using the b(x fi else 2) fi 1) b(x ers consistent with the user’s fi report the code using identi ) naming environment, which is possible because compiled Computation is typically performed on objects. Like code contains a precis of the naming environment used to S ELF [3], A LSO has prototype-based inheritance; that is, compile it. An inverse naming environment, supplied to sprint ers mentioned in fi , then can be used to back-map identi objects inherit directly from other objects. Typically, or template objects fi ll the role of classes in class- exemplar the precis. based systems. Objects can contain references to each other, There are limitations to customized name environments,of and are stored in a garbage-collected heap. course. Because A LSO is lexically scoped, local variables are not mapped using the compilation environment. However, Andrew Myers is supported in part by ARPA contract N00014-91-J-4136. http://www.pmg.lcs.mit.edu/ ̃andru Web: there is no ambiguity of interpretation in this case. 1

2 4 Transactions by a closure. For example, the following code implements value , that and incr a module with two public procedures, LSO server Requests for different users are processed by an A access an internal counter: in separate, serializable transactions, so they do not interfere with one another. A allows nested transactions, where LSO counter is ( var cnt 0 // private! the failure of an inner transaction does not necessarily affect new ( the containing transaction. Transactions are integrated with 1), incr() cnt (cnt ” try exceptions in a convenient and unobtrusive manner. The “ value() cnt statement may be used to execute any block of code within a ) will attempt to try (x = 1/0) nested transaction. For example, ) divide 1 by 0. Since the containedcode will terminate with an uncaught exception ( ), the transaction has no divide-by-zero new expression, which is bound to the result of the counter effect except to return any values attached to the exception. uses cnt from the same scope. External code can access cnt Since run-timeerrorsand access controlfailures are treated counter.value() counter.incr() only through and . Evolution as exceptions, this model makes it easier to run code that may of the system is then supported by the mutability of counter contain bugs. If the code encounters an unexpected run-time (subject to access control constraints). error, it will generate an exception that terminates the current transaction. Running this code is therefore less likely to 6 Queries ed or inconsistent state. leave objects in a partially-modi fi invertible A LSO supports a simple query model in the form of Transactions provide an additional level of con dence about fi . If a property key is designated as invertible, then properties importing untrusted or possibly buggy code. nd all objects that map ? ” operator may be used to fi the “ In MUDs, other users routinely extend the system by that key to a particular value. Common object properties adding new code that provides behavior for items in the like location, type, and owner are usually invertible. For virtual world. Interacting with these items often causes one owner?andru example, the expression would produce a list to invoke the code, often at unexpected times. Transactions andru . Querying is fast, because of all objects owned by are particularly helpful in this situation, but no other MUD the current A implementation precomputes all query LSO language supports nested transactions. Transactions may be results, incrementally updating its tables as assignments are helpful for extensible web servers, too. performed to invertible properties. This simple query model has greatly simpli ed existing fi 5 Objects code because it supports one-to-many relationships. For fi example, MUD systems often nd all objects in a particular , objects are very LSO As the only mutable data type in A location, or all objects of a particular type. Generally important for programming. However, the object model these two particular requests are hard-coded into the system, has some unusual features. In virtually all object-oriented ? denying wider use of the functionality. The “ ” operator languages, an object is a map from symbols to values. An cient. fi makes this kind of request robust and ef object (or class) is a local namespace, and symbols are used to look up methods and instance variables. To satisfy the 7 Future Work goals of Section 3, A LSO takes a unique approach: Objects ers used to name fi map from values to values. The identi A LSO provides several uncommon or even unique features components of an object may vary from user to user, so that are well-integrated and aid writing robust code in a objects do not impose a namespace on their users. In multi-user environment. However, more work is required addition, since objects are implemented as hash tables, they for wider acceptance of A LSO . The access control model conveniently supersede arrays, associative arrays, and sets. ned, and performance, while not bad, is currently being re fi An object is a collection of mutable properties , which are fl is being improved by the addition of on-the- y compilation. key/value pairs. A property key may have any type; typically, A good debugger and an integrated GUI toolkit such as Tk property keys are themselves objects. The compilation would also help. environment contains the user’s mappings from identi fi ers to ers fi property keys, so different users may use different identi References to access the same properties. When a property key is an Curtis. . Available at LambdaMOO Programmer’s Manual [1] Pavel object, other information may be associated with it, such as , May 1996. ftp://parcftp.xerox.com.edu/pub/MOO documentation or an ACL. LSO [2] Andrew C. Myers. A . Available at : The Language ftp://ftp.pmg.lcs.mit.edu/pub/also/- Objects can also be used to implement modules: encap- , March 1994. manual.ps.gz sulated implementations that provide a public interface. The [3] David Ungar and Randall B. Smith. S ELF : The power of simplicity. In public interface is accessed through properties, whereas pri- OOPSLA ’87 Conference Proceedings , October 1987. fi ers are stored in local variables captured vate module identi 2

Related documents

COMM 750 Network S Directory   508

COMM 750 Network S Directory 508

SM Provider Directory – Blue Network S UPDATED SEPTEMBER 2016

More info »
9780199554232_000i-00ii_Sodhi_Biology_color_Htitle 1..2

9780199554232_000i-00ii_Sodhi_Biology_color_Htitle 1..2

1 Conservation Biology for All EDITED BY : Navjot S. Sodhi AND * Department of Department of Biological Sciences, National University of Singapore Organismic and Evolutionary Biology, Harvard Universi...

More info »
Best Practices Handbook for the Collection and Use of Solar Resource Data for Solar Energy Applications

Best Practices Handbook for the Collection and Use of Solar Resource Data for Solar Energy Applications

Best Practices Handbook for the Collection and Use of Solar Resource Data for Solar Energy Applications 1 1 1 1 2 A. Dobos, S. , Wilbert, A. Habte, S. Kurtz, M. Sengupta 3 6 4 7 5 T. ard, D. Myers, C....

More info »
CDIR 2018 07 27

CDIR 2018 07 27

S. Pub. 115-7 2017-2018 Official Congressional Directory 115th Congress Convened January 3, 2017 JOINT COMMITTEE ON PRINTING UNITED STATES CONGRESS UNITED STATES GOVERNMENT PUBLISHING OFFICE WASHINGTO...

More info »
CityNT2019TentRoll 1

CityNT2019TentRoll 1

STATE OF NEW YORK 2 0 1 9 T E N T A T I V E A S S E S S M E N T R O L L PAGE 1 VALUATION DATE-JUL 01, 2018 COUNTY - Niagara T A X A B L E SECTION OF THE ROLL - 1 CITY - North Tonawanda TAX MAP NUMBER ...

More info »
Put Yourself in My Shoes

Put Yourself in My Shoes

Masthead Logo Th o w a R e v ie w e I Volume 3 Article 29 a ll Issue 4 F 1972 Put Y f in M y S ho es oursel arve r Raymond C Follow this and additional works at: https://ir .uiowa.edu/iowareview Part ...

More info »
Command Plan

Command Plan

History of the Unified Command Plan 1946–2012 Edward J. Drea Ronald H. Cole Walter S. Poole James F. Schnabel Robert J. Watson Willard J. Webb Joint History Office Office of the Chairman of the Joint ...

More info »
Why Don't I Look Like Her? The Impact of Social Media on Female Body Image

Why Don't I Look Like Her? The Impact of Social Media on Female Body Image

Clarem ont C olle ges ars larem p @ C hol ont hi Sc CMC Student Scholarship ses CMC Senior The 2013 Why Don't I Look Like Her? The Impact of Social Media on Female Body Image Kendyl M. Klein Claremont...

More info »
u7112 connectplus directories 2019

u7112 connectplus directories 2019

UCare Connect + Medicare Provider and Pharmacy Directory Introduction This Provider and Pharmacy Directory includes information about the provider and pharmacy types in UCare Connect + Medicare and li...

More info »
U7112 UCARE CONNECT + MEDICARE PROVIDERDIR MAY 2019 DATA.sv

U7112 UCARE CONNECT + MEDICARE PROVIDERDIR MAY 2019 DATA.sv

UCare Connect + Medicare Provider and Pharmacy Directory Introduction This Provider and Pharmacy Directory includes information about the provider and pharmacy types in UCare Connect + Medicare and li...

More info »
08 861 Free Enterprise Fund v. Public Company Accounting Oversight Bd. (06/28/2010)

08 861 Free Enterprise Fund v. Public Company Accounting Oversight Bd. (06/28/2010)

1 (Slip i o n ) OCTOBER T ERM, 20 09 Opin llabu s Sy TE O er e it i s feas ibl e , a s y llab u s (h ead n ot e) wil l be rel e as ed , as is : N Wh e ti o e d con n ecti on with th is cas e , a t th ...

More info »
The 9/11 Commission Report

The 9/11 Commission Report

Final FM.1pp 7/17/04 5:25 PM Page i THE 9/11 COMMISSION REPORT

More info »
wp16

wp16

® EvaluatePharma World Preview 2016, Outlook to 2022 9th Edition – September 2016

More info »
tc 2019 84

tc 2019 84

The Cryosphere Discuss., https://doi.org/10.5194/tc-2019-84 Manuscript under review for journal The Cryosphere Discussion started: 2 May 2019 c Author(s) 2019. CC BY 4.0 License. © Drivers for Atlanti...

More info »
Helping Students Navigate the Path to College: What High Schools Can Do

Helping Students Navigate the Path to College: What High Schools Can Do

IES PRACTICE GUIDE WHAT WORKS CLEARINGHOUSE Helping Students Navigate the Path Helping Students Navigate the Path to College: What High Schools Can Do to College: What High Schools Can Do NCEE 2009-40...

More info »
oldnew 11.dvi

oldnew 11.dvi

C ́edric Villani O ptimal transport, old and new June 13, 2008 Springer Berlin Heidelberg NewYork Hong Kong London Milan Paris Tokyo

More info »
Managing the Risks of Extreme Events and Disasters to Advance Climate Change Adaptation

Managing the Risks of Extreme Events and Disasters to Advance Climate Change Adaptation

MANAGING THE RISKS OF EXTREME EVENTS AND DISASTERS TO ADVANCE CLIMATE CHANGE ADAPTATION SPECIAL REPORT OF THE INTERGOVERNMENTAL PANEL ON CLIMATE CHANGE

More info »
Cover Front FINAL DRAFT.pdf

Cover Front FINAL DRAFT.pdf

Pennsylvania Autonomous Vehicle Testing Policy: Final Draft Report of the Autonomous Vehicle Policy Task Force November 2, 2016

More info »
Urban Charter School Study Report on 41 Regions

Urban Charter School Study Report on 41 Regions

Urban Charter School Study Report on 41 Regions 2015

More info »
Zeitgeist, The Movie  Companion Guide PDF

Zeitgeist, The Movie Companion Guide PDF

ZEITGEIST: THE MOVIE COMPANION SOURCE GUIDE This material is protected by the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.

More info »