TY - JOUR A1 - Pape, Tobias A1 - Felgentreff, Tim A1 - Hirschfeld, Robert A1 - Gulenko, Anton A1 - Bolz, Carl Friedrich T1 - Language-independent Storage Strategies for Tracing-JIT-based Virtual Machines JF - ACM SIGPLAN notices N2 - Storage strategies have been proposed as a run-time optimization for the PyPy Python implementation and have shown promising results for optimizing execution speed and memory requirements. However, it remained unclear whether the approach works equally well in other dynamic languages. Furthermore, while PyPy is based on RPython, a language to write VMs with reusable components such as a tracing just-in-time compiler and garbage collection, the strategies design itself was not generalized to be reusable across languages implemented using that same toolchain. In this paper, we present a general design and implementation for storage strategies and show how they can be reused across different RPython-based languages. We evaluate the performance of our implementation for RSqueak, an RPython-based VM for Squeak/Smalltalk and show that storage strategies may indeed off er performance benefits for certain workloads in other dynamic programming languages. We furthermore evaluate the generality of our implementation by applying it to Topaz, a Ruby VM, and Pycket, a Racket implementation. KW - Implementation KW - collection types KW - memory optimization KW - dynamic typing Y1 - 2016 U6 - https://doi.org/10.1145/2816707.2816716 SN - 0362-1340 SN - 1558-1160 VL - 51 SP - 104 EP - 113 PB - Association for Computing Machinery CY - New York ER - TY - BOOK A1 - Schreiber, Robin A1 - Krahn, Robert A1 - Ingalls, Daniel H. H. A1 - Hirschfeld, Robert T1 - Transmorphic T1 - Transmorphic BT - mapping direct manipulation to source code transformations BT - Abbilden von direkter Manipulation zu Transformationen im Programmtext N2 - Defining Graphical User Interfaces (GUIs) through functional abstractions can reduce the complexity that arises from mutable abstractions. Recent examples, such as Facebook's React GUI framework have shown, how modelling the view as a functional projection from the application state to a visual representation can reduce the number of interacting objects and thus help to improve the reliabiliy of the system. This however comes at the price of a more rigid, functional framework where programmers are forced to express visual entities with functional abstractions, detached from the way one intuitively thinks about the physical world. In contrast to that, the GUI Framework Morphic allows interactions in the graphical domain, such as grabbing, dragging or resizing of elements to evolve an application at runtime, providing liveness and directness in the development workflow. Modelling each visual entity through mutable abstractions however makes it difficult to ensure correctness when GUIs start to grow more complex. Furthermore, by evolving morphs at runtime through direct manipulation we diverge more and more from the symbolic description that corresponds to the morph. Given that both of these approaches have their merits and problems, is there a way to combine them in a meaningful way that preserves their respective benefits? As a solution for this problem, we propose to lift Morphic's concept of direct manipulation from the mutation of state to the transformation of source code. In particular, we will explore the design, implementation and integration of a bidirectional mapping between the graphical representation and a functional and declarative symbolic description of a graphical user interface within a self hosted development environment. We will present Transmorphic, a functional take on the Morphic GUI Framework, where the visual and structural properties of morphs are defined in a purely functional, declarative fashion. In Transmorphic, the developer is able to assemble different morphs at runtime through direct manipulation which is automatically translated into changes in the code of the application. In this way, the comprehensiveness and predictability of direct manipulation can be used in the context of a purely functional GUI, while the effects of the manipulation are reflected in a medium that is always in reach for the programmer and can even be used to incorporate the source transformations into the source files of the application. N2 - Das Definieren von graphischen Benutzeroberflächen mittels funktionaler Abstraktionen, kann die Komplexität der Verwaltung des Zustandes der Anwendung erheblich reduzieren. Aktuelle Beispiele, wie Facebook's Framework *React*, zeigen auf, wie das modellieren der visuellen Schnittstelle als eine funktionale Projektion vom Zustand der Anwendung zur graphischen Repräsentation, die Anzahl der agierenden Objekte erheblich reduzieren und so die Verlässlichkeit des Systems erhöhen kann. Der Preis für die so erreichte Stabilität, ist eine relativ statische graphische Repräsentation, die sich zur Laufzeit nicht dynamisch anpassen lässt und in der jede visuelle Entität nur mittles funktionaler Abstraktionen beschrieben werden kann, was nicht unserem intuitiven Verständnis der Welt entspricht. Im Gegensatz dazu, erlaubt das Rahmenwerk Morphic mittles Interaktionen wie Ziehen, Greifen oder Skalieren von visuellen Elementen, die grahische Darstellung der Anwendung zur Laufzeit in einer unmittelbaren ("live") und direkten Art und Weise weiter zu entwickeln. Um diese Flexibilität zu erreichen, modelliert Morphic allerdings jedes graphische Objekt mittels veränderlichem Zustand, was das Garantieren der Fehlerfreiheit von graphischen Oberfläche, insbesondere bei sehr komplexen Schnittstellen, deutlich erschwehrt. Hinzu kommt, dass die dynamischen Anpassungen zur Laufzeit dazu führen, dass sich die Oberfläche mehr und mehr von ihrer ursprünglichen symbolischen Definition entfernt, da Morphic von selbst die Änderungen in der Laufzeit nicht im Quellcode reflektieren kann. Die Frage ist also ob es eine Kombination beider Ansätze gibt, welche es vermag die Vorteile zu erhalten und Nachteile wenn möglich auszugleichen. Als Lösung für dieses Problem schlagen wir vor das Konzept der direkten Manipulation aus Morphic auf Transformationen im Quellcode zu übertragen. Hierfür werden wir das Design, die Implementierung und Integration einer bidirektionalen Abbildung zwischen graphischer Darstellung und einer funktionalen, deklarativen symbolischen Beschreibung in einer selbsterhaltenden Entwicklungsumgebung erörtern. Wir werden Transmorphic vorstellen, eine funktionale Variante des Morphic Frameworks, in der visuelle und strukturelle Eigenschaften in einer strikt funktionalen und daher deklarativen Art und Weise definiert werden. Innerhalb von Transmorphic hat der Entwickler die Möglichkeit verschieden Morphs zur Laufzeit mittels direkter Manipulation zusammenzusetzen, was direkt zu Änderungen im Quellcode der Anwendung übersetzt wird. Auf diese Weise kann die verständliche und nachvollziehbare direkte Interaktion aus Morphic, im Kontext einer vollständig funktional beschriebenen graphischen Benutzeroberfläche verwendet werden. T3 - Technische Berichte des Hasso-Plattner-Instituts für Digital Engineering an der Universität Potsdam - 110 KW - functional programming KW - morphic KW - functional lenses KW - direct manipulation KW - synchronization KW - FRP KW - reactive KW - immutable values KW - live programming KW - funktionale Programmierung KW - Morphic KW - Functional Lenses KW - direkte Manipulation KW - Synchronisation KW - FRP KW - reaktive Programmierung KW - Unveränderlichkeit KW - Live-Programmierung Y1 - 2016 U6 - http://nbn-resolving.de/urn/resolver.pl?urn:nbn:de:kobv:517-opus4-98300 SN - 978-3-86956-387-9 SN - 1613-5652 SN - 2191-1665 IS - 110 PB - Universitätsverlag Potsdam CY - Potsdam ER - TY - BOOK A1 - Tessenow, Philipp A1 - Felgentreff, Tim A1 - Bracha, Gilad A1 - Hirschfeld, Robert T1 - Extending a dynamic programming language and runtime environment with access control T1 - Verbesserung gehosteter Dienste für kontinuierliche Integration N2 - Complexity in software systems is a major factor driving development and maintenance costs. To master this complexity, software is divided into modules that can be developed and tested separately. In order to support this separation of modules, each module should provide a clean and concise public interface. Therefore, the ability to selectively hide functionality using access control is an important feature in a programming language intended for complex software systems. Software systems are increasingly distributed, adding not only to their inherent complexity, but also presenting security challenges. The object-capability approach addresses these challenges by defining language properties providing only minimal capabilities to objects. One programming language that is based on the object-capability approach is Newspeak, a dynamic programming language designed for modularity and security. The Newspeak specification describes access control as one of Newspeak’s properties, because it is a requirement for the object-capability approach. However, access control, as defined in the Newspeak specification, is currently not enforced in its implementation. This work introduces an access control implementation for Newspeak, enabling the security of object-capabilities and enhancing modularity. We describe our implementation of access control for Newspeak. We adapted the runtime environment, the reflective system, the compiler toolchain, and the virtual machine. Finally, we describe a migration strategy for the existing Newspeak code base, so that our access control implementation can be integrated with minimal effort. N2 - Die Komplexität von Softwaresystemen hat einen hohen Einfluss auf Entwicklungs- und Wartungskosten. Um diese Komplexität zu beherschen, werden Softwaresysteme in Module unterteilt, da diese getrennt leichter zu entwickeln und zu testen sind. Zur Unterstützung einer sauberen Aufteilung von Modulen, sollten sie minimale und klar definierte Schnittstellen haben. Dafür ist die Fähigkeit, mit Hilfe der Berechtigungskontrolle selektiv die Sichtbarkeit von Funktionen eines Modules einzuschränken, von zentraler Bedeutung. Softwaresysteme sind immer stärker verteilt, was nicht nur zu ihrer Komplexität beiträgt, sondern auch Herausforderungen bezüglich der Sicherheit mit sich bringt. Der Object-Capability-Ansatz löst genau jene Sicherheitsprobleme, da dadurch Programmobjekten nur die minimal erforderlichen Fähigkeiten gegeben werden. Für diesen Ansatz ist es essentiell, dass die öffentliche Schnittstelle eines Objektes durch Berechtigungskontrolle eingeschränkt werden kann. Auf dem Object-Capability-Ansatz basiert Newspeak, eine moderne und dynamische Programmiersprache, die besonders auf Sicherheit sowie Modularität Wert legt. Die Berechtigungskontrolle ist eine zentrale Funktion, sowohl für die Modularität, als auch für die Sicherheit von Newspeak. Daher ist sie auch in der Spezifikation von Newspeak definiert. Bisher gibt es allerdings keine Implementierung, die die Berechtigungskontrolle durchsetzt. In dieser Arbeit stellen wir eine Implementierung der Berechtigungskontrolle für Newspeak vor. Damit wird sowohl die Modularität von Newspeak Programmen verbessert, als auch die Sicherheit durch den Object-Capability-Ansatz erst ermöglicht. Wir beschreiben eine Implementierung der Berechtigungskontrolle für Newspeak und passen dabei die Laufzeitumgebung, die Reflexions- und Introspektionsmodule, den Compiler sowie die virtuelle Maschine an. Große Teile des Newspeak-Programmcodes müssen für die Benutzung der Berechtigungskontrolle angepasst werden. Durch eine Migration des Newspeak-Programmcodes wird es möglich, unsere Implementierung mit existierenden Newspeak-Programmen zu benutzen. T3 - Technische Berichte des Hasso-Plattner-Instituts für Digital Engineering an der Universität Potsdam - 107 KW - access control KW - virtual machines KW - Newspeak KW - dynamic programming languages KW - Zugriffskontrolle KW - virtuelle Maschinen KW - Newspeak KW - dynamische Programmiersprachen Y1 - 2016 U6 - http://nbn-resolving.de/urn/resolver.pl?urn:nbn:de:kobv:517-opus4-92560 SN - 978-3-86956-373-2 SN - 1613-5652 SN - 2191-1665 IS - 107 PB - Universitätsverlag Potsdam CY - Potsdam ER - TY - BOOK A1 - Wassermann, Lars A1 - Felgentreff, Tim A1 - Pape, Tobias A1 - Bolz, Carl Friedrich A1 - Hirschfeld, Robert T1 - Tracing Algorithmic Primitives in RSqueak/VM N2 - When realizing a programming language as VM, implementing behavior as part of the VM, as primitive, usually results in reduced execution times. But supporting and developing primitive functions requires more effort than maintaining and using code in the hosted language since debugging is harder, and the turn-around times for VM parts are higher. Furthermore, source artifacts of primitive functions are seldom reused in new implementations of the same language. And if they are reused, the existing API usually is emulated, reducing the performance gains. Because of recent results in tracing dynamic compilation, the trade-off between performance and ease of implementation, reuse, and changeability might now be decided adversely. In this work, we investigate the trade-offs when creating primitives, and in particular how large a difference remains between primitive and hosted function run times in VMs with tracing just-in-time compiler. To that end, we implemented the algorithmic primitive BitBlt three times for RSqueak/VM. RSqueak/VM is a Smalltalk VM utilizing the PyPy RPython toolchain. We compare primitive implementations in C, RPython, and Smalltalk, showing that due to the tracing just-in-time compiler, the performance gap has lessened by one magnitude to one magnitude. N2 - Wenn man eine Programmiersprache als Virtuelle Maschine (VM) realisiert, dann wird Verhalten, das man als Teil der VM, also primitiv, implementiert normalerweise schneller ausgeführt, als vergleichbare Funktionen die in der implementierten Sprache verfasst wurden. Aber die Entwicklung und Wartung von primitiven Funktionen erfordert mehr Anstrengung als die Wartung und Benutzung von Funktionen der implementierten Sprache, da Fehlerbehebung schwerer ist, und die Entwicklungszyklen für VM-Teile länger sind. Im Gegensatz zu Programmen, die in der implementierten Programmiersprache geschrieben sind, wird Quelltext von Primitiven selten wiederverwendet. Und falls sie wiederverwendet werden, dann wird die Schnittstelle zur VM meist emuliert, was den Geschwindigkeitsvorteil reduziert. Aber aufgrund von neueren Resultaten der ablaufverfolgenden dynamischen Kompilierung, könnte die Abwägung zwischen Geschwindigkeit einerseits und Implementierungsaufwand, Wiederverwendbarkeit und Änderbarkeit andererseits nun zugunsten von letzteren ausfallen. In dieser Arbeit untersuchen wir, welche Abstriche bei der Implementierung von Verhalten als Primitive gemacht werden müssen, insbesondere wie hoch die Laufzeitunterschiede zwischen Primitiven und gehosteten Funktionen noch sind. Um das zu erreichen haben wir die algorithmische Primitive BitBlt drei mal für RSqueak/VM implementiert. RSqueak/VM ist eine Smalltalk VM, die die PyPy RPython-Toolkette verwendet. Wir vergleichen die Primitivenimplementierungen in C, RPython und Smalltalk, und zeigen, dass aufgrund eines ablaufverfolgenden just-in-time-Übersetzers der Geschwindigkeitsunterschied um eine Größenordnung auf eine Größenordnung gefallen ist. T3 - Technische Berichte des Hasso-Plattner-Instituts für Digital Engineering an der Universität Potsdam - 104 KW - virtual machines KW - collection types KW - memory optimization KW - dynamic typing KW - virtuelle Maschinen KW - Sammlungsdatentypen KW - Speicheroptimierungen KW - dynamische Sprachen Y1 - 2016 U6 - http://nbn-resolving.de/urn/resolver.pl?urn:nbn:de:kobv:517-opus4-91277 SN - 978-3-86956-355-8 SN - 1613-5652 SN - 2191-1665 IS - 104 PB - Universitätsverlag Potsdam CY - Potsdam ER -