6 research outputs found

    A type system for context-dependent overloading.

    Get PDF
    This article presents a type system for context-dependent overloading, based on the notion of constrained types. These are types constrained by the definition of functions or constants of given types. This notion supports both overloading and a form of subtyping, and is related to Haskell type classes [11,2], System O [7] and other systems with constrained types. We study an extension of the Damas-Milner system [4,1] with constrained types. The inference system presented uses a context-dependent overloading policy, which is specified by means of a predicate used in a single inference rule. The idea simplifies the treatment of overloading, enables the simplification of inferred types (by means of class type annotations), and is adequate for use in a type system with higher-order types

    Type Interference for Java Bytecodes

    Get PDF
    Dynamic binding (dispatch) in object-oriented languages prevents compilers from performing static optimizations, such as method inlining. Type Inference, a static optimization technique, helps eliminate dynamic binding by providing compilers with receiver class type information for virtual method invocations during compile time instead of runtime. Type Inference has been implemented on SELF, a pure object-oriented language, and proven effective by inlining (statically binding) 95% of virtual method calls. It has also been tested on other object-oriented languages, and results indicate that the technique is just as effective on other languages as it is on SELF. This research evaluates the effectiveness of Type Inference on Java Bytecodes using the Cartesian Product Algorithm. The technique is applied to a bytecode-to-bytecode optimizer, which reads and parses a Java class file, perforins dataflow analysis and type inference on the bytecodes, performs optimization by eliminating virtual method invocations, and recompiles the modified bytecode into a new Java class file. Evidence resulting from this research indicates that Concrete Type Inference is an effective optimization technique for object-oriented languages, including Java. More importantly, the technique was successfully implemented and tested on Java Bytecodes. The results are not outstanding; however, some improvements are evident from the results. Further improvements should be possible by implementing other optimization techniques, such as method inlining and side-effect analysis

    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

    Advanced flow-based type systems for object-oriented languages

    Get PDF
    Ph.DDOCTOR OF PHILOSOPH

    Constrained types and their expressiveness

    No full text

    Constrained Types and their Expressiveness

    No full text
    A constrained type consists of both a standard type and a constraint set. Such types enable efficient type inference for objectoriented languages with polymorphism and subtyping, as demonstrated by Eifrig, Smith, and Trifonov. Until now, it has been unclear how expressive constrained types are. In this paper we prove that for a language without polymorphism, constrained types accept the same programs as the type system of Amadio and Cardelli with subtyping and recursive types. This result gives a precise connection between constrained types and the standard notion of type. 1 Introduction A constrained type consists of both a standard type and a constraint set. For example, x:xx : (v ! w) n fv v ! wg Here, v and w are type variables. This typing says that the -term x:xx has every type of the form v ! w where v; w satisfy the constraint v v ! w. Jens Palsberg, Laboratory for Computer Science, Massachusetts Institute of Technology, NE43-340, 545 Technology Square, Cambridg..
    corecore