Proceedings.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
Goals and scopes •The goals of the workshop is to create a forum around advances or experience in Smalltalk and to trigger discussions and exchanges of ideas. Participants are invited to submit research articles. We will not enforce any length restriction. However we expect papers of two kinds: –Short position papers describing emerging ideas. –Long research papers with deeper description of experiments and of research results. •We welcome contributions on all aspects, theoretical as well as practical, of Smalltalk related topics such as: –Aspect-oriented programming, –Design patterns, –Experience reports, –Frameworks, –Implementation, –new dialects or languages implemented in Smalltalk, –Interaction with other languages, –Meta-programming and Meta-modeling, –Tools Publication •Both submissions and final papers must be prepared using the ACM SIGPLAN 10 point format. Templates for Word and LaTeX are available at http://www.acm.org/sigs/sigplan/authorInformation.htm •Authors of the best accepted papers will also be invited to submit extended versions for publication in a special issue of Elsevier "Science of Computer Programming: Methods of Software Design: Techniques and Applications" •Please submit your paper through EasyChair on http://www.easychair.org/conferences/?conf=iwst2012 Program Chairs •Loïc Lagadec Lab-STICC, UBO, France •Alain Plantec, Lab-STICC, UBO, France Program Committee •Gabriela Arevalo, Universidad Nacional de Quilmes, Agentina •Alexandre Bergel University of Chile •Andrew P. Black Portland State University, US •Marcus Denker Rmod, INRIA Lille - Nord Europe, France •Luc Fabresse Ecole des Mines de Douai, France, •Tudor Girba CompuGroup Medical Schweiz, Switzerland •Andy Kellens Software Languages Lab, Vrije Universiteit Brussel, Belgium •Mickaël Kerboeuf LabSticc, University of Brest, France •Jannik Laval LaBRI, University of Bordeaux, France •Mariano Martinez Peck Ecole des Mines de Douai, France, •Lukas Renggli Google, Switzerland •Jorge Ressia Software Composition Group, University of Bern, Switzerland •Bastian Steinert HPI, Software Architecture Group, Germany •Hernan Wilkinson 10Pines, IT consultancy, Buenos Aires, Argentina •Roel Wuyts IMEC Leuven, Belgium IWST 2012 Table of Contents Table of Contents Forewords................................................................................. 1 Loic Lagadec and Alain Plantec SESSION 1 On the Integration of Smalltalk and Java . 7 Marcel Hlopko, Jan Kurs, Jan Vrany and Claus Gittinger Refactoring Support For Smalltalk Using Static Type Inference . 19 Martin Unterholzner Smalltalk in a C World. 37 David Chisnall SESSION 2 Tracking Down Software Changes Responsible for Performance Loss . 49 Juan Pablo Sandoval Alcocer Spec A Framework for the Specification and Reuse of UIs and their Models. 56 Benjamin Van Ryseghem, Stephane´ Ducasse and Johan Fabry 4 IWST 2012 Author Index Author Index Chisnall, David 37 Ducasse, Stephane´ 56 Fabry, Johan 56 Gittinger, Claus 7 Hlopko, Marcel 7 Kurs, Jan 7 Lagadec, Loic 1 Plantec, Alain 1 Sandoval Alcocer, Juan Pablo 49 Unterholzner, Martin 19 Van Ryseghem, Benjamin 56 Vrany, Jan 7 5 IWST 2012 Keyword Index Keyword Index Compilation 37 Framework 56 Interoperability 7, 37 Java 7 Language interoperability 7 MVP 56 Objective-C 37 Pharo 56 Profiling 49 Refactoring 19 Smalltalk 7, 19, 37, 56 Software evolution 49 Software execution 49 Static code analysis 19 Type inference 19 UI 56 UIBuilder 56 6 On the Integration of Smalltalk and Java Practical Experience with STX:LIBJAVA Marcel Hlopko Jan Kurš Jan Vraný Czech Technical University in Software Composition Group, Czech Technical University in Prague University of Bern Prague, eXept Software AG marcel.hlopko@fit.cvut.cz [email protected] jan.vrany@fit.cvut.cz Claus Gittinger eXept Software AG [email protected] Abstract Categories and Subject Descriptors H.3.3 [Programming After decades of development in programming languages Languages]: Language Constructs and Features—Language and programming environments, Smalltalk is still one of Interoperability; H.3.4 [Programming Languages]: Pro- few environments that provide advanced features and is still cessors—Interpreters, Virtual Machines widely used in the industry. However, as Java became preva- General Terms Language Interoperability lent, the ability to call Java code from Smalltalk and vice versa becomes important. Traditional approaches to inte- Keywords Language Interoperability, Smalltalk, Java grate the Java and Smalltalk languages are through low-level communication between separate Java and Smalltalk virtual 1. Introduction machines. We are not aware of any attempt to execute Without doubt, the Java programming language has become and integrate the Java language directly in the Smalltalk en- one of the most widely used programming languages today. vironment. A direct integration allows for very tight and A significant amount of code is written in Java, ranging almost seamless integration of the languages and their ob- from small libraries to large-scale application servers and jects within a single environment. Yet integration and lan- business applications. Nevertheless, Smalltalk still provides guage interoperability impose challenging issues related to a number of unique features (such as advanced reflection method naming conventions, method overloading, exception support or expressive exception mechanism) lacking in Java, handling and thread-locking mechanisms. which makes Smalltalk suitable for many kinds of project. In this paper we describe ways to overcome these chal- It is a tempting idea to call Java from Smalltalk and vice lenges and to integrate Java into the Smalltalk environment. versa, as it enables the use of many Java libraries within Using techniques described in this paper, the programmer Smalltalk projects. can call Java code from Smalltalk using standard Smalltalk The idea of Java-Smalltalk integration is not new and has idioms while the semantics of each language remains pre- been explored by others in the past. JavaConnect (Brichau served. We present STX:LIBJAVA — an implementation of and De Roover [1]) and JNIPort (Geidel [4]) use foreign Java virtual machine within Smalltalk/X — as a validation function interfaces to connect to the Java virtual machine of our approach. and to call a Java code. Bridges, such as VisualAge for Java (Deupree and Weitzel [2]) or Expecco Java Interface Li- brary (Expecco [3]), use proxy objects, which intercept and forward function calls and return result values or handles via an interprocess communication channel. Another more versatile approach, is to execute both languages within the same virtual machine and use a common object representa- tion for both. STX:LIBJAVA, which is presented in this paper, is an example of such an approach: it executes Java within [Copyright notice will appear here once ’preprint’ option is removed.] the Smalltalk virtual machine. Another example is Redline 1 2012/8/15 Smalltalk (Ladd [9]), which executes Smalltalk using stan- lems when integrating these languages into a common sys- dard Java virtual machine. tem. Seamless, easy to use integration of two programming languages consists of various parts. First, it must allow one 1. Class access. In Smalltalk classes are identified by name. language to call functions in the other, possibly passing There is only one class with a given name at any time (al- argument objects and getting return values (runtime-level though it may change over time) and it must be present integration). and resolved prior to the code actually beeing executed. Second, it should support programmer-friendly argument The system triggers a runtime error otherwise. The pro- and return value passing between the languages. cess of loading classes into the system is not specified in Third, it should ideally preserve object identity. The use the standard, although some Smalltalk dialects provide of replicas or proxy objects can introduce various problems namespaces and/or a lazy class loading facility. when objects are stored or managed by their identity. This On the other hand Java provides a well-defined, user- also affects any side effects to such objects when calling extensible mechanism called classloaders for lazy-loading functions in the other language. of classes into a running system. Moreover in Java a Finally, it should seamlessly integrate the two languages class is not only identified by its name but by its defining on the syntactic level, which means that (ideally) no addi- classloader as well. In other words two possibly different tional glue or marshalling code should be required to call classes with the same name may coexist in the running the other language (language-level integration). system as long as they have been defined by different In the case of Java and Smalltalk, language-level integra- classloaders. Which classloader is used to load a partic- tion raises a number of challenges, due to their different de- ular class at a particular place in the code is a subject to sign and semantics. In particular these are: complex rules and depends on the runtime context. 2. Selector mismatch. On the bytecode level, a method is • Smalltalk uses keyword message selectors, whereas Java identified by a selector in both languages. However, the uses traditional C-like selectors (virtual function names). syntactic format of selectors differs. Smalltalk uses the • Java supports method overloading based on static types, same selector in bytecode and in a source code. Java en- whereas there is no static type information in Smalltalk.