9 research outputs found

    Combining Event-driven and Capsule-oriented Programming to Improve Integrated System Design

    Get PDF
    As concurrent software becomes more pervasive, models that provide both safe concurrency and modular reasoning become more important. Panini is one such model, and provides both sparse and cognizant interference based around the concept of capsules. Additionally, web frameworks, Graphical User Interface (GUI) libraries, and other projects are event-driven in nature, making events a commonly used programming paradigm for certain tasks. However, it would be difficult to use Panini in an event-driven manner, where there may be multiple capsules interested in a given event. Therefore, by integrating capsules and events one would be able to apply Panini\u27s modular reasoning to commonly event-driven tasks more easily. Several challenges must be addressed in he integration. These are defining the semantics of event messages, scheduling of handlers to maximize concurrency, and how to keep to Panini\u27s current semantics which allow modular reasoning. To solve this problem, @Paninij, an implementation of Panini, is extended to add event mechanisms to capsules. As a result, this new combined model allows capsules to interact using both procedures and event announcements. This extension of Panini is helpful for writing concurrent, modular software that lends itself more naturally to event-driven programming

    AspectJML: modular specification and runtime checking for crosscutting contracts

    Get PDF
    Aspect-oriented programming (AOP) is a popular technique for modularizing crosscutting concerns. In this context, researchers have found that the realization of design by contract (DbC) is crosscutting and fares better when modularized by AOP. However, previous efforts aimed at supporting crosscutting contract modularity might actually compromise the main DbC principles. For example, in AspectJ-style, reasoning about the correctness of a method call may require a whole-program analysis to determine what advice applies and what that advice does relative to DbC implementation and checking. Also, when contracts are separated from classes a programmer may not know about them and may break them inadvertently. In this paper we solve these problems with AspectJML, a new specification language that supports crosscutting contracts for Java code. We also show how AspectJML supports the main DbC principles of modular reasoning and contracts as documentation

    A unified design of capsules

    Get PDF
    The process of reading, writing, and reasoning about concurrent programs benefits from better abstractions for concurrency than what many common languages, such as Java, offer. Capsule-oriented programming and the Panini language utilize the idea of combining state and control within a linguistic mechanism along with asynchronous message passing to provide sequentially trained programmers with an actor-like language that preserves the expected sequential semantics. The initial design of the Panini language splits the world into two distinct elements – capsules and systems. A capsule acts as the unit of both modularity and concurrency in the program. A system acts as the sole point of composition for capsule instances. The problem is that the dichotomy between systems and capsules leads to uncomposable and non-modular programs. The connections between capsule instances in a system declaration are fixed at exactly one point and all capsules instances in program must be declared and connected to each other at a single block of code. This thesis will explore the implications on modularity and reuse of systems when a basic design decision – separating capsules and systems – is relaxed to allow a capsule to declare an internal composition of other capsule instances

    Design, Semantics and Implementation of the Ptolemy Programming Language: A Language with Quantified Typed Events

    Get PDF
    Implicit invocation (II) and aspect-oriented (AO) languages provide software designers with related but distinct mechanisms and strategies for decomposing programs into modules and composing modules into systems. II languages have explicitly announced events that run registered observer methods. AO languages have implicitly announced events that run method-like but more powerful advice. A limitation of II languages is their inability to refer to a large set of events succinctly. They also lack the expressive power of AO advice. Limitations of AO languages include potentially fragile dependence on syntactic structure that may hurt maintainability, and limits on the available set of implicit events and the reflective contextual information available. Quantified, typed events, as implemented in our language Ptolemy, solve all these problems. This paper describes Ptolemy and explores its advantages relative to both II and AO languages

    Formal foundations for hybrid effect analysis

    Get PDF
    Type-and-effect systems are a powerful tool for program construction and verification. Type-and-effect systems are useful because it can help reduce bugs in computer programs, enable compiler optimizations and also provide sort of program documentation. As software systems increasingly embrace dynamic features and complex modes of compilation, static effect systems have to reconcile over competing goals such as precision, soundness, modularity, and programmer productivity. In this thesis, we propose the idea of combining static and dynamic analysis for effect systems to improve precision and flexibility. We describe intensional effect polymorphism, a new foundation for effect systems that integrates static and dynamic effect checking. Our system allows the effect of polymorphic code to be intensionally inspected. It supports a highly precise notion of effect polymorphism through a lightweight notion of dynamic typing. When coupled with parametric polymorphism, the powerful system utilizes runtime information to enable precise effect reasoning, while at the same time retains strong type safety guarantees. The technical innovations of our design include a relational notion of effect checking, the use of bounded existential types to capture the subtle interactions between static typing and dynamic typing, and a differential alignment strategy to achieve efficiency in dynamic typing. We introduce the idea of first-class effects, where the computational effect of an expression can be programmatically reflected, passed around as values, and analyzed at run time. A broad range of designs “hard-coded in existing effect-guided analyses can be supported through intuitive programming abstractions. The core technical development is a type system with a couple of features. Our type system provides static guarantees to application-specific effect management properties through refinement types, promoting “correct-by-design effect-guided programming. Also, our type system computes not only the over-approximation of effects, but also their under-approximation. The duality unifies the common theme of permission vs. obligation in effect reasoning. Finally, we show the potential benefit of intensional effects by applying it to an event-driven system to obtain safe concurrency. The technical innovations of our system include a novel effect system to soundly approximate the dynamism introduced by runtime handlers registration, a static analysis to precompute the effects and a dynamic analysis that uses the precomputed effects to improve concurrency. Our design simplifies modular concurrency reasoning and avoids concurrency hazards

    On Exceptions, Events and Observer Chains

    Get PDF
    Modular understanding of behaviors and flows of exceptions may help in their better use and handling. Such reasoning tasks about exceptions face unique challenges in event-based implicit invocation (II) languages that allow subjects to implicitly invoke observers, and run the observers in a chain. In this work, we illustrate these challenge in Ptolemy and propose Ptolemyχ that enables modular reasoning about behaviors and flows of exceptions for event announcement and handling. Ptolemyχ’s exception-aware specification expressions and boundary exceptions limit the set of (un)checked exceptions of subjects and observers of an event. Exceptional postconditions specify the behaviors of these exceptions. Greybox specifications specify the flows of these exceptions among the observers in the chain. Ptolemyχ’s type system and refinement rules enforce these specifications and thus enable its modular reasoning. We evaluate the utility of Ptolemyχ’s exception flow reasoning by applying it to understand a set of aspect-oriented (AO) bug patterns. We also present Ptolemyχ’s semantics including its sound static semantics

    On exceptions, events and observer chains

    No full text
    Modular understanding of behaviors and flows of exceptions may help in their better use and handling. Such reasoning tasks about exceptions face unique challenges in event-based implicit invocation (II) languages that allow subjects to implicitly invoke observers, and run the observers in a chain. In this work, we illustrate these challenge in Ptolemy and propose Ptolemy-X that enables modular reasoning about behaviors and flows of exceptions for event announcement and handling. Ptolemy-X's exception-aware specification expressions and boundary exceptions limit the set of (un)checked exceptions of subjects and observers of an event. Exceptional postconditions specify the behaviors of these exceptions. Greybox specifications specify the flows of these exceptions among the observers in the chain. Ptolemy-X's type system and refinement rules enforce these specifications and thus enable its modular reasoning. We evaluate the utility of Ptolemy-X's exception flow reasoning by applying it to understand a set of aspect-oriented (AO) bug patterns. We also present Ptolemy-X's semantics including its sound static semantics.This is a manuscript of a proceeding published as Mehdi Bagherzadeh, Hridesh Rajan and Ali Darvish, ``On Exceptions, Events and Observer Chains," 12th International Conference on Aspect-Oriented Software Development (AOSD '13), Fukuoka, Japan, March 24-29, 2013. DOI: 10.1145/2451436.2451458. Posted with permission.</p

    On Exceptions, Events and Observer Chains

    Get PDF
    Modular understanding of behaviors and flows of exceptions may help in their better use and handling. Such reasoning tasks about exceptions face unique challenges in event-based implicit invocation (II) languages that allow subjects to implicitly invoke observers, and run the observers in a chain. In this work, we illustrate these challenge in Ptolemy and propose Ptolemy-X that enables modular reasoning about behaviors and flows of exceptions for event announcement and handling. Ptolemy-X's exception-aware specification expressions and boundary exceptions limit the set of (un)checked exceptions of subjects and observers of an event. Exceptional postconditions specify the behaviors of these exceptions. Greybox specifications specify the flows of these exceptions among the observers in the chain. Ptolemy-X's type system and refinement rules enforce these specifications and thus enable its modular reasoning. We evaluate the utility of Ptolemy-X's exception flow reasoning by applying it to understand a set of aspect-oriented (AO) bug patterns. We also present Ptolemy-X's semantics including its sound static semantics.</p
    corecore