ArticlePDF Available

Abstract and Figures

Pharo by Example, intended for both students and developers, will guide you gently through the Pharo language and environment by means of a series of examples and exercises. This book is made available under the Creative Commons Attribution-ShareAlike 3.0 license.
Content may be subject to copyright.
A preview of the PDF is not available
... Moose then imports this file to build a model that can be queried and manipulated. Moose is implemented in Pharo 3 [4], an open-source Smalltalk implementation. As a consequence, Moose models reside in a Smalltalk image. ...
Article
Full-text available
During software maintenance, much time is spent reading and assessing existing code. Unfortunately most of the tools available for exploring and assessing code, such as browsers, debuggers and profilers, focus on development tasks, and offer little to support program understanding. We present a platform for software and data analysis, called Moose, which enables the rapid development of custom tools for software assessment. We demonstrate how Moose supports agile software assessment through a series of demos, we illustrate some of the custom tools that have been developed, and we draw various lessons learned for future work in this domain
... As a last evaluation of simple C functions with N B , we call printf with a string and two integers as argument. The marshalling overhead is less than for the previous getenv example as the strings passed and returned 9 Downsampled from increased loop size by a factor 100 to guarantee accuracy. 10 Downsampled from increased loop size by a factor 10 to guarantee accuracy. ...
Article
High-level languages implement reflection which allows a language runtime to inspect and alter its own execution and state. These high-level languages typically run on top of virtual machines (vms) which have been built to create an abstraction layer over hardware. Due to the isolating nature of the vm, reflection is generally limited to the language-side. Several research vms overcome this separation and provide a unified model where there is no more a clear distinction between language-side and vm-side. In such a language runtime it is possible to reflectively modify vm components from language-side as they reside on the same abstraction layer. In this dissertation we follow the same global direction towards a unified language-runtime or self-aware vm. However, instead of looking for a holistic solution we focus on a minimal approach. Instead of using a custom tailored language runtime we use dynamic native code activation from language-side on top of an existing vm. We first present Benzo our framework for dynamic native code activation. Benzo provides a generic but low-level interface to the vm internals. Based on this framework we then evaluate several applications that typically require direct vm support. We show first how Benzo is used to build an efficient ffi interface, allowing for a more structured access to vm internal functions. To evaluate the limitations of Benzo we target two more applications: dynamic primitives and a language-side jit compiler. Both of them require a tight interaction with the underlying vm.
Article
OpenSmalltalk‐VM is a virtual machine (VM) for languages in the Smalltalk family (eg, Squeak and Pharo), which is itself written in a subset of Smalltalk that can easily be translated to C. VM development is done in Smalltalk, an activity we call “simulation.” The production VM is then derived by translating the core VM code to C. As a result, two execution models coexist: simulation, where the Smalltalk code is executed on top of a Smalltalk VM, and production, where the same code is compiled to an executable through a C compiler. The whole VM execution can be simulated: the heap is represented as a huge byte array, the VM code is executed as Smalltalk, and the native code generated by the just‐in‐time (JIT) compiler is executed by a processor simulator. All the Smalltalk development tools, such as the debugger, are then available while simulating. In addition, in simulation, it is also possible to use debugging features such as single stepping in the machine code generated by the JIT compiler. The Smalltalk development tools combined with the simulation debugging features provide developers with a productive environment in which to extend and debug the VM. In this article, we detail the VM simulation infrastructure and report our experiences developing and debugging VM features within it such as the garbage collector and the JIT compiler.
Conference Paper
Aspects of live-programming that have originated with Lisp and Smalltalk systems have recently seen a renewed research and industrial interest due to their educational and productivity potential (Live workshops at ECOOP, ICSE, and SPLASH, live facilities for the Microsoft .NET, Java, Python, and Swift platforms). Especially in the case of visual modeling and simulation tools that are used by experts outside Informatics (such as ecologists, biologists, economists, epidemiologists, ...), this constant-feedback loop that live-systems provide can ease the development and comprehension of complex systems, via truly explorable environments. Unfortunately, taking the domain of Epidemiology as an example, we observe that the visual aspect of such systems offer no notion of modularity and thus exploration is limited only to small monolithic examples. In order to address this issue, we propose a model for modular visual exploration. This model is based on an extension of the OpenPonk platform targeting Kendrick, an domain-specific language (DSL) about epidemiology. Through this model, we were able to map the separation of concerns of the Kendrick DSL, in a live visual notation that supports modularity and exploration of part-whole hierarchies.
Article
Full-text available
Producing a small deployment version of an application is a challenge because static abstractions such as packages cannot anticipate the use of their parts at runtime. Thus, an application often occupies more memory than actually needed. Tailoring is one of the main solutions to this problem i.e., extracting used code units such as classes and methods of an application. However, existing tailoring techniques are mostly based on static type annotations. These techniques cannot efficiently tailor applications in all their extent (e.g., runtime object graphs and metadata) nor be used in the context of dynamically-typed languages. We propose a run-fail-grow technique to tailor applications using their runtime execution. Run-fail-grow launches (a) a reference application containing the original application to tailor and (b) a nurtured application containing only a seed with a minimal set of code units the user wants to ensure in the final application. The nurtured application is executed, failing when it founds missing objects, classes or methods. On failure, the necessary elements are installed into the nurtured application from the reference one, and the execution resumes. The nurtured application is executed until it finishes, or until the developer explicitly finishes it, for example in the case of a web application. resulting in an object memory (i.e., a heap) with only objects, classes and methods required to execute the application. To validate our approach we implemented a tool based on Virtual Machine modifications, namely Tornado. Tornado succeeds to create very small memory footprint versions of applications e.g., a simple objectoriented heap of 11kb. We show how tailoring works on application code, base and third-party libraries even supporting human interaction with user interfaces. These experiments show memory savings ranging from 95% to 99%.
Article
Full-text available
Im Beitrag wird aufgezeigt, wie sich ein einfaches mechatronisches System simulieren lässt. Dabei wird SMALLTALK/SQUEAK als Bedienungsoberfläche für die Simulationsumgebung Scilab verwendet. Das Projekt wurde im Rahmen eines freiwilligen Programmierkur-ses am Gymnasium für 15-bis 17-jährige Schülerinnen und Schüler erprobt. Die Aufgabe Ausgangspunkt war ein freiwilliger Kurs Objektorien-tiertes Programmieren mit SMALLTALK/SQUEAK. Den fachlichen Hintergrund bildeten ausgewählte Kapitel von Black u. a. (2009), Brauer (3 2009) und Ducasse (2005). Nach zwei Jahren waren die Kenntnisse soweit entwickelt, dass der Wunsch nach eigenen Projekten auf-kam. Ein Schüler hatte einen Kugelroboter in der Größe eines Fußballs (siehe Bild 1) gebaut, der sich recht ein-fach mit einer Modellbau-Fernsteuerung fahren ließ. Die Frage war, ob wir diesen mit den erlernten Mitteln steu-ern könnten und damit ein Programm an die Stelle der lenkenden Person treten könne. In der Realität werden Kugelroboter beispielsweise bei Erkundungsprojekten (siehe Bild 2, oben) oder bei der Überwachung von Gelände (siehe Bild 2, unten) eingesetzt. Die Aufgabe bestand nunmehr darin, mit mathemati-schen Mitteln zu beschreiben, wohin der Kugelroboter rollt, wenn seine Stellmotoren angesteuert werden. Das sollte uns auf die weiterreichende inverse Aufgabe vor-Bild 1: Der Kugelroboter. Bild 2: Kugelroboter zur Erkundung von unwegsa-mem Gelände (links: Tumble-weed Rover der NASA) sowie zur Beobach-tung und Über-wachung (un-ten: Rotundus).
Article
Because objects need to be stored and reloaded on different environments, serializing object graphs is a very important activity. There is a plethora of serialization frameworks with different requirements and design trade-offs. Most of them are based on recursive parsing of the object graphs, an approach which often is too slow. In addition, most of them prioritize a language-agnostic format instead of speed and language-specific object serialization. For the same reason, such serializers usually do not support features such as class-shape changes, global references or executing pre and post load actions. Looking for speed, some frameworks are partially implemented at Virtual Machine (VM) level, hampering code portability and making them difficult to understand, maintain and extend.In this paper, we present Fuel, a general-purpose object serializer based on these principles: (1) speed, through a compact binary format and a pickling algorithm which invests time in serialization for obtaining the best performance on materialization; (2) good object-oriented design, without special help at VM; and (3) serialize any object, thus have a full-featured language-specific format.We implement and validate this approach in Pharo, where we demonstrate that Fuel is faster than other serializers, even those with special VM support. The extensibility of Fuel made possible to successfully serialize various objects: classes in Newspeak, debugger stacks, and full content management system object graphs. Copyright © 2012 John Wiley & Sons, Ltd.
Conference Paper
Squeak is an open, highly-portable Smalltalk implementation whose virtual machine is written entirely in Smalltalk, making it easy to. debug, analyze, and change. To achieve practical performance, a translator produces an equivalent C program whose performance is comparable to commercial Smalltalks.Other noteworthy aspects of Squeak include: a compact object format that typically requires only a single word of overhead per object; a simple yet efficient incremental garbage collector for 32-bit direct pointers; efficient bulk-mutation of objects; extensions of BitBlt to handle color of any depth and anti-aliased image rotation and scaling; and real-time sound and music synthesis written entirely in Smalltalk.
  • Wilf Lalonde
  • John Pugh
Wilf LaLonde and John Pugh: Inside Smalltalk: Volume 1. Prentice Hall, 1990, ISBN 0-13-468414-1