Self: the Power of Simplicity David Ungar and Randall B

Total Page:16

File Type:pdf, Size:1020Kb

Self: the Power of Simplicity David Ungar and Randall B Self: The Power of Simplicity David Ungar and Randall B. Smith David Ungar Randall B. Smith CIS, Room 209 Xerox Palo Alto ResearchCenter Stanford University 3333 Coyote Hill Rd. Stanford, CA 94305 Palo Alto, CA 94304 (415) 725-3713 (415) 494-4947 [email protected] [email protected] To thine own self be true. supportexploratory programming Me831, and there- -William Shakespeare fore includes runtime typing (i.e. no type declarations) and automatic storage reclamation. But Abstract unlike Smalltalk, Self includes neither classes nor variables. Instead, Self has adopted a prototype Self is a new object-oriented language for explor- metaphor for object creation EBor79, Bor81 Bor86, atory programming based on a small number of Lie86, LTP86]. Furthermore, while Smalltalk and simple and concrete ideas: prototypes, slots, and most other object-oriented languages support vari- behavior. Prototypes combine inheritance and instan- able access as well as message passing, Self objects tiation to provide a framework that is simpler and access their state information by sending messagesto more flexible than most object-oriented languages. L‘self,” the receiver of the current message. Slots unite variables and procedures into a single con- Naturally this results in many messages sent to struct. This permits the inheritance hierarchy to take “SeIf,” and the language is named in honor of these over the function of lexical scoping in conventional messages. One of strengths of object-oriented pro- languages. Finally, because Self does not distinguish gramming lies in the uniform access to different state from behavior, it narrows the gaps between kinds of stored and computed data, and the ideas in ordinary objects, procedures, and closures. Self”s Self result in even more uniformity, which results in simplicity and expressivenessoffer new insights into greater expressivepower. We believe that these object-oriented computation. ideas offer a new and useful view of object-oriented computation. Introduction Object-oriented programming languages are gaining Severalprincipals have guided the design of Self: acceptance,partly because they offer a useful perspec- tive for designing computer programs. However, Messages-at-the-bottom. Self features message they do not all offer exactly the same perspective; passing as the fundamental operation, providing there are many different ideas about the nature of access to stored state solely via messages. There are object-oriented computation. In this paper we pre- no variables, merely slots containing objects that sent Self, a programming language with a new return themselves. Since Self objects access state perspective on objects and messagepassing. Like the solely by sending messages,message passing is more Smalltalk-80* language [GoR83], Self is designed to fundamental to Self than to languageswith variables. *Smalltalk-gO is a trademark of ParcPlaceSystems. In this paper, the term “Smalltalk” will be used to refer to the Occam’s razor. Throughout the design, we have SmaUtalk-gO programming language. aimed for conceptual economy: Permission to copy without fee all or part of this material is granted provided . As described above, Self’s design omits that the copies are not made or distributed for direct commerical advantage, classes and variables. Any object can per- the ACM copyright notice and the title of the publication and its date appear, form the role of an instance or serve as a and notice is given that copying is by permission of the Association for repository of sharedinformation. Computing Machinery. To copy otherwise, or to republish, requires a fee and/ or specific permission. l There is no distinction between accessing a 0 1987 ACM 0-89791-247-O/87/0010-0227 $1.50 variable and sending a message. October443,1987 OOPStA ‘87 Proceedings 227 class-based systems Self: no classes inheritance relationships instance of inherits from I I subclass of I 1 creation metaphor 1 build according to plan 1 clone an object initialization executing a “plan” cloning an example on-f-a-kind need extra object for class no extra object needed infinite regress class of class of class of . none required As in Smalhalk, the language kernel has no which may store either state or behavior. If an control structures. Instead, closures and object receives a messageand it has no matching slot, polymorphism support arbitrary control the search continues via its parent pointer. This is structures within the language. how Self implements inheritance. Inheritance in Self allows objects to share behavior, which in turn Unlike Smalltalk, Self objects, procedures, allows the programmer to alter the behavior of many and closures are all woven from the same objects with a single change. For instance as shown yarn by representing procedures and closures in Figure 1, a point* object would have slots for its as prototypes of activation records. This non-shared characteristics: x and y. Its parent would technique allows activation records to be be an object that held the behavior shared among all created the same way as other objects, by points: +, -, etc. cloning prototypes. In addition to sharing the same model of creation, procedures and closures also store their variables and main- Comparing Prototypes and Classes tain their environment information the same way as ordinary objects, as described below. One of .Sers most interesting aspects is the way it combines inheritance, prototypes, and object creation, Concreteness. Our tastes have led us to a metaphor eliminating the need for classes. whose elements are as concrete as possible [Smi87]. So, in the matter of classes versus prototypes, we Simpler relationships. Prototypes can simplify the have chosen to try prototypes. This makes a basic dif- relationships between objects. To visualiz.e the way ference in the way that new objects are created. In a objects behave in a class-based language, one must class-based language an object would be created by grasp two relationships: the “is a” relationship, that instuntiuting a plan in its class. In a prototypebased indicates that an object is an instance of some class, language like Self, an object would be created by and the “kind of * relationship, that indicates that an cloning (copying) a prototype. In Self, any object object’s class is a subclass of some other object’s can be cloned. class. In a system with prototypes instead of classes such as Self, there is only one relationship, “inherits The remainder of the paper describes Self in more from”, that describes how objects share behavior and detail, and concludes with an example. We use State. This structural simplification makes it easier Smalltalk as our yardstick, as it is the most widely to understand the language and easier to formulate an known language in which everything is an object. inheritance hierarchy. Familiarity with Smalltalk will therefore be helpful to the reader. A working system will provide-the chance to discov- er whether class-like objects would be so useful that Prototypes: Blending Classesand programmers will create them without encourage- Instances ment from the language. The absence of the class-instance distinction may make it too hard to understand which objects exist solely to provide In Smalltalk, unlike C++, Simula, Loops, or ADA, shared information for other objects. Perhaps Self everything is an object and every object contains a pointer to its class, an object that describes its format and holds its behavior. (See Figure 1.) In * Throughout this paper we appeal to point objects in exam- ples. A Smalltalk pint represents a point in Self too, everything is an object. But, instead of a two-dimensional Cartesian coordinates. It contains two class pointer, a Self object contains named slots instance variables, an x anda y coordinate. 228 OOPSLA ‘87 Proceedings October 4-8,1987 Smalltalk instances and classes Self objects print how to 1print 1 prir?!b;&ts ( * print objects A (class) (name) Object (superclass) nil (inst vars) I (methods) parent I x: t (class) ... Y: t (name) Point + (superclass) FTJk I (inst vars) Iclass,x, Y 1 I i (methods) L-A-J (class) parent parent \ w 3 X 3 X 7 (Y)j 5 Y 5 Y 9 Each Smalltalk point contains a class pointer, x Each Self point intrinsically describes its own for- and y coordinates. The class Point supplies both mat, but appeals to another object for any behavior format and behavior information for points. Addi- that is shared among points. In this example, the tional format and behavior information is points appeal to an object containing shared behavior inherited from Object via Point’s superclass link. for points. That object in turn appeals to another Each of the two classes in turn must appeal to (on top) for behavior that is shared by all objects. other classes (not shown) for their format and The “root” object fully describes its own format behavior. and behavior, so it has no parent. L A Figure 1. A comparison of Smalltalk instances and classes with Self objects: At the bottom of each figure are two point objects that have been createdby a user program. Odober 4-8,1937 OOPSIA ‘87 Proceedings 229 programmers will create entirely new organizational between computers and the real word, the ability to structures. In any case, Self’s flexibility poses a chal- make sweeping changes by changing shared behavior. lenge to the programming environment; it will have Once inheritance is introduced into the language, the to include navigational and descriptive aids. natural tendency is to make the prototype the same object that contains the behavior for that kind of Creation by copying. Creating new objects from object. For instance, the behavior of all points could prototypes is accomplished by a simple operation, be changed by changing the behavior of the prototypi- with a simple biological metaphor, copying, cal point. Unfortunately, such a system must supply cloning.
Recommended publications
  • Equal Rights for Functional Objects Or, the More Things Change, The
    ACM OOPS Messenger 4,4 (Oct. 1993), 2-27. Equal Rights for Functional Objects1 or, The More Things Change, The More They Are the Same2 Henry G. Baker Nimble Computer Corporation 16231 Meadow Ridge Way, Encino, CA 91436 (818) 986-1436 (818) 986-1360 FAX August, October, 1990, October, 1991, and April, 1992 This work was supported in part by the U.S. Department of Energy Contract No. DE-AC03-88ER80663 We argue that intensional object identity in object-oriented programming languages and databases is best defined operationally by side-effect semantics. A corollary is that "functional" objects have extensional semantics. This model of object identity, which is analogous to the normal forms of relational algebra, provides cleaner semantics for the value-transmission operations and built-in primitive equality predicate of a programming language, and eliminates the confusion surrounding "call-by-value" and "call-by-reference" as well as the confusion of multiple equality predicates. Implementation issues are discussed, and this model is shown to have significant performance advantages in persistent, parallel, distributed and multilingual processing environments. This model also provides insight into the "type equivalence" problem of Algol-68, Pascal and Ada. 1. INTRODUCTION Parallel, distributed and persistent programming languages are leaving the laboratories for more wide-spread use. Due to the substantial differences between the semantics and implementations of these languages and traditional serial programming languages, however, some of the most basic notions of programming languages must be refined to allow efficient, portable implementations. In this paper, we are concerned with defining object identity in parallel, distributed and persistent systems in such a way that the intuitive semantics of serial implementations are transparently preserved.
    [Show full text]
  • The Development of Smalltalk Topic Paper #7
    The Development of Smalltalk Topic Paper #7 Alex Laird Max Earn Peer CS-3210-01 Reviewer On Time/Format 1 2/4/09 Survey of Programming Languages Correct 5 Spring 2009 Clear 2 Computer Science, (319) 360-8771 Concise 2 [email protected] Grading Rubric Grading Total 10 pts ABSTRACT Dynamically typed languages are easier on the compiler because This paper describes the development of the Smalltalk it has to make fewer passes and the brunt of checking is done on programming language. the syntax of the code. Compilation of Smalltalk is just-in-time compilation, also known Keywords as dynamic translation. It means that upon compilation, Smalltalk code is translated into byte code that is interpreted upon usage and Development, Smalltalk, Programming, Language at that point the interpreter converts the code to machine language and the code is executed. Dynamic translations work very well 1. INTRODUCTION with dynamic typing. Smalltalk, yet another programming language originally developed for educational purposes and now having a much 5. IMPLEMENTATIONS broader horizon, first appeared publically in the computing Smalltalk has been implemented in numerous ways and has been industry in 1980 as a dynamically-typed object-oriented language the influence of many future languages such as Java, Python, based largely on message-passing in Simula and Lisp. Object-C, and Ruby, just to name a few. Athena is a Smalltalk scripting engine for Java. Little Smalltalk 2. EARLY HISTORY was the first interpreter of the programming language to be used Development for Smalltalk started in 1969, but the language outside of the Xerox PARC.
    [Show full text]
  • The Evolution of Lisp
    1 The Evolution of Lisp Guy L. Steele Jr. Richard P. Gabriel Thinking Machines Corporation Lucid, Inc. 245 First Street 707 Laurel Street Cambridge, Massachusetts 02142 Menlo Park, California 94025 Phone: (617) 234-2860 Phone: (415) 329-8400 FAX: (617) 243-4444 FAX: (415) 329-8480 E-mail: [email protected] E-mail: [email protected] Abstract Lisp is the world’s greatest programming language—or so its proponents think. The structure of Lisp makes it easy to extend the language or even to implement entirely new dialects without starting from scratch. Overall, the evolution of Lisp has been guided more by institutional rivalry, one-upsmanship, and the glee born of technical cleverness that is characteristic of the “hacker culture” than by sober assessments of technical requirements. Nevertheless this process has eventually produced both an industrial- strength programming language, messy but powerful, and a technically pure dialect, small but powerful, that is suitable for use by programming-language theoreticians. We pick up where McCarthy’s paper in the first HOPL conference left off. We trace the development chronologically from the era of the PDP-6, through the heyday of Interlisp and MacLisp, past the ascension and decline of special purpose Lisp machines, to the present era of standardization activities. We then examine the technical evolution of a few representative language features, including both some notable successes and some notable failures, that illuminate design issues that distinguish Lisp from other programming languages. We also discuss the use of Lisp as a laboratory for designing other programming languages. We conclude with some reflections on the forces that have driven the evolution of Lisp.
    [Show full text]
  • Technological Advancement in Object Oriented Programming Paradigm for Software Development
    International Journal of Applied Engineering Research ISSN 0973-4562 Volume 14, Number 8 (2019) pp. 1835-1841 © Research India Publications. http://www.ripublication.com Technological Advancement in Object Oriented Programming Paradigm for Software Development Achi Ifeanyi Isaiah1, Agwu Chukwuemeka Odi2, Alo Uzoma Rita3, Anikwe Chioma Verginia4, Okemiri Henry Anaya5 1Department of Maths/Comp Sci/Stats/Info., Faculty of science, Alex Ekwueme University, Ndufu-Alike 2Department of Computer Science, Ebonyi State University-Abakaliki. 3Alex Ekwueme University, Ndufu-Alike, 4Department of Maths/Comp Sci/Stats/Info., Faculty of science, Alex Ekwueme University, Ndufu-Alike 5Department of Maths/Comp Sci/Stats/Info., Faculty of science, Alex Ekwueme University, Ndufu-Alike Abstract and personalization problems. Take for instance, a lot of sophisticated apps are being produced and release in the Object oriented programming paradigm in software market today through the application of OOP. Almost desktop development is one of the most popular methods in the apps are being converted to mobile apps through Java, C++, information technology industry and academia as well as in PHP & MySQL, R, Python etc platform which form the many other forms of engineering design. Software testimony of OOP in the software industries. Software development is a field of engineering that came into existence developer has been revolving using procedural language for owing to the various problems that developers of software the past decade before the advent of OOP. The relationships faced while developing software projects. This paper analyzes between them is that procedural languages focus on the some of the most important technological innovations in algorithm but OOP focuses on the object model itself, object oriented software engineering in recent times.
    [Show full text]
  • The Cedar Programming Environment: a Midterm Report and Examination
    The Cedar Programming Environment: A Midterm Report and Examination Warren Teitelman The Cedar Programming Environment: A Midterm Report and Examination Warren Teitelman t CSL-83-11 June 1984 [P83-00012] © Copyright 1984 Xerox Corporation. All rights reserved. CR Categories and Subject Descriptors: D.2_6 [Software Engineering]: Programming environments. Additional Keywords and Phrases: integrated programming environment, experimental programming, display oriented user interface, strongly typed programming language environment, personal computing. t The author's present address is: Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, Ca. 94043. The work described here was performed while employed by Xerox Corporation. XEROX Xerox Corporation Palo Alto Research Center 3333 Coyote Hill Road Palo Alto, California 94304 1 Abstract: This collection of papers comprises a report on Cedar, a state-of-the-art programming system. Cedar combines in a single integrated environment: high-quality graphics, a sophisticated editor and document preparation facility, and a variety of tools for the programmer to use in the construction and debugging of his programs. The Cedar Programming Language is a strongly-typed, compiler-oriented language of the Pascal family. What is especially interesting about the Ce~ar project is that it is one of the few examples where an interactive, experimental programming environment has been built for this kind of language. In the past, such environments have been confined to dynamically typed languages like Lisp and Smalltalk. The first paper, "The Roots of Cedar," describes the conditions in 1978 in the Xerox Palo Alto Research Center's Computer Science Laboratory that led us to embark on the Cedar project and helped to define its objectives and goals.
    [Show full text]
  • MVC Revival on the Web
    MVC Revival on the Web Janko Mivšek [email protected] @mivsek @aidaweb ESUG 2013 Motivation 30 years of Smalltalk, 30 years of MVC 34 years exa!tly, sin!e "#$# %ot in JavaScri&t MVC frameworks 'or Sin(le)*age and +ealtime web a&&s ,e Smalltalkers s-ould respe!t and revive our &earls better Contents MVC e &lained %istory /sa(e in !.rrent JavaScri&t frameworks /sa(e in Smalltalk C.rrent and f.t.re MVC in 0ida/Web MVC Explained events Ar!hite!tural desi(n &attern - Model for domain s&e!ifi! data and logi! View updates Controller ) View for &resentation to t-e .ser ) Controller for intera!tions wit- t-e .ser UI and .&datin( domain model Domain changes Main benefit: actions observing ) se&aration of !on!erns Model MVC based on Observer pattern subscribe ) 3bserver looks at observee Observer changed - 3bservee is not aware of t-at s u 4e&enden!y me!-anism2 B t n - 3bserver is de&endent on 3bservee state e observing v - 3bservee m.st re&ort state !-an(es to 3bserver E b - *.b/S.b Event 6.s de!ou&les 3bservee from u S / 3bserver to &reserve its .nawarnes of observation b u changed P Observee Main benefit: (Observable) ) se&aration of !on!erns Multiple observers subscribe - M.lti&le observers of t-e same 3bservee Observer changed - 7n MVC an 3bservee is View and 3bservee is domain Model, t-erefore2 s u B t - many views of t-e same model n e observing v - many a&&s E b - many .sers u S / - mix of all t-ree !ases b u Observee changed P (Observable) Example: Counter demo in Aida/Web M.lti.ser realtime web !ounter exam&le -ttp://demo.aidaweb.si – !li!k Realtime on t-e left – !li!k De!rease or In!rease to c-an(e counter – !ounter is c-an(ed on all ot-er8s browsers History of MVC (1) 7nvented by 9rygve +eenska.g w-en -e worked in "#$:1$# wit- Alan ;ay's group on <ero *arc on Smalltalk and Dynabook – 'inal term Model)View)Controller !oined 10.
    [Show full text]
  • Dynamic Object-Oriented Programming with Smalltalk
    Dynamic Object-Oriented Programming with Smalltalk 1. Introduction Prof. O. Nierstrasz Autumn Semester 2009 LECTURE TITLE What is surprising about Smalltalk > Everything is an object > Everything happens by sending messages > All the source code is there all the time > You can't lose code > You can change everything > You can change things without restarting the system > The Debugger is your Friend © Oscar Nierstrasz 2 ST — Introduction Why Smalltalk? > Pure object-oriented language and environment — “Everything is an object” > Origin of many innovations in OO development — RDD, IDE, MVC, XUnit … > Improves on many of its successors — Fully interactive and dynamic © Oscar Nierstrasz 1.3 ST — Introduction What is Smalltalk? > Pure OO language — Single inheritance — Dynamically typed > Language and environment — Guiding principle: “Everything is an Object” — Class browser, debugger, inspector, … — Mature class library and tools > Virtual machine — Objects exist in a persistent image [+ changes] — Incremental compilation © Oscar Nierstrasz 1.4 ST — Introduction Smalltalk vs. C++ vs. Java Smalltalk C++ Java Object model Pure Hybrid Hybrid Garbage collection Automatic Manual Automatic Inheritance Single Multiple Single Types Dynamic Static Static Reflection Fully reflective Introspection Introspection Semaphores, Some libraries Monitors Concurrency Monitors Categories, Namespaces Packages Modules namespaces © Oscar Nierstrasz 1.5 ST — Introduction Smalltalk: a State of Mind > Small and uniform language — Syntax fits on one sheet of paper >
    [Show full text]
  • Comparative Studies of 10 Programming Languages Within 10 Diverse Criteria
    Department of Computer Science and Software Engineering Comparative Studies of 10 Programming Languages within 10 Diverse Criteria Jiang Li Sleiman Rabah Concordia University Concordia University Montreal, Quebec, Concordia Montreal, Quebec, Concordia [email protected] [email protected] Mingzhi Liu Yuanwei Lai Concordia University Concordia University Montreal, Quebec, Concordia Montreal, Quebec, Concordia [email protected] [email protected] COMP 6411 - A Comparative studies of programming languages 1/139 Sleiman Rabah, Jiang Li, Mingzhi Liu, Yuanwei Lai This page was intentionally left blank COMP 6411 - A Comparative studies of programming languages 2/139 Sleiman Rabah, Jiang Li, Mingzhi Liu, Yuanwei Lai Abstract There are many programming languages in the world today.Each language has their advantage and disavantage. In this paper, we will discuss ten programming languages: C++, C#, Java, Groovy, JavaScript, PHP, Schalar, Scheme, Haskell and AspectJ. We summarize and compare these ten languages on ten different criterion. For example, Default more secure programming practices, Web applications development, OO-based abstraction and etc. At the end, we will give our conclusion that which languages are suitable and which are not for using in some cases. We will also provide evidence and our analysis on why some language are better than other or have advantages over the other on some criterion. 1 Introduction Since there are hundreds of programming languages existing nowadays, it is impossible and inefficient
    [Show full text]
  • As We May Communicate Carson Reynolds Department of Technical Communication University of Washington
    As We May Communicate Carson Reynolds Department of Technical Communication University of Washington Abstract The purpose of this article is to critique and reshape one of the fundamental paradigms of Human-Computer Interaction: the workspace. This treatise argues that the concept of a workspace—as an interaction metaphor—has certain intrinsic defects. As an alternative, a new interaction model, the communication space is offered in the hope that it will bring user interfaces closer to the ideal of human-computer symbiosis. Keywords: Workspace, Communication Space, Human-Computer Interaction Our computer systems and corresponding interfaces have come quite a long way in recent years. We no longer patiently punch cards or type obscure and unintelligible commands to interact with our computers. However, out current graphical user interfaces, for all of their advantages, still have shortcomings. It is the purpose of this paper to attempt to deduce these flaws by carefully examining our earliest and most basic formulation of what a computer should be: a workspace. The History of the Workspace The modern computerized workspace has its beginning in Vannevar Bush’s landmark article, “As We May Think.” Bush presented the MEMEX: his vision of an ideal workspace for researchers and scholars that was capable of retrieving and managing information. Bush thought that machines capable of manipulating information could transform the way that humans think. What did Bush’s idealized workspace involve? It consists of a desk, and while it can presumably be operated from a distance, it is primarily the piece of furniture at which he works. On top are slanting translucent screens, on which material can be projected for convenient reading.
    [Show full text]
  • Session 1: Introducing Extreme Java
    Extreme Java G22.3033-006 Session 1 – Main Theme Introducing Extreme Java Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Agenda • Course Logistics, Structure and Objectives • Java Programming Language Features • Java Environment Limitations • Upcoming Features in “Tiger” 1.5 • Model Driven Architectures for Java Systems • Java Enterprise Application Enabling • Agile Modeling & eXtreme Programming • Aspect-Oriented Programming & Refactoring • Java Application Performance Enhancement • Readings, Class Project, and Assignment #1a 2 1 Course Logistics • Course Web Site • http://cs.nyu.edu/courses/spring03/G22.3033-006/index.htm • http://www.nyu.edu/classes/jcf/g22.3033-007/ • (Password: extjava) • Course Structure, Objectives, and References • See detailed syllabus on the course Web site under handouts • See ordered list of references on the course Web site • Textbooks • Mastering Java 2, J2SE 1.4 • J2EE: The Complete Reference • Expert One-on-One: J2EE Design and Development 3 Part I Java Features 4 2 Java Features Review • Language Categories • Imperative • Functional • Logic-based • Model-based PL Comparison Framework • Data Model • Behavioral Model • Event Model • Execution, Persistence, etc. • See Session 1 Handout on Java Review 5 J2SE 1.4 Features http://java.sun.com/j2se/1.4/index.html 6 3 J2SE 1.4 Features (continued) • HotSpot virtual machine • Full 64-bit support • Improved garbage collection • Ability to exploit multiprocessing • Optimization of the Java2D
    [Show full text]
  • Eliminating the Call Stack to Save RAM
    Eliminating the Call Stack to Save RAM Xuejun Yang Nathan Cooprider John Regehr University of Utah BAE Systems AIT University of Utah [email protected] [email protected] [email protected] Abstract it is likely to use some of its RAM to store one or more call stacks: Most programming languages support a call stack in the program- chains of activation records representing the state of executing ming model and also in the runtime system. We show that for appli- functions. From the point of view of the compiler, targeting a run- cations targeting low-power embedded microcontrollers (MCUs), time system based on a callstack has important benefits. First, the RAM usage can be significantly decreased by partially or com- stack is memory-efficient: variables live only as long as they are pletely eliminating the runtime callstack. We present flattening, needed. Second, the stack is time-efficient, supporting allocation a transformation that absorbs a function into its caller, replacing and deallocation in a handful of clock cycles. Third, compilers can function invocations and returns with jumps. Unlike inlining, flat- rapidly generate high-quality code by compiling one function at tening does not duplicate the bodies of functions that have multiple a time; the small size of the typical function makes it possible to callsites. Applied aggressively, flattening results in stack elimina- run aggressive intraprocedural optimizations while also achieving tion. Flattening is most useful in conjunction with a lifting transfor- short compile times. mation that moves global variables into a local scope. Our thesis is that despite these well-known benefits: Partially or Flattening and lifting can save RAM.
    [Show full text]
  • Merging Equivalent Contexts for Scalable Heap-Cloning-Based Context-Sensitive Points-To Analysis∗
    Merging Equivalent Contexts for Scalable Heap-Cloning-Based Context-Sensitive Points-to Analysis∗ Guoqing Xu Atanas Rountev Computer Science and Engineering Computer Science and Engineering Ohio State University Ohio State University [email protected] [email protected] ABSTRACT General Terms A context-sensitive points-to analysis maintains separate points- Algorithms, measurement, experimentation to relationships for each possible (abstract) calling context of a method. Previous work has shown that a large number of equiv- Keywords alence classes exists in the representation of calling contexts. Such Pointer analysis, points-to analysis, context sensitivity equivalent contexts provide opportunities for context-sensitive anal- yses based on binary decision diagrams (BDDs), in which BDDs 1. INTRODUCTION automatically merge equivalent points-to relationships. However, Context sensitivity in points-to analyses has been studied exten- the use of a BDD “black box” introduces additional overhead for sively; some of this work is summarized in [11, 8, 28]. Most such analysis running time. Furthermore, with heap cloning (i.e., using analyses compute a complete points-to solution for all variables in context-sensitive object allocation sites), BDDs are not as effective a program. Such algorithms usually have to sacrifice analysis pre- because the number of equivalence classes increases significantly. cision for practical scalability. An alternative is a refinement-based A further step must be taken to look inside the BDD black box to approach that performs points-to analysis by answering pointer- investigate where the equivalence comes from, and what tradeoffs related queries raised by a compiler or a client analysis on demand can be employed to enable practical large-scale heap cloning.
    [Show full text]