Results 1 - 10
of
10
Context-Oriented Programming
- Journal of Object Technology, March-April 2008, ETH Zurich
, 2008
"... Context-dependent behavior is becoming increasingly important for a wide range of application domains, from pervasive computing to common business applications. Unfortunately, mainstream programming languages do not provide mechanisms that enable software entities to adapt their behavior dynamically ..."
Abstract
-
Cited by 38 (6 self)
- Add to MetaCart
Context-dependent behavior is becoming increasingly important for a wide range of application domains, from pervasive computing to common business applications. Unfortunately, mainstream programming languages do not provide mechanisms that enable software entities to adapt their behavior dynamically to the current execution context. This leads developers to adopt convoluted designs to achieve the necessary runtime flexibility. We propose a new programming technique called Context-oriented Programming (COP) which addresses this problem. COP treats context explicitly, and provides mechanisms to dynamically adapt behavior in reaction to changes in context, even after system deployment at runtime. In this paper, we lay the foundations of COP, show how dynamic layer activation enables multi-dimensional dispatch, illustrate the application of COP by examples in several language extensions, and demonstrate that COP is largely independent of other commitments to programming style. 1
Scoped Dynamic Rewrite Rules
- Rule Based Programming (RULE’01), volume 59/4 of Electronic Notes in Theoretical Computer Science
, 2001
"... The applicability of term rewriting to program transformation is limited by the lack of control over rule application and by the context-free nature of rewrite rules. The first problem is addressed by languages supporting user-definable rewriting strategies. This paper addresses the second problem b ..."
Abstract
-
Cited by 18 (10 self)
- Add to MetaCart
The applicability of term rewriting to program transformation is limited by the lack of control over rule application and by the context-free nature of rewrite rules. The first problem is addressed by languages supporting user-definable rewriting strategies. This paper addresses the second problem by extending rewriting strategies with scoped dynamic rewrite rules. Dynamic rules are generated at run-time and can access variables available from their definition context. Rules generated within a rule scope are automatically retracted at the end of that scope. The technique is illustrated by means of several program tranformations: bound variable renaming, function inlining, and dead function elimination.
A Retargetable C compiler
- Design and Implementation. Benjamin/Cummings Publishing
, 1995
"... language design research not only because it shares many characteristics with Java, the current language of choice for such research, but also because it’s likely to see wide use. Language research needs a large investment in infrastructure, even for relatively small studies. This paper describes a ..."
Abstract
-
Cited by 16 (1 self)
- Add to MetaCart
language design research not only because it shares many characteristics with Java, the current language of choice for such research, but also because it’s likely to see wide use. Language research needs a large investment in infrastructure, even for relatively small studies. This paper describes a new C # compiler designed specifically to provide that infrastructure. The overall design is deceptively simple. The parser is generated automatically from a possibly ambiguous grammar, accepts C # source, perhaps with new features, and produces an abstract syntax tree, or AST. Subsequent phases—dubbed visitors—traverse the AST, perhaps modifying it, annotating it or emitting output, and pass it along to the next visitor. Visitors are specified entirely at compilation time and are loaded dynamically as needed. There is no fixed set of visitors, and visitors are completely unconstrained. Some visitors perform traditional compilation phases, but the more interesting ones do code analysis, emit non-traditional data such as XML, and display data structures for debugging. Indeed, most usage to date has been for tools, not for language design experiments. Such experiments use source-to-source transformations or extend existing visitors to handle new language features. These approaches are illustrated by adding a statement that switches on a type instead of a value, which can be implemented in a few hundred lines. The compiler also exemplifies the value of dynamic loading and of type reflection.
Aspect-Oriented Programming with Jiazzi
, 2003
"... We present aspect-oriented programming in Jiazzi. Jiazzi enhances Java with separately compiled, externally-linked code modules called units. Besides making programming in Java generally more modular, units are also effective "aspect" constructs that can separate concerns. The unit-linking metaphor ..."
Abstract
-
Cited by 12 (2 self)
- Add to MetaCart
We present aspect-oriented programming in Jiazzi. Jiazzi enhances Java with separately compiled, externally-linked code modules called units. Besides making programming in Java generally more modular, units are also effective "aspect" constructs that can separate concerns. The unit-linking metaphor provides a convenient and explicit way for programmers to explicitly control the inclusion and configuration of code that implements a concern, while separate compilation of units enhances concern independent development and deployment. The expressiveness of concern separation are enhanced by units in two ways. First, classes can be made open to the addition of new fields and methods by multiple units, which enables the direct modularization of concerns that crosscut objects. Second, the signatures of methods and classes used in a unit can be made open to refinement by other units, which makes it easier to integrate concern implementations by isolating them from the naming and calling requirements of shared methods and classes.
Dynamically Scoped Functions as the Essence of AOP
- ACM SIGPLAN Notices
, 2003
"... The aspect-oriented programming community devotes lots of energy into the provision of complex static language constructs to reason about eventual dynamic properties of a program. ..."
Abstract
-
Cited by 8 (2 self)
- Add to MetaCart
The aspect-oriented programming community devotes lots of energy into the provision of complex static language constructs to reason about eventual dynamic properties of a program.
A short overview of AspectL
- In European Interactive Workshop on Aspects in Software (EIWAS’04
, 2004
"... AspectL adds a number of features to the Common Lisp Object System (CLOS) that have been developed in the recent years in the AOSD community. According to the Lisp spirit, some of them have been generalized in the process of ..."
Abstract
-
Cited by 6 (5 self)
- Add to MetaCart
AspectL adds a number of features to the Common Lisp Object System (CLOS) that have been developed in the recent years in the AOSD community. According to the Lisp spirit, some of them have been generalized in the process of
Context-Oriented Programming: Beyond Layers ⋆
"... Abstract. While many software systems today have to be aware of the context in which they are executing, there is still little support for structuring a program with respect to context. A first step towards better context-orientation was the introduction of method layers. This paper proposes two add ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
Abstract. While many software systems today have to be aware of the context in which they are executing, there is still little support for structuring a program with respect to context. A first step towards better context-orientation was the introduction of method layers. This paper proposes two additional language concepts, namely the implicit activation of method layers, and the introduction of dynamic variables. 1
REQUEST-BASED MEDIATED EXECUTION BY
"... 1.1 Why customize a language?................................ 1 1.1.1 Creating domain-specific languages........................ 2 1.1.2 Reusing code in a new context.......................... 3 ..."
Abstract
- Add to MetaCart
1.1 Why customize a language?................................ 1 1.1.1 Creating domain-specific languages........................ 2 1.1.2 Reusing code in a new context.......................... 3
An Operational Semantics of Lexically-Scoped Dynamic Variables
"... Lexical and dynamic scoping are the two primary approaches to variable binding in functional programming languages. While medieval Lisp dialects commonly featured dynamic scoping, most languages today emphasize lexical scoping. This is a sensible choice: lexical scoping enables local reasoning about ..."
Abstract
- Add to MetaCart
Lexical and dynamic scoping are the two primary approaches to variable binding in functional programming languages. While medieval Lisp dialects commonly featured dynamic scoping, most languages today emphasize lexical scoping. This is a sensible choice: lexical scoping enables local reasoning about programs at the source code level. Nonetheless, dynamic variables are more appropriate for certain use cases, including implicit parameter passing. But do we really have to choose between lexical and dynamic scoping? A few systems, including the fluid-let macro and parameter objects in Scheme provide lexically-scoped dynamic variables. The semantics of such systems has thus far been presented only as implementations in terms of unrestricted mutable variables (e.g., using the set! operation). This article introduces λLD, a simple extension to the call-byvalue λ-calculus that supports lexically-scoped dynamic variables. The semantics of λLD does not rely upon any form of mutable state; and it is equivalent to the λ-calculus on terms not involving dynamic variables. Terms, including those containing dynamic variables, can be independently simplified and later composed; this allows for concurrent evaluation. The semantics of λLD has been implemented as a rewrite theory in Maude, allowing examples to be executed. The article shows how λLD can be used to model other forms of dynamic variables, as well as unique values, records and (functional) objects. 1.
Cleaning up after yourself
"... Performing cleanup actions such as restoring a variable or closing a file used to be impossible to guarantee in Forth before Forth-94 gave us catch. Even with catch, the cleanup code can be skipped due to user interrupts if you are unlucky. We introduce a construct that guarantees that the cleanup c ..."
Abstract
- Add to MetaCart
Performing cleanup actions such as restoring a variable or closing a file used to be impossible to guarantee in Forth before Forth-94 gave us catch. Even with catch, the cleanup code can be skipped due to user interrupts if you are unlucky. We introduce a construct that guarantees that the cleanup code is always completed. We also discuss a cheaper implementation approach for cleanup code than using a full exception frame. 1

