8 research outputs found

    A Unified Type System for Object-Oriented Programming

    Get PDF
    We present a new type system for object-oriented languages with assignments. Types are sets of classes, subtyping is set inclusion, and genericity is class substitution. The type system enables separate compilation, and unifies, generalizes, and simplifies the type systems underlying SIMULA/BETA, C++, EIFFEL, and Typed Smalltalk, and the type system with type substitutions proposed by Palsberg and Schwartzbach, Classes and types are both modeled as node-labeled, ordered regular trees; this allows an efficient type-checking algorithm

    Rétro ingénierie des modèles d’objets dynamiques pour JavaScript

    Full text link
    La compréhension des objets dans les programmes orientés objet est une tâche impor- tante à la compréhension du code. JavaScript (JS) est un langage orienté-objet dyna- mique, et son dynamisme rend la compréhension du code source très difficile. Dans ce mémoire, nous nous intéressons à l’analyse des objets pour les programmes JS. Notre approche construit de façon automatique un graphe d’objets inspiré du diagramme de classes d’UML à partir d’une exécution concrète d’un programme JS. Le graphe résul- tant montre la structure des objets ainsi que les interactions entre eux. Notre approche utilise une transformation du code source afin de produire cette in- formation au cours de l’exécution. Cette transformation permet de recueillir de l’infor- mation complète au sujet des objets crées ainsi que d’intercepter toutes les modifications de ces objets. À partir de cette information, nous appliquons plusieurs abstractions qui visent à produire une représentation des objets plus compacte et intuitive. Cette approche est implémentée dans l’outil JSTI. Afin d’évaluer l’utilité de l’approche, nous avons mesuré sa performance ainsi que le degré de réduction dû aux abstractions. Nous avons utilisé les dix programmes de réfé- rence de V8 pour cette comparaison. Les résultats montrent que JSTI est assez efficace pour être utilisé en pratique, avec un ralentissement moyen de 14x. De plus, pour 9 des 10 programmes, les graphes sont suffisamment compacts pour être visualisés. Nous avons aussi validé l’approche de façon qualitative en inspectant manuellement les graphes gé- nérés. Ces graphes correspondent généralement très bien au résultat attendu. Mots clés: Analyse de programmes, analyse dynamique, JavaScript, profilage.Understanding of objects in object-oriented programs is an important task for understanding the code. JavaScript (JS) is a dynamic object-oriented language, Its dynamic nature makes understanding its source code very difficult. In this thesis, we focus on object analysis in JS programs to automatically produce a graph of objects inspired by UML class diagrams from an execution trace. The resulting graph shows the structure of the objects as well as their interconnections. Our approach uses a source-to-source transformation of the original code in order to collect information at runtime. This transformation makes it possible to collect complete information with respect to object creations and property updates. From this information, we perform multiple abstractions that aim to generate a more compact and intuitive representation of objects. This approach has been implemented in the JSTI prototype. To evaluate our approach, we measured its performance and the graph compression achieved by our abstractions. We used the ten V8 benchmarks for this purpose. Results show that JSTI is efficient enough to be used in practice, with an average slowdown of around 14x. Moreover, for 9 out of the 10 studied programs, the generated object graphs are sufficiently small to be visualized directly by developers. We have also performed a qualitative validation of the approach by manually inspecting the generated graphs. We have found that the graphs generated by JSTI generally correspond very closely to the expected results. Keywords: Program analysis, dynamic analysis, JavaScript, profiling

    An optimizing delivery system for object-oriented software

    Get PDF
    An open-ended and flexible object-oriented language ideally requires its compiler to optimize code at the time of building complete application systems. Optimum code can be judged in terms of its size, which should be compact, and speed of execution, which should be fast. In addition, the turn-around time for recompilation should be as short as possible. Four strategies, based on graph analysis, have been developed which allow these objectives to be attained in a more consistent manner than with current compilers. The findings are being incorporated in BRUNEL, a new object-oriented language and programming environment, which aims to provide a higher degree of support for abstract design, while generating optimal code for applications. -from Author

    Safe, Fast and Easy: Towards Scalable Scripting Languages

    Get PDF
    Scripting languages are immensely popular in many domains. They are characterized by a number of features that make it easy to develop small applications quickly - flexible data structures, simple syntax and intuitive semantics. However they are less attractive at scale: scripting languages are harder to debug, difficult to refactor and suffers performance penalties. Many research projects have tackled the issue of safety and performance for existing scripting languages with mixed results: the considerable flexibility offered by their semantics also makes them significantly harder to analyze and optimize. Previous research from our lab has led to the design of a typed scripting language built specifically to be flexible without losing static analyzability. In this dissertation, we present a framework to exploit this analyzability, with the aim of producing a more efficient implementation. Our approach centers around the concept of adaptive tags: specialized tags attached to values that represent how it is used in the current program. Our framework abstractly tracks the flow of deep structural types in the program, and thus can efficiently tag them at runtime. Adaptive tags allow us to tackle key issues at the heart of performance problems of scripting languages: the framework is capable of performing efficient dispatch in the presence of flexible structures

    Building a Typed Scripting Language

    Get PDF
    Since the 1990s, scripting languages (e.g. Python, Ruby, JavaScript, and many others) have gained widespread popularity. Features such as ad-hoc data manipulation, dynamic structural typing, and terse syntax permit rapid engineering and improve developer productivity. Unfortunately, programs written in scripting languages execute slower and are less scalable than those written in traditional languages (such as C or Java) due to the challenge of statically analyzing scripting languages' semantics. Although various research projects have made progress on this front, corner cases in the semantics of existing scripting languages continue to defy static analysis and software engineers must generally still choose between program performance and programmer performance when selecting a language. We address that dichotomy in this dissertation by designing a scripting language with the intent of statically analyzing it. We select a set of core primitives in which common language features such as object-orientation and case analysis can be encoded and give a sound and decidable type inference system for it. Our type theory is based on subtype constraint systems but is also closely related to abstract interpretation; we use this connection to guide development of the type system and to employ a novel type soundness proof strategy based on simulation. At the heart of our approach is a type indexed record we call the onion which supports asymmetric concatenation and dispatch; we use onions to formally encode a variety of features, including records, operator overloading, objects, and mixins. An optimistic call-site polymorphism model defined herein captures the ad-hoc, case-analysis-based reasoning often used in scripting languages. Although the language in this dissertation uses a particular set of core primitives, the strategy we use to design it is general: we demonstrate a simple, formulaic process for adding features such as integers and state
    corecore