41 research outputs found

    When and how java developers give up static type safety

    Get PDF
    The main goal of a static type system is to prevent certain kinds of errors from happening at run time. A type system is formulated as a set of constraints that gives any expression or term in a program a well-defined type. Besides detecting these kinds of errors, a static type system can be an invaluable maintenance tool, can be useful for documentation purposes, and can aid in generating more efficient machine code. However, there are situations when the developer has more information about the program that is too complex to explain in terms of typing constraints. To that end, programming languages often provide mechanisms that make the typing constraints less strict to permit more programs to be valid, at the expense of causing more errors at run time. These mechanisms are essentially two: Unsafe Intrinsics and Reflective Capabilities. We want to understand how and when developers give up these static constraints. This knowledge can be useful as: a) a recommendation for current and future language designers to make informed decisions, b) a reference for tool builders, e.g., by providing more precise or new refactoring analyses, c) a guide for researchers to test new language features, or to carry out controlled programming experiments, and d) a guide for developers for better practices. In this dissertation, we focus on the Unsafe API and cast operator---a subset of unsafe intrinsics and reflective capabilities respectively---in Java. We report two empirical studies to understand how these mechanisms---Unsafe API and cast operator---are used by Java developers when the static type system becomes too strict. We have devised usage patterns for both the Unsafe API and cast operator. Usage patterns are recurrent programming idioms to solve a specific issue. We believe that having usage patterns can help us to better categorize use cases and thus understand how those features are used

    The Truth, the Whole Truth, and Nothing but the Truth: A Pragmatic Guide to Assessing Empirical Evaluations

    Get PDF
    An unsound claim can misdirect a field, encouraging the pursuit of unworthy ideas and the abandonment of promising ideas. An inadequate description of a claim can make it difficult to reason about the claim, for example to determine whether the claim is sound. Many practitioners will acknowledge the threat of un- sound claims or inadequate descriptions of claims to their field. We believe that this situation is exacerbated and even encouraged by the lack of a systematic approach to exploring, exposing, and addressing the source of unsound claims and poor exposition. This paper proposes a framework that identifies three sins of reasoning that lead to unsound claims and two sins of exposition that lead to poorly described claims. Sins of exposition obfuscate the objective of determining whether or not a claim is sound, while sins of reasoning lead directly to unsound claims. Our framework provides practitioners with a principled way of critiquing the integrity of their own work and the work of others. We hope that this will help individuals conduct better science and encourage a cultural shift in our research community to identify and promulgate sound claims

    Programming Languages for Scalable Software Extension and Composition

    Full text link
    Large software systems are often constructed by reusing existing code. This dissertation describes several approaches that address the limitations of existing code reuse mechanisms such as class inheritance. The Polyglot design pattern enables software systems to be extended in a scalable way: the code required to extend the system is proportional to the amount of new functionality provided. This design pattern has been used to implement an extensible compiler framework. Nested inheritance is an object-oriented programming language mechanism that supports scalable extensibility in a safer, more natural way than the design pattern approach. Nested inheritance permits modular, type-safe extension of a package (including nested packages and classes), while preserving existing type relationships. Nested intersection extends nested intersection to enable composition and extension of two or more packages, combining their types and behavior while resolving conflicts with a relatively small amount of code. Nested intersection is implemented in the language J&. The utility of J& is demonstrated by using it to construct two composable, extensible frameworks: a compiler framework for Java, and a peer-to-peer networking system. Both frameworks support composition of extensions. For example, two compilers adding different, domain-specific features to Java can be composed to obtain a compiler for a language that supports both sets of features

    TABLE OF CONTENTS

    No full text
    For my parents. ii ACKNOWLEDGMENTS Thanks to my parents and to my brother Mark for their support. Thanks also go to my advisor Tony Hosking for letting me work for him, and to the other members of my thesis committee, Jens Palsberg and Aditya Mathur. I would also like to thank Steve Lennon and Quintin Cutts at the University of Glasgow for their input and bug reports and the rest of the PJama group at Glasgow and SunLabs. Thank you to Kumar Brahnmath for using BLOAT and for finding many of the bugs. Finally, thanks to Aria, Gustavo, Raghu, Mike, Anshul, and Shaogang. ii
    corecore