[213] | A Mostly CPS, Partly ANF Translation of Dependent Types (Youyou Cong, Hironori Kawazoe and Hidehiko Masuhara), Talk at the 36th Symposium on Implementation and Application of Functional Languages (IFL 2024), 2024. [bibtex] [url] [PDF] [slides] [abstract] Type-preserving compilation serves as a lightweight approach to building safe and correct compilers. In particular, dependent-type-preserving compilation makes it possible to preserve detailed specifications of source programs throughout the compilation process. We present a CPS translation of a dependently typed language that yields no administrative redexes and preserves types. We show that defining such a translation is non-trivial, and we solve the challenge by representing certain continuations using a let expression. The resulting translation yields terms that are mostly in CPS but partly in ANF. |
[212] | Daisy: A Block-Based Environment for Learning Data Modeling (Jessica Belicia Cahyono, Youyou Cong and Hidehiko Masuhara), Talk at the 36th Symposium on Implementation and Application of Functional Languages (IFL 2024), 2024. [bibtex] [url] [PDF] [slides] [abstract] When solving a problem through programming, we start with data modeling, i.e., defining data structures in a programming language that represent information in the problem description. Despite its crucial role in program design, data modeling is difficult for novice programmers. The main reasons include the lack of clear instructions, the need for syntax knowledge, and unavailability of feedback when solving problems on their own. We aim to support learners in mastering data modeling skills. To achieve this goal, we elaborate on the steps of the data modeling process and implement a block-based environment Daisy for solving data modeling exercises. We also report the results from a preliminary experiment, which shows the potential usefulness of Daisy. |
[211] | Formalizing an Object-Oriented Programming Language with Delimited Control (Akane Taniguchi, Youyou Cong and Hidehiko Masuhara), Talk at the 36th Symposium on Implementation and Application of Functional Languages (IFL 2024), 2024. [bibtex] [url] [PDF] [slides] [abstract] Delimited continuations are a tool for expressing complex control flow, and they are supported in languages of different paradigms. To ensure safety of languages with delimited continuations, it is important to develop a mathematical formalization of those languages. In this paper, we formalize an object-oriented language with delimited control operators shift and reset. Our approach is to represent continuations as $\lambda$-expressions. This allows us to treat continuations as first-class values, but it also increases the complexity of programs due to Java’s requirement for type annotations. |
[210] | A Block-Based Environment for Learning Data Modeling (Jessica Belicia Cahyono, Youyou Cong and Hidehiko Masuhara), The 26th JSSST Workshop on Programming and Programming Languages, 2024. (Poster Presentation) [bibtex] [url] [PDF] [abstract] When solving a problem through programming, we start by doing data modeling, i.e. converting information in the problem statement, which is written in natural language, into data, which is written in a programming language. This conversion is difficult for novice programmers, as it requires them to precisely follow the programming language's syntax. Also, it is hard to automatically check the correctness of the data definition. We propose a block-based environment that provides exercises to assist learners in representing information as data. The use of blocks has two advantages. First, it reduces the burden of remembering programming language syntax, allowing learners to focus on the essential task. Second, it enables the automatic generation of feedback on learner's answers. So far, we have designed and implemented the environment where learners use provided keywords to construct data definitions while receiving feedback on possibly incomplete data definitions. In this presentation, we demonstrate the current implementation of our environment. |
[209] | Preventing Metadata Leakage in Communication over Public Channels (Jacob Lindahl, Hidehiko Masuhara and Youyou Cong), The 26th JSSST Workshop on Programming and Programming Languages, 2024. (Poster Presentation) [bibtex] [url] [PDF] |
[208] | Compilation Semantics for a Programming Language with Versions (Yudai Tanabe, Lubis Luthfan Anshar, Tomoyuki Aotani and Hidehiko Masuhara), 2024. (reproduction of the APLAS 2023 talk [tanabe2023aplas] at JSSST Programming and Programming Languages Workshop) [bibtex] [url] |
[207] | An Intrinsically Typed Compiler for Algebraic Effect Handlers (Syouki Tsuyama, Youyou Cong and Hidehiko Masuhara), In Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation (PEPM 2024), ACM, 2024. [bibtex] [url] [doi] [PDF] [slides] [abstract] A type-preserving compiler converts a well-typed input program into a well-typed output program. Previous studies have developed type-preserving compilers for various source languages, including the simply-typed lambda calculus and calculi with control constructs. Our goal is to realize type-preserving compilation of languages that have facilities for manipulating first-class continuations. In this paper, we focus on algebraic effects and handlers, a generalization of exceptions and their handlers with resumable continuations. Specifically, we choose an effect handler calculus and a typed stack-machine-based assembly language as the source and the target languages, respectively, and formalize the target language and a type preserving compiler. The main challenge posed by first-class continuation is how to ensure safety of continuation capture and resumption, which involves concatenation of unknown stacks. We solve this challenge by incorporating stack polymorphism, a technique that has been used for compilation from a language without first-class continuations to a stack-based assembly language. To prove that our compiler is type preserving, we implemented the compiler in Agda as a function between intrinsically typed ASTs. We believe that our contributions could lead to correct and efficient compilation of continuation-manipulating facilities in general. |
[206] | Compilation Semantics for a Programming Language with Versions (Yudai Tanabe, Lubis Luthfan Anshar, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 21st Asian Symposium on Programming Languages and Systems (APLAS 2023) (Chung-Kil Hur, ed.), 2023. (to appear, the full-version of this paper is available at https://arxiv.org/abs/2310.00298) [bibtex] [url] [PDF] [abstract] Programming with versions is a paradigm that allows a program to use multiple versions of a module so that the programmer can selectively use functions from both older and newer versions of a single module. Previous work formalized $\lambda$VL, a core calculus for programming with versions, but it has not been integrated into practical programming languages. In this paper, we propose VL, a Haskell-subset surface language for $\lambda$VL along with its compilation method. We formally describe the core part of the VL compiler, which translates from the surface language to the core language by leveraging Girard’s translation, soundly infers the consistent version of expressions along with their types, and generates a multi-version interface by bundling specific-version interfaces. We conduct a case study to show how VL supports practical software evolution scenarios and discuss the method’s scalability. |
[205] | Typed Equivalence of Labeled Effect Handlers and Labeled Delimited Control Operators. (Kazuki Ikemori, Youyou Cong and Hidehiko Masuhara), In Proceedings of the 25th International Symposium onPrinciples and Practice of Declarative Programming (PPDP 2023), 2023. [bibtex] [url] [doi] [PDF] [abstract] Algebraic effect handlers and delimited control operators are language facilities for expressing computational effects. Their labeled variations can express multiple kinds of exceptions, multiple states, and so on. We prove that labeled effect handlers and labeled control operators have equal expressive power. To show this, we develop a type-sound calculus for each facility and define macro translations between the typed calculi. The established equivalence can be used to understand and implement one facility in terms of the other. |
[204] | A Systematic Literature Review on the Impact of Formatting Elements on Code Legibility (Delano Oliveira, Reydne Santos, Fernanda Madeiral, Hidehiko Masuhara and Fernando Castor), In The Journal of Systems and Software, volume 203, 2023. (accepted: 2023-04-24, available online: 2023-04-28) [bibtex] [url] [doi] [PDF] [abstract] Context: Software programs can be written in different but functionally equivalent ways. Even though previous research has compared specific formatting elements to find out which alternatives affect code legibility, seeing the bigger picture of what makes code more or less legible is challenging. Goal: We aim to find which formatting elements have been investigated in empirical studies and which alternatives were found to be more legible for human subjects. Method: We conducted a systematic literature review and identified 15 papers containing human-centric studies that directly compared alternative formatting elements. We analyzed and organized these formatting elements using a card-sorting method. Results: We identified 13 formatting elements (e.g., indentation) and 33 levels of formatting elements (e.g., two-space indentation), which are about formatting styles, spacing, block delimiters, long or complex code lines, and word boundary styles. While some levels were found to be statistically better than other equivalent ones in terms of code legibility, e.g., appropriate use of indentation with blocks, others were not, e.g., formatting layout. For identifier style, we found divergent results, where one study found a significant difference in favor of camel case, while another study found a positive result in favor of snake case. Conclusion: The number of identified papers, some of which are outdated, and the many null and contradictory results emphasize the relative lack of work in this area and underline the importance of more research. There is much to be understood about how formatting elements influence code legibility before the creation of guidelines and automated aids to help developers make their code more legible. |
[203] | Program State Visualizer with User-Defined Representation Conversion (Rifqi Adlan Apriyadi, Hidehiko Masuhara and Youyou Cong), In Proceedings of the 1st ACM International Workshop on Future Debugging Techniques (Elisa Gonzalez Boix, Christophe Scholliers, eds.), ACM, 2023. [bibtex] [url] [doi] [PDF] [abstract] Conventional non-visual tree-based debuggers possess comprehensibility issues, which include the obscurity of object references, patterns, and overall program structure. Visual debuggers — specifically, ones that display an object diagram to represent the program state — alleviate these issues for imperative programming languages whose very states are directly manipulated by the programmer's statements. However, these debuggers are also prone to clutter when representing large program states from visualizing too much information. Additionally, the visualized program state can often differ from its conceptual abstraction on paper. We propose user-defined representation conversion which allows users to convert concrete representations of program states to their more focused and abstracted conceptual versions. We design a DSL such that users can specify conversions to manipulate displayed nodes and edges based on object types, references, values, or debugger halt locations. We implemented a prototype of this concept for Java. |
[202] | Mind the Error Message: an Inverted Quiz Format to Direct Learner's Attention to Error Messages (Kazuhiro Tsunoda, Hidehiko Masuhara and Youyou Cong), In Proceedings of the 2023 Conference on Innovation and Technology in Computer Science Education V. 1, ACM, 2023. [bibtex] [url] [doi] [PDF] [abstract] Novice learners of programming tend to neglect error messages, even though the messages have a lot of useful information for solving problems. While there exists research that aims to user-friendly error messages by changing the wording and by adding visual assistance, most of them do not focus on drawing learners' attention to error messages. We propose \emphthe enbugging quiz, a novel quiz format that requests the learner to craft a program that produces a specified error. This paper reports our design of enbugging quizzes and reports the results of our initial experiment, where we observed positive effects on the learners' attitudes towards error messages. |
[201] | An expressive and modular layer activation mechanism for Context-Oriented Programming (Paul Leger, Nicolás Cardozo and Hidehiko Masuhara), In Information and Software Technology, volume 156, 2023. [bibtex] [url] [doi] [PDF] [abstract] Context. There is a trend in the software industry towards building systems that dynamically adapt their behavior in response to their surrounding environment, given the proliferation of various technological devices, such as notebooks, smartphones, and wearables, capable of capturing their execution context. Context-oriented Programming (COP) allows developers to use layer abstractions to adapt software behavior to the context. A layer is associated with a context and can be dynamically activated in direct response to gathered information from its surrounding execution environment. However, most existing layer activation mechanisms have been tailored specifically to address a particular concern; implying that developers need to tweak layer definitions in contortive ways or create new specialized activation mechanisms altogether if their specific needs are not supported. Objective. Complementing ideas to expressively declare activation mechanism models with interfaces that define conditionals of activation mechanisms modularly, this paper proposes an Expressive and Modular Activation mechanism, named EMA. Method. To propose EMA, we analyze existing activation mechanisms in COP regarding activation features and scope strategies. After, we propose the design of EMA and validate it with a case study discussion. Results. Using a concrete JavaScript implementation of EMA, named EMAjs, we can implement two Web applications: a smartphone application as an example to illustrate EMAjs in action, and an application of home automation to discuss and compare our proposal. Conclusions. Our proposed mechanism allows developers to instantiate different activation scope strategies and interfaces to decouple the declaration of activation mechanism conditionals from the base code. |
[200] | Visual Debugger with a Programmatically Customizable View (Rifqi Adlan Apriyadi, Hidehiko Masuhara and Youyou Cong), The 25th JSSST Workshop on Programming and Programming Languages, 2023. (Poster Presentation) [bibtex] [url] [PDF] |
[199] | Interpreter Taming to Realize Multiple Compilations in a Meta-Tracing JIT Compiler Framework (Yusuke Izawa, Hidehiko Masuhara and Carl Friedrich Bolz-Tereick), Talk at the MoreVMs workshop 2023, 2023. [bibtex] [url] [slides] [abstract] There exist a wide range of JIT compilation policies with different compilation scopes, such as method-based, trace-based, region-based, etc. These heavyweight compilation techniques can produce fast machine code but consume compilation time. Suppose such a heavyweight compilation is applied to non-frequently executed code parts (here we call warm spots). In that case, the overhead of compilation time could be inevitable since little benefit could be obtained. To avoid this problem, today's VMs employ a lightweight compiler that generates machine code quickly instead of applying time-consuming optimizations. For example, current Java and JavaScript VMs have multiple compilers – HotSpot has C1/C2, V8 has Ignition/Turbofan, and JavaScriptCore has Baseline/DFG/FTL compilers. By applying heavyweight compilation to hot spots and lightweight compilation to not hot but warm spots, today's VMs balance code quality and compilation time. This multilevel compilation technique is important because a larger application tends to have a small area of hot spots. The RPython framework is a toolchain that generates a VM equipped with a heavyweight trace-based JIT compiler from a bytecode interpreter. Although RPython makes it easier to create a high-performance VM, there is a dilemma: the generated VMs are hard to extend because they need to use the fixed VM components provided by RPython. Given this context, if one wishes to realize a lightweight compilation or a new heavyweight compilation with a new compilation scope, it requires much engineering effort to implement them by extending the meta-tracing JIT compiler. We propose Multilevel RPython, which can perform two-level compilation with different compilation scopes. The compilation level of Multilevel RPython consists of a lightweight level, which emits method-based threaded code, and a heavyweight level, which emits trace-based optimizing code. Multilevel RPython is realized not by creating different compilers from scratch but by taming a bytecode interpreter given to the RPython toolchain. In other words, the lightweight compilation is performed by an interpreter tamed for threaded code generation, and the heavyweight compilation is used for tracing JIT compilation. In this talk, we present the implementation status of Multilevel RPython. In particular, we implemented an inline caching technique for threaded code generation and a prototype of the compilation-level shifting mechanism. Both techniques are realized by taming the definition of an interpreter and a slight modification for the meta-tracing compiler. The microbenchmark evaluation showed that inline caching makes threaded code generation approximately 20% faster than threaded code generation without the inline caching technique. In addition, we conducted a multilevel JIT experiment on an application combining large benchmark programs to simulate a real-world workload. This experiment shows the multilevel JIT compilation on Multilevel RPyhon is about 14% faster. |
[198] | Toward Parameterized Versions in Object-oriented Version Programming (Lubis Luthfan Anshar, Hidehiko Masuhara and Youyou Cong), The 25th JSSST Workshop on Programming and Programming Languages, 2023. (Poster Presentation) [bibtex] [url] [PDF] |
[197] | BatakJava: an Object-Oriented Programming Language with Versions (Lubis Luthfan Anshar, Yudai Tanabe, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering (SLE 2022) (Lola Burgueño, Walter Cazzola, eds.), 2022. [bibtex] [url] [doi] [PDF] [abstract] Programming with versions is a recent proposal that supports multiple versions of software components in a program. Though it would provide greater freedom for the programmer, the concept is only realized as a simple core calculus, called łambdaVL, where a value consists of łambda-terms with multiple versions. We explore a design space of programming with versions in the presence of data structures and module systems, and propose BatakJava, an object-oriented programming language in which multiple versions of a class can be used in a program. This paper presents BatakJava's language design, its core semantics with subject reduction, an implementation as a source-to-Java translator, and a case study to understand how we can exploit multiple versions in BatakJava for developing an application program with an evolving library. |
[196] | Mio: a Block-Based Environment for Program Design (Junya Nose, Youyou Cong and Hidehiko Masuhara), In Proceedings of the 2022 ACM SIGPLAN International Symposium SPLASH-E (SPLASH-E 2022) (Martin Henz, Benjamin Lerner, eds.), ACM, 2022. [bibtex] [url] [doi] [PDF] [abstract] Program design should be taught with a comprehensible guideline and appropriate tool support. While the program design recipe serves as a good guideline for novice learners, no existing tool provides sufficient support for step-by-step design. We propose Mio, an environment for designing programs based on the design recipe. In Mio, the programmer uses blocks to express designs, such as example input and output data. The system checks the consistency of the design, gives feedback to the programmer, and produces a half-completed program for steps after designing. A preliminary experiment in the classroom showed its ability to make program design easier for beginners, and to encourage programmers to follow the design recipe. In this paper, we demonstrate the core features of Mio, report the results of the experiment, and discuss our plans for extensions. |
[195] | Interactive Visual Debugger with a Customizable View (Rifqi Adlan Apriyadi, Hidehiko Masuhara and Youyou Cong), In Proceedings of the 39th JSSST Annual Conference (Shimpei Hayashi, ed.), 2022. [bibtex] [url] [PDF] [abstract] Visual debuggers provide more concrete representations of program behavior than what might normally still be abstract. For object-oriented languages, their object-centric components, such as objects and their relationships, are the information their visual debuggers aim to concretize. However, none of such debuggers provide the capability to customize their graphical view. Customization ought to facilitate better comprehensibility of the program behavior, which consequently aids in bug discovery, by allowing for a more focused program state view. This can be achieved by customizing the representation of objects of a class in accordance with the theoretical concept, or by abstracting away unnecessary information. This research proposes a visual debugger for Java with customization features for its graphical view that allows users to customize the visual representation of the program state through customization specifications. To provide flexible customizability, the proposed system would provide customization elements that function as building blocks for users to use in their specifications. |
[194] | Supporting Multiple Inheritance in an Object-Oriented DSL for GPGPU by Class Hierarchy Transformation (Fathul Asrar Alfansuri, Hidehiko Masuhara, Lubis Luthfan Anshar and Youyou Cong), In Proceedings of the 39th JSSST Annual Conference (Shimpei Hayashi, ed.), 2022. [bibtex] [url] [PDF] [abstract] Object-support in GPGPU domain specific languages (DSL) enables highly parallel object-oriented programming on GPUs. This paper improves object-support in Sanajeh, a Python DSL for GPGPU, by adding a multiple inheritance feature. Existing Sanajeh is restricted to single inheritance, which has limited flexibility. This restriction is due to its backend library which is not trivial to be extended. The limitation makes it difficult for Sanajeh to represent multiple classes that share common behaviors but belong to different class hierarchies. Our approach transforms a multiple inheritance class hierarchy into a single inheritance class hierarchy through mixin linearization, class duplication and wrapper functions at the Python level. We evaluate this work by rewriting agent-based modeling simulation program. We then compare the original and rewritten version with respect to their execution result and code effectiveness. The execution time is 2% slower than the original code. |
[193] | How Many Mutex Bugs can a Simple Analysis Find in Go Programs? (Fumi Takeuchi, Hidehiko Masuhara, Raffi Khatchadourian, Youyou Cong and Keisuke Ishibashi), In Proceedings of the 39th JSSST Annual Conference (Shimpei Hayashi, ed.), 2022. [bibtex] [url] [PDF] [abstract] In open source software, it is known that there are many concurrenc ybugs. A previous study in Go revealed that a considerable number of such bugs are simple (for example, 9% of the bugs are the ones that forget to unlock a mutex,) through a manual program investigation. This paper tries to detect such bugs by applying a simple analysis in order to see how far such a tool can match the manual analysis. We built a simple intraprocedural control flow analysis in Go, and evaluated its performance with respect to the open source programs with concurrency bugs reported in the previous study. Consequently, as for quality, the recall is good at 88% and the precision is poor at 60%, and as for analysis time, it can be finished within practical amount of time (for example, 1 second per 5000 LoC). |
[192] | Taming an Interpreter for Threaded Code Generation with a Tracing JIT Compiler (Yusuke Izawa and Hidehiko Masuhara), Talk at the Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems (ICOOOLPS'22), 2022. [bibtex] [url] [PDF] [abstract] Modern virtual machines support a multitier JIT compilation strategy to balance the code quality and compilation time. This strategy brings many benefits to the user. However, it is hard for virtual machine developers to build and maintain multiple compilers in a single managed runtime. In this work-in-progress paper, we describe the problem that occurred by our use of a meta-tracing JIT compiler and propose a solution to it based on our previous work. Our preliminary performance evaluation of the compilation and execution times suggests that the proposed threaded code generation is promising as a lower-tier runtime compiler in a multitier JIT compilation system. |
[191] | Efficient Object Graph Recording with Truffle for Live Data-Structure Programming (Shusuke Takahashi, Yusuke Izawa, Hidehiko Masuhara and Youyou Cong), Talk at the Truffle/GraalVM Languages Workshop (Truffle 2022), 2022. [bibtex] [url] [abstract] Live data-structure programming environments lively visualizes objects created in a program execution as a node=link diagram. Their implementations need to record an object graph (i. e., objects and their mutual references) at every point of execution. In our previous paper, we proposed an implementation of the Kanon live programming environment that collects object graphs by creating a modified GraalJS, a JavaScript implementation with Graal/Truffle, that records object creation and modification events. This talk discusses the feasibility of our approach that uses a meta-compiler framework for recording fine-grained program execution logs with respect to its efficiency and ability to support multiple languages. |
[190] | An Approach to Collecting Object Graphs for Data-structure Live Programming Based on a Language Implementation Framework (Shusuke Takahashi, Yusuke Izawa, Hidehiko Masuhara and Youyou Cong), In Journal of Information Processing, volume 30, 2022. (Presented at IPSJ SIG PRO Workshop [takahashi2021ipsj-pro136]. Accepted on 2022-01-11. A preprint is also archived as IPSJ Transaction on Programming, 15(2), May 2022) [bibtex] [url] [doi] [PDF] [abstract] Data-structure live programming environments execute programs, collect object graphs (objects and their mutual references) created and modified during the execution, and visualize the graphs as a node-link diagram. Existing implementations collect object graphs by instrumenting checkpoints, at which the system traverses reachable objects, at every necessary point in the program. Since the cost of each checkpoint is proportional to the number of existing objects, the overhead of running checkpoints can be huge. This paper proposes (1) a technique to collect object graphs by recording object creation and modification events into an efficient data structure, and (2) an implementation design for the object graph collection mechanism by extending a language implemented on top of a language implementation framework. As a result, the overhead of object graph collection is almost proportional to the number of object creation/modification operations in total. We implemented the proposed mechanism for the Kanon data-structure live programming environment by extending GraalJS, a JavaScript implementation on the Graal/Truffle language implementation framework. We compared our new implementation against the original Kanon, which is based on checkpointing, and confirmed that our implementation improves program execution (and data collection) speed, and has sufficiently small overheads to reconstruct object graphs. |
[189] | A Step toward Programming with Versions in Real-World Functional Languages (Yudai Tanabe, Lubis Luthfan Anshar, Tomoyuki Aotani and Hidehiko Masuhara), In COP 2022: International Workshop on Context-Oriented Programming and Advanced Modularity (Collocated with ECOOP), ACM, 2022. [bibtex] [url] [PDF] [abstract] łambdaVL is a core calculus based on the concept of programming with versions that supports multiple versions of program definitions and values inherently in the semantics of a language. However, since łambdaVL was not designed as a surface language, its complex syntax and semantics only provide primitive constructs to manipulate versioned values. In order to realize the programming with versions concept in a real-world language, we propose a compilation method for functional languages through łambdaVL and discuss how real-world programs can be written in a Haskell-like functional language with versions. |
[188] | High-Level Programming Abstractions for GPGPU (Hidehiko Masuhara), Keynote talk at the 27th Workshop on Compiler Techniques and System Software for High-Performance and Embedding Computing (CTHPC 2022), 2022. [bibtex] [url] [abstract] General-purpose computing on graphics processing units (GPGPU) is an approach to achieve highly parallel and energy efficient computing. While there are a lot of low-level programming techniques to exploit GPU's peculiar performance characteristics, it is challenging to write parallel programs for GPGPU. This talk introduces the speaker's attempts to bring high-level programming abstractions into GPGPU. In particular, it presents a support for objects and their dynamic allocation, and discusses further abstractions for task parallelism and graph-processing. |
[187] | Towards Efficient Adjustment of Effect Rows (Naoya Furudono, Youyou Cong, Hidehiko Masuhara and Daan Leijen), In Trends in Functional Programming (Swierstra, Wouter, Wu, Nicolas, eds.), Springer International Publishing, volume 13401, 2022. [bibtex] [url] [doi] [PDF] [abstract] Koka is a functional programming language with native support for algebraic effects and handlers. To implement effect handler operations efficiently, Koka employs a semantics where the handlers in scope are passed down to each function as an evidence vector. At runtime, these evidence vectors are adjusted using the open constructs to match the evidence for a particular function. All these adjustments can cause significant runtime overhead. In this paper, we present a novel transformation on the Koka core calculus that we call open floating. This transformation aims to float up open constructs and combine them in order to minimize the adjustments needed at runtime. Open floating improves performance by 2.5 times in an experiment. Furthermore, we formalize an aspect of row-based effect typing, including the closed prefix relation on effect rows, which clarifies the constraint on open floating. |
[186] | Sound and Complete Type Inference for Closed Effect Rows (Kazuki Ikemori, Youyou Cong, Hidehiko Masuhara and Daan Leijen), In Trends in Functional Programming (Swierstra, Wouter, Wu, Nicolas, eds.), Springer International Publishing, volume 13401, 2022. [bibtex] [url] [doi] [PDF] [abstract] Koka is a functional programming language that has algebraic effect handlers and a row-based effect system. The row-based effect system infers types by naively applying the Hindley-Milner type inference. However, it infers effect-polymorphic types for many functions, which are hard to read by the programmers and have a negative runtime performance impact to the evidence-passing translation. In order to improve readability and runtime efficiency, we aim to infer closed effect rows when possible, and open those closed effect rows automatically at instantiation to avoid loss of typability. This paper gives a type inference algorithm with the open and close mechanisms. In this paper, we define a type inference algorithm with the open and close constructs. |
[185] | CodeMap: a Graphical Note-Taking Tool Cooperating with an Integrated Development Environment (Rikito Taniguchi and Hidehiko Masuhara), In Proceedings of the 8th Programming Experience Workshop (PX/22), Association for Computing Machinery, 2022. [bibtex] [url] [doi] [PDF] [abstract] Program comprehension is an important yet difficult activity in a software development process. One of the main causes of the difficulty is its cognitive overhead for maintaining the mental models, which consist of roles of program elements and relationships between them. Though researchers have been working on tools to help maintaining the mental models, existing tools have high adoption barrier and support only a few programming languages, which hinders wide-range of programmers from using the program comprehension tools. We propose CodeMap, a graphical note-taking tool for offloading the mental models onto a visual representation. We designed CodeMap by considering familiarity and availability for practitioners. Our tool allows programmers to extract interested information into a graphical note with a few keyboard/mouse operations, and support many programming languages by using the language server protocol. In this paper, we present the design and implementation of CodeMap, and discuss possible features that could be useful for program comprehension. |
[184] | Two-level Just-in-Time Compilation with One Interpreter and One Engine (Yusuke Izawa, Hidehiko Masuhara and Carl Friedrich Bolz-Tereick), The ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM 2022), 2022. [bibtex] [url] [PDF] [abstract] Modern, powerful virtual machines such as those running Java or JavaScript support multi-tier JIT compilation and optimization features to achieve their high performance. However, implementing and maintaining several compilers/optimizers that interact with each other requires hard-working of VM developers. In this paper, we propose a technique to realize two-level JIT compilation in RPython without implementing several interpreters or compilers from scratch. As a preliminary realization, we created adaptive RPython which performs both baseline JIT compilation based on threaded code and tracing JIT compilation. We also implemented the small programming language with it. Furthermore, we preliminary evaluated the performance in a small language, and our baseline JIT compilation achieved ran 1.77x faster than the interpreter-only execution. Furthermore, we observed that when we apply an optimal JIT compilation for different target methods, the performance was mostly the same as the one optimizing JIT compilation strategy, saving about 40 % of the compilation code size. |
[183] | Intrinsically-Typed Interpreters for Effectful Languages (Syouki Tsuyama, Youyou Cong and Hidehiko Masuhara), The 1st Workshop on the Implementation of Type Systems (WITS 2022), 2022. [bibtex] [url] [abstract] An intrinsically-typed interpreter is an implementation of the semantics of a programming language. A key feature of intrinsically-typed interpreters is that the type of the interpreter represents the type safety theorem of the object language. We are developing intrinsically-typed interpreters for languages with effects and coeffects. Our aim is to find general abstractions for hiding proof terms and thus enable concise implementation of effectful and coeffectful languages. At the workshop, we intend to discuss with the participants what kind of abstractions would be useful, as well as how to implement those abstractions. |
[182] | Threaded Code Generation with a Meta-tracing JIT Compiler (Yusuke Izawa, Hidehiko Masuhara, Carl Friedrich Bolz-Tereick and Youyou Cong), In Journal of Object Technology (Davide Ancona, Olivier Flückiger, Adrian Francalanza, Chris Seaton, eds.), volume 21, 2022. (Presented at ICOOOLPS 2021 [izawa2021icooolps]. Accepted December 2021.) [bibtex] [url] [doi] [PDF] [abstract] Language implementation frameworks, e.g., RPython and Truffle/Graal, are practical tools for creating efficient virtual machines, including a well-functioning just-in-time (JIT) compiler. It is demanding to support multitier JIT compilation in such a framework for language developers. This paper presents an idea to generate threaded code by reusing an existing meta-tracing JIT compiler, as well as an interpreter design for it. Our approach does not largely modify RPython itself but constructs an effective interpreter definition to enable threaded code generation in RPython. We expect our system to be extended to support multilevel JIT compilation in the RPython framework. We measured the potential performance of our threaded code generation by simulating its behavior in PyPy. We confirmed that our approach reduced code sizes by 80% and compilation times by 60% compared to PyPy's JIT compiler on average, and ran about 7% faster than the interpreter-only execution. |
[181] | Towards an Automated Code Rewriting Tool for Alleviating Concurrency Problems in the Go Programming Language (Fumi Takeuchi, Hidehiko Masuhara, Raffi Khatchadourian and Youyou Cong), (Takeo Imai, ed.), The 38th JSSST Annual Conference, 2021. (Poster Presentation) [bibtex] [url] |
[180] | Contextual Polymorphism Meets Bidirectional Effects (Kazuki Niimi, Youyou Cong, Hidehiko Masuhara and Jonathan Immanuel Brachthäuser), In In Proceedings of Workshop on Type-Driven Development 2021 (TyDe 2021), 2021. [bibtex] [url] [PDF] [abstract] Algebraic effects and handlers have found their way into programming languages. The past decade has seen different designs of calculi with support for effect handlers, as well as different variants of effect handlers developed for specific applications. In this paper, we study the extension of the Effekt language with bidirectional effects. Effekt is unique in its treatment of effect polymorphism, whereas bidirectional effects are useful for expressing bidirectional communication. We present a sound formalization of the extended Effekt language, and demonstrate several practical examples. |
[179] | Design with Blocks, Code in Text: A Hybrid Environment for Program Design Recipe (Junya Nose, Youyou Cong and Hidehiko Masuhara), Talk at Scheme Workshop 2021, 2021. [bibtex] [url] |
[178] | Threaded Code Generation with a Meta-tracing JIT Compiler (Yusuke Izawa, Hidehiko Masuhara, Carl Friedrich Bolz-Tereick and Youyou Cong), Talk at ICOOOLPS 2021, 2021. (Position paper is archived as arXiv:2106.12496. Revised article appears in JOT [izawa2022jot-icooolps].) [bibtex] [url] [PDF] [abstract] Language implementation frameworks such as RPython and Truffle/Graal are effective tools for creating a high-performance language with lower effort than implementing from scratch. The two frameworks support only a single JIT compilation strategy, trace-based compilation, and method-based compilation, but they have its own advantages and disadvantages. We proposed a meta-hybrid JIT compiler framework to take advantages of the two strategies as a meta-tracing JIT compiler framework. We also implemented a proof-of-concept framework called BacCaml. As a next step, in this position paper, we propose a new approach to realize a method-based baseline JIT compiler along with a trace-based JIT compilation. We aim to use it for further speed-up by preventing the path-divergence problem, which causes serious slow-down. We also show how to implement the baseline JIT compiler with minimal changes on the top of RPython. |
[177] | Signal Classes: A Mechanism for Building Synchronous and Persistent Signal Networks (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 35th European Conference on Object-Oriented Programming (ECOOP 2021) (Møller, Anders, Sridharan, Manu, eds.), Schloss Dagstuhl – Leibniz-Zentrum für Informatik, volume 194, 2021. [bibtex] [url] [doi] [PDF] [abstract] Signals are principal abstraction in reactive programming languages and constitute the basics of reactive computations in modern systems, such as the Internet of Things. Signals sometimes utilize past values, which leads to space leak, a problem where accumulated past values waste resources such as the main memory. Persistent signals, an abstraction for time-varying values with their execution histories, provide a generalized and standardized way of space leak management by leaving this management to the database system. However, the current design of persistent signals is very rudimental. For example, they cannot represent complex data structures; they can only be connected using pre-defined API methods that implicitly synchronize the persistent signal network; and they cannot be created dynamically. In this paper, we show that these problems are derived from more fundamental one: no language mechanism is provided to group related persistent signals. To address this problem, we propose a new language mechanism signal classes. A signal class packages a network of related persistent signals that comprises a complex data structure. A signal class defines the scope of synchronization, making it possible to flexibly create persistent signal networks by methods not limited to the use of pre-defined API methods. Furthermore, a signal class can be instantiated, and this instance forms a unit of lifecycle management, which enables the dynamic creation of persistent signals. We formalize signal classes as a small core language where the computation is deliberately defined to interact with the underlying database system using relational algebra. Based on this formalization, we prove the language's glitch freedom. We also formulate its type soundness by introducing an additional check of program well-formedness. This mechanism is implemented as a compiler and a runtime library that is based on a time-series database. The usefulness of the language is demonstrated through the vehicle tracking simulator and viewer case study. We also conducted a performance evaluation that confirms the feasibility of this case study. |
[176] | Nested Object Support in a Structure-of-Arrays Dynamic Objector Allocator (Jizhe Chenxin and Hidehiko Masuhara), Presentation at the ARRAY 2021 Workshop, co-located with PLDI 2021, 2021. [bibtex] [url] [PDF] [abstract] DynaSOAr is a dynamic object allocator for GPGPU that enables object-oriented programming with an efficient structure-of-arrays (SOA) memory layout. One of the limitations in DynaSOAr is its poor support for nested objects. When a class has a field of another class, the fields of the inner class are allocated in an arrays-of-structure layout. This paper proposes a technique that translates nested class definitions into flat ones by inlining inner classes into top-level classes. We implemented this technique as a Sanajeh domain-specific language that translates Python class definitions into C++ classes using DynaSOAr. Our preliminary evaluation showed that Sanajeh executes a parallel benchmark program with nested objects at almost the same speed as the one with manually flatten classes. |
[175] | Amalgamating Different JIT Compilations in a Meta-tracing JIT Compiler Framework (Yusuke Izawa and Hidehiko Masuhara), 2021. (reproduction of the DLS'20 talk [izawa2020dls] at JSSST Programming and Programming Languages Workshop) [bibtex] [url] |
[174] | An Interpreter Design for Supporting Different JIT Compilations in RPython Framework (Yusuke Izawa, Hidehiko Masuhara and Youyou Cong), The 23rd JSSST Workshop on Programming and Programming Languages, 2021. (Poster Presentation) [bibtex] [url] [abstract] Most modern programming languages, such as Java, JavaScript, and PHP, have a just-in-time (JIT) compiler for achieving their fast runtime. Method-based compilation and trace-based compilation are two major compilation strategies, and they have their advantages and disadvantages. To incorporate the benefits of both, we proposed a meta-hybrid JIT compiler framework and its proof-of-concept implementation called BacCaml. It can generate a virtual machine with a JIT compiler that can use the two strategies from an interpreter definition. As a next step, we move on to a more practical framework to show that the meta-hybrid JIT compilation is useful for many languages. This presentation presents a sprouting idea for supporting the two strategies in a meta-tracing JIT compiler. This approach does not extend the compiler itself but designs an interpreter to enable the two compilation strategies in RPython. |
[173] | Toward Automated Feedback in HtDP-based Programming: A DSL-based Approach (Junya Nose, Youyou Cong and Hidehiko Masuhara), Talk at the International Workshop on Trends in Functional Programming in Education (TFPIE 2021), 2021. [bibtex] [url] |
[172] | A Functional Programming Language with Versions (Yudai Tanabe, Lubis Luthfan Anshar, Tomoyuki Aotani and Hidehiko Masuhara), In The Art, Science, and Engineering of Programming, volume 6, 2021. (Submission 2021-02-01, Publication 2021-07-15. Presentation at the International Conference on the Art, Science, and Engineering of Programming ( 2022)) [bibtex] [url] [doi] [PDF] [abstract] While modern software development heavily uses versioned packages, programming languages rarely support the concept of versions in their semantics, which makes software update more bulky and unsafe. This paper proposes a programming language that intrinsically supports versions. The main goals are to design core language features to support multiple versions in one program and establish a proper notion of type safety with those features. The proposed a core calculus, called Lambda VL, has versioned values, each of which can contain different values under different versions. We show the construction of the type system as an extension of coeffect calculus by mapping versions to computational resources. The type system guarantees the existence of a valid combinations of versions for a program. The calculus enables programming languages to use multiple versions of a package within a program. It will serve as a basis for designing advanced language features like module systems and semantic versioning. |
[171] | Amalgamating Different JIT Compilations in a Meta-tracing JIT Compiler Framework (Yusuke Izawa and Hidehiko Masuhara), In Proceedings of the 16th ACM SIGPLAN International Symposium on Dynamic Language (DLS'20) (Matthew Flatt, ed.), 2020. [bibtex] [url] [doi] [PDF] [abstract] Most virtual machines employ just-in-time (JIT) compilers to achieve high-performance. Trace-based compilation and method-based compilation are two major compilation strategies in JIT compilers. In general, the former excels in compiling programs with more in-depth method calls and more dynamic branches, while the latter is suitable for a wide range of programs. Some previous studies have suggested that each strategy has its advantages and disadvantages,and there is no clear winner. In this paper, we present a new approach, namely, the meta-hybrid JIT compilation strategy, mixing the two strategies in a meta-tracing JIT compiler. As a prototype, we implemented a simple meta-tracing JIT compiler framework called BacCaml based on the MinCaml compiler by following RPython's architecture. We also report that some programs ran faster by the hybrid compilation in our experiments. |
[170] | Toward a Multi-Language and Multi-Environment Framework for Live Programming (Hidehiko Masuhara, Shusuke Takahashi, Yusuke Izawa and Youyou Cong), Talk at the 2020 Workshop on Live Programming (colocated with SPLASH 2020), 2020. [bibtex] [url] [PDF] [abstract] While applications of live programming are expanding to more practical and professional domains, most live programming environments (LPEs) are still developed for a single target language with an original code editor. We propose an implementation framework for developing LPEs so that we can minimize efforts on implementing an LPE for a different target language and an existing code editor/IDE. Our idea is to use a meta-JIT language implementation framework (e.g., Graal/Truffle and RPython) and LSP to separate core live programming implementations from language-specific and editor/IDE specific implementations. This paper takes the Kanon live programming environment as a concrete example and discusses how we can design the framework to accommodate the features of Kanon. Although the framework design is still underway, the paper presents a sketch of the framework APIs for separating language-specific functions and clarifies the requirements to LSP. |
[169] | Managing Persistent Signals using Signal Classes (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 7th Workshop on Reactive and Event-based Languages and Systems (REBLS 2020) (Ivan Perez, ed.), ACM, 2020. (to appear) [bibtex] [url] [PDF] [abstract] Persistent signals provide a convenient abstraction for time-varying values with their execution histories by implicitly leaving the management of execution histories to the database system. The current design of persistent signals is very rudimental. For example, they do not provide abstractions for representing complex data structures, and they can only be connected using API methods prepared in advance. To make matters worse, dynamic creation of persistent signals is not allowed. In this paper, we show that these problems can be addressed by introducing a new language mechanism called signal classes. A signal class packages a network of related persistent signals that comprises a complex data structure. A signal class can be instantiated dynamically, and this instance is considered a "small world," where all signals within it are synchronous. We further show that this synchronous world makes it easy to realize persistent signal networks connected by expressions that are not limited to the API methods. This dynamic creation of signal class instances is managed by a simple lifecycle model where both dynamic lifecycle events and persistency are defined. |
[168] | Object Support for GPU Programming: Why and How (Hidehiko Masuhara), Keynote talk at the 18th Asian Symposium on Programming Languages and Systems (APLAS 2020), 2020. [bibtex] [url] [abstract] General-purpose computing on graphics processing units (GPGPU) is now widely used in many application domains. However, programming for GPGPU is challenging due to its peculiar performance characteristics and still being done either in low-level languages or through libraries (e.g., those for matrix computation and machine learning). This talk discusses the performance challenges of using objects in GPGPU programming from the viewpoint of memory management, and the efficient mechanisms to support objects. |
[167] | Sanajeh: A DSL for GPGPU Programming With Python Objects (Jizhe Chenxin, Hidehiko Masuhara, Matthias Springer and Youyou Cong), In Proceedings of the 37th Annual Conference of Japan Society for Software Science and Technology (Eijiro Sumii, ed.), 2020. [bibtex] [url] [PDF] [abstract] GPGPU (general purpose computing on graphics processing units) is one of the economical methods of parallel programming. However, in order to obtain high performance, the programmers must write code in a low-level programming language such as C and pay attention to memory allocation. We propose Sanajeh, a Python DSL (domain-specific language) that compiles object-oriented programs into GPGPU code. It is a language which is based on the Single-Method Multiple-Objects (SMMO) model. Sanijeh compiles parallel Python code into C++/CUDA code and utilizes DynaSOAr for efficient GPU memory allocation. |
[166] | On Teaching Type Systems as Macros (Youyou Cong, Naoya Furudono and Hidehiko Masuhara), Lighting Talk at Scheme and Functional Programming Workshop (Scheme 2020), 2020. [bibtex] [url] [abstract] Type systems are one of the fundamental things that everyone in the programming languages community must study. In our research group, we run a semester-long type systems seminar every two years, covering essential chapters of the traditional TaPL book. This year, however, we are attempting a different approach, namely teaching type systems through programming in the Turnstile language of Chang et al. Turnstile is a Racket DSL for creating typed programming languages, built under the slogan "type systems as macros". More specifically, it allows the user to define typing rules in the familiar, derivation-like syntax, and to reuse Racket's infrastructure for type checking and evaluation. We report our experience in teaching type systems as macros to an undergraduate student who joined our research group this spring (the second author). In particular, we show how the student used Turnstile to build simple type-and- effect systems, and what difficulties the student had in the course of implementation. |
[165] | Designing a Programming Environment Based on the Program Design Recipe (Junya Nose, Youyou Cong and Hidehiko Masuhara), Lighting Talk at Scheme and Functional Programming Workshop (Scheme 2020), 2020. [bibtex] [url] [abstract] The program design recipe, introduced by Felleisen et al. in their textbook "How to Design Programs", is a step-by-step procedure that solves a problem by programming. The design recipe encourages the programmer, after examining the problem statement, to analyze the data, create input-output examples, and develop a template, instead of immediately starting coding. This helps reduce various kinds of errors, such as non-exhaustive conditional expressions and infinite loops. One problem in programming with the design recipe is the lack of error-checking support for steps other than coding. For instance, in DrRacket, the programmer cannot check the correctness of data definitions or templates, as they are not written as runnable Racket programs. We propose a programming environment based on the design recipe. The environment covers the whole process of the design recipe, including data analysis and template construction, with an IDE-like user interface. We also create a domain-specific language that allows systematic design of the user interface and error checking algorithms. Although it is only partly implemented at this point, we hope to receive suggestions on the design of our environment, especially from the workshop participants who are teaching with the design recipe. |
[164] | Interfaces for Modular Reasoning in Context-Oriented Programming (Paul Leger, Hidehiko Masuhara and Ismael Figueroa), In Proceedings of the 12th International Workshop on Context-Oriented Programming and Advanced Modularity (COP 2020), 2020. [bibtex] [url] [doi] [PDF] [abstract] Different activation mechanisms for Context-Oriented Programming (COP) like implicit activations have been proposed, increasing COP opportunities to be applied in real scenarios. However, activation mechanisms and base code definitions are insufficiently decoupled, as conditionals to activate layers require base code variable references. This hinders reuse, evolution, and modular reasoning of COP and base code, and therefore, uses of COP in real scenarios. This paper proposes interfaces, which are shared abstractions to communicate activation mechanisms and base code in a decoupled manner. Using these interfaces, an object can exhibit its internal state and behaviors, and conditionals use them to (de)activate layers. As layers are planned to be (re)used in different applications, developers can use interfaces to overcome the incompatibility between values exposed by a particular base code and values required by a layer. In addition, as a layer is a plain object, it can use an interface to exhibit the conditional evaluation of its activation to other layers to resolve conflicts among activations of layers. We apply this proposal to implicit activations in which evaluations of conditionals implicitly (de)activate layers. Finally, we illustrate the benefits of this proposal through RI-JS, a practical JavaScript library that currently supports interfaces, reactive activations (implementation variant for implicit activations), global and dynamic deployment, enter and exit transition processes, and partial methods. |
[163] | Making Different JIT Compilations Dancing to the Same Tune, Acting in the Meta-level (Yusuke Izawa and Hidehiko Masuhara), The 22nd JSSST Workshop on Programming and Programming Languages, 2020. (Poster Presentation) [bibtex] [url] [PDF] |
[162] | Object-oriented Programming with Versions (Lubis Luthfan Anshar, Yudai Tanabe, Tomoyuki Aotani and Hidehiko Masuhara), The 22nd JSSST Workshop on Programming and Programming Languages, 2020. (Poster Presentation) [bibtex] [url] [PDF] |
[161] | Sanajeh: a DSL for GPGPU Programming With Python Objects (Jizhe Chenxin, Hidehiko Masuhara and Matthias Springer), The 22nd JSSST Workshop on Programming and Programming Languages, 2020. (Poster Presentation) [bibtex] [url] [PDF] |
[160] | ACKN: A Context-Aware Keyword Programming System (Aochi Shu and Hidehiko Masuhara), The 22nd JSSST Workshop on Programming and Programming Languages, 2020. (Poster Presentation) [bibtex] [url] [PDF] |
[159] | Improving Keyword-based Code Recommendation by Exploiting Context Information (Aochi Shu and Hidehiko Masuhara), In Presented at IPSJ SIG-PRO 128th Workshop on Programming,, 2020. [bibtex] [url] [PDF] [abstract] Code recommendation provides code fragments that the programmer likely to type in. One of the advanced code recommendation techniques is keyword programming, which can reflect the programmers' intention. Keyword programming lets the user specify keywords and recommends expressions that contain as many of them. Another one is neural code completion, which uses neural networks to recommend likely occurring expressions according to the context (the program text preceding the cursor position). Previous work showed that the accuracy of a keyword programming system is not high enough. One of the reasons is that the existing keyword programming always recommends shorter expressions without using the context information. In this presentation, we improve keyword programming by combining a neural code completion technique. In addition to the occurrence of keyword, the ranking algorithm incorporates the likeliness factor of the code fragment concerning the context. To estimate the likeliness, we utilize a neural network-based sentence generator. Thus, we can achieve a more complicatedly suitable code fragment and generate a candidate list varying along with different contexts. We implemented our proposal for Java called ACKN as an Eclipse plug-in. The implementation is publicly available. |
[158] | Teaching Object-Oriented Modeling as a Part of Programming Courses (Hidehiko Masuhara), In Proceedings of the 2nd Software Engineering Education Workshop 2019 (SEED 2019) co-located with 26th Asia Pacific Software Engineering Conference (APSEC 2019), volume 2506, 2019. [bibtex] [url] [PDF] [abstract] Programming courses in computer science curricula usually teach the concepts and skills of programming, algorithms, data structures, and software development. Though the students who took those programming courses can solve programming exercises, they sometimes lack the problem-solving skills by programming. This essay describes the author's observations with the phenomenon and an attempt of teaching object-oriented modeling as a part of programming courses. |
[157] | Challenges and Ideas for Making Live Programming More Practical (Hidehiko Masuhara), Computer Science Colloquium, City University of New York, 2019. [bibtex] [slides] [abstract] Live programming environments are the programming editors that immediately shows results of an execution of a program being edited. The immediate feedback can change the way of programming—we can exercise a more trial-and-error style of programming, and we can be more confident of the code fragments that we are writing. So far, most of live programming environments are developed for education or for artistic performance. In order to apply live programming for practical software development, we still need overcome several issues, such as visualization, user interface, and runtime performance. This talk presents our live programming environment, called Kanon, that automatically visualizes data structures created inside of a program. We discuss interesting problems and solutions for making visualization natural to the programmers, and remaining challenges. |
[156] | A Stack Hybridization for Meta-hybrid Just-in-time Compilation (Yusuke Izawa, Hidehiko Masuhara, Tomoyuki Aotani and Youyou Cong), In Proceedings of the 36th JSSST Annual Conference (Kei Ito, ed.), 2019. [bibtex] [PDF] [abstract] Meta-interpreter-based language implementation frameworks, such as RPython and Truffe/Graal, are convenient tool for implementing state-of-the-art virtual machines. Those frameworks are classified into trace-based and method- (or ast-) based strategies. RPython uses a trace-based policy to compile straight execution paths, while Truffe/Graal leverages method invocation to compile entire method bodies. Each approach has its own advantages and disadvantages. The trace-based strategy is good at compiling pro- grams with many branching possibilities and able to reduce the size of compiled code, but it is weak at programs with varying control-flow. The method-based strategy is robust with the latter type of programs but it needs thorough method-inlining management to achieve excellent performance. To take advantage of both strategies, we propose a meta-hybrid compilation technique to integrate trace- and method-based compilations, as well as a proof-of-concept implementation called BacCaml. To achieve this goal, we develop a stack hybridization mechanism which makes it possible to coordinate trace- and method-based meta JIT compilation. In the implementation, we extend RPython's architecture and introduced a special syntax for realizing this system in a single interpreter definition. |
[155] | ASTToken2Vec: An Embedding Method for Neural Code Completion (Dongfang Li and Hidehiko Masuhara), In Proceedings of the 36th JSSST Annual Conference (Kei Ito, ed.), 2019. (The Student Research Award and the Best Presentation Award of the conference.) [bibtex] [PDF] [abstract] Code completion systems help programmers to write code more efficiently and to reduce typographical errors by automatically suggesting the code fragment that the programmers likely to write next. This work attempts to increase prediction performance of an LSTM-based code completion system proposed by Chang Liu et al. by proposing a new embedding method (a vector representation) for AST nodes. This method is called ASTToken2Vec, similar to Word2Vec, which trains a neural network by using context information to give a vector representation of an AST node. We integrate our embedding method with an LSTM model and evaluate its prediction performance on a JavaScript AST dataset generated from open-source programs containing a total of 150,000 JavaScript files. |
[154] | DynaSOAr: A Parallel Memory Allocator for Object-Oriented Programming on GPUs with Efficient Memory Access (Matthias Springer and Hidehiko Masuhara), In Proceedings of of European Conference on Object-Oriented Programming (ECOOP'19) (Alastair Donaldson, ed.), volume 134, 2019. [bibtex] [url] [doi] [PDF] [abstract] Object-oriented programming has long been regarded as too inefficient for SIMD high-performance computing, despite the fact that many important HPC applications have an inherent object structure. On SIMD accelerators, including GPUs, this is mainly due to performance problems with memory allocation and memory access: There are a few libraries that support parallel memory allocation directly on accelerator devices, but all of them suffer from uncoalesed memory accesses. We discovered a broad class of object-oriented programs with many important real-world applications that can be implemented efficiently on massively parallel SIMD accelerators. We call this class Single-Method Multiple-Objects (SMMO), because parallelism is expressed by running a method on all objects of a type. To make fast GPU programming available to domain experts who are less experienced in GPU programming, we developed DynaSOAr, a CUDA framework for SMMO applications. DynaSOAr consists of (1) a fully-parallel, lock-free, dynamic memory allocator, (2) a data layout DSL and (3) an efficient, parallel do-all operation. DynaSOAr achieves performance superior to state-of-the-art GPU memory allocators by controlling both memory allocation and memory access. DynaSOAr improves the usage of allocated memory with a Structure of Arrays (SOA) data layout and achieves low memory fragmentation through efficient management of free and allocated memory blocks with lock-free, hierarchical bitmaps. Contrary to other allocators, our design is heavily based on atomic operations, trading raw (de)allocation performance for better overall application performance. In our benchmarks, DynaSOAr achieves a speedup of application code of up to 3x over state-of-the-art allocators. Moreover, DynaSOAr manages heap memory more efficiently than other allocators, allowing programmers to run up to 2x larger problem sizes with the same amount of memory. |
[153] | DynaSOAr: A Parallel Memory Allocator for Object-Oriented Programming on GPUs with Efficient Memory Access (Artifact) (Matthias Springer and Hidehiko Masuhara), In Dagstuhl Artifacts Series, Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, volume 5, 2019. [bibtex] [url] [doi] [abstract] This artifact contains the source code of DynaSOAr, a CUDA framework for Single-Method Multiple-Objects (SMMO) applications. SMMO is a type of object-oriented programs in which parallelism is expressed by running the same method on all applications of a type. DynaSOAr is a dynamic memory allocator, combined with a data layout DSL and a parallel do-all operation. This artifact provides a tutorial explaining the API of DynaSOAr, along with nine benchmark applications from different domains. All benchmarks can be configured to use a different memory allocator to allow for a comparison with other state-of-the-art memory allocators. |
[152] | Massively Parallel GPU Memory Compaction (Matthias Springer and Hidehiko Masuhara), In Proceedings of the ACM SIGPLAN International Symposium on Memory Management (ISMM 2019) (Harry Xu, ed.), 2019. [bibtex] [url] [doi] [PDF] [abstract] Memory fragmentation is a widely studied problem of dynamic memory allocators. It is well known that fragmentation can lead to premature out-of-memory errors and poor cache performance. With the recent emergence of dynamic memory allocators for SIMD accelerators, memory fragmentation is becoming an increasingly important problem on such architectures. Nevertheless, it has received little attention so far. Memory-bound applications on SIMD architectures such as GPUs can experience an additional slowdown due to less efficient vector load/store instructions. We propose CompactGpu, an incremental, fully-parallel, in-place memory defragmentation system for GPUs. CompactGpu is an extension to the DynaSOAr dynamic memory allocator and defragments the heap in a fully parallel fashion by merging partly occupied memory blocks. We developed several implementation techniques for memory defragmentation that are efficient on SIMD/GPU architectures, such as finding defragmentation block candidates and fast pointer rewriting based on bitmaps. Benchmarks indicate that our implementation is very fast with typically higher performance gains than compaction overheads. It can also decrease the overall memory usage. |
[151] | Extending a Meta-Tracing Compiler to Mix Method and Tracing Compilation (Yusuke Izawa, Hidehiko Masuhara and Tomoyuki Aotani), In Proceedings of the Workshop on Modern Language Runtimes, Ecosystems, and VMs (MoreVMs'19) in Proceedings of the Conference Companion of the 3rd International Conference on Art, Science, and Engineering of Programming, ACM, 2019. [bibtex] [doi] [PDF] [abstract] Meta-interpreter-based just-in-time compiler frameworks provide a convenient way for language designers to implement efficient virtual machines. Those frameworks either employ tracing-based or method- (or partial evaluation) based strategies, which have their own pros and cons. This paper proposes an approach to enable both tracing- and method-based compilation so that the runtime can selectively apply an appropriate strategy to different parts of a program. The proposal basically extends a meta-tracing compiler to method-based compilation by roll backing at conditional branches, trace-splitting at loop entries, and not following at function calls. As a proof-of-concept, we implemented a tiny meta-tracing compiler in MinCaml by following the RPython's architecture and extended it to support both tracing- and method-based compilation. |
[150] | A Shell-like Model for General Purpose Programming (Jeanine Miller Adkisson, Johannes Westlund and Hidehiko Masuhara), In Proceedings of the Workshop on Modern Language Runtimes, Ecosystems, and VMs: Track on Programming Across the System Stack (MoreVMs/PASS'19), 2019. [bibtex] [doi] [PDF] [abstract] Shell scripting languages such as bash are designed to integrate with an OS, which mainly involves managing processes with implicit input and output streams. They also attempt to do this in a compact way that could be reasonably typed on a command-line interface. However, existing shell languages are not sufficient to serve as general-purpose languages—values are not observable except in raw streams of bytes, and they lack modern language features such as lexical scope and higher-order functions. By way of a new programming language, Magritte, we propose a general-purpose programming language with semantics similar to bash. In this paper, we discuss the early design of such a system, in which the primary unit of composition, like bash, is processes with input and output channels, which can be read from or written to at any time, and which can be chained together via a pipe operator. We also explore concurrency semantics for such a language. |
[149] | Programming Experiences with a Live Programming Environment for Data Structures (Hidehiko Masuhara, Akio Oka and Tomoki Ogushi), Demonstration at the International Conference on the Art, Science, and Engineering of Programming ('19), 2019. [bibtex] [url] [abstract] This demonstration presents a live programming environment for data structures called Kanon [oka2018onward],*. The goal of the environment is to support professional programmers when they develop new data structures and operations thereof. The key feature for data structures is its automatic visualization of objects that are created in a program execution. We first overviews the environment through a coding session of a small data structure. The environment assumes a program is written in a test-driven style, and displays objects as a node-link diagram. We introduce the notion of visualization contexts, which the program state stopped at the cursor position, and used for navigating the visualization. We then discusses the features that support liveness and data-structures. The jump-to-construction mechanism navigates the programmer from a visual element to a code fragment that made the element. Our proposed graph layout algorithm automatically analyzes the object structure and places nodes so as to help the programmers to recognize the relations between objects. An on-the-fly test case generation mechanism enables top-down programming by letting the programmers handcraft an expected result upon a call to an unimplemented function. Lastly, we discuss several issues for future research. Programming complicated data structures require customized visualization so that the programmer can see the objects at different levels of abstraction. In order not to distract the programmers' focus, it is crucial to handle errors appropriately especially in an environment where program code can be erroneous in the middle of editing. Our user experiment discovered some programming mistakes that can only be observed with the live programming environment, which might be an effect of live programming on the way of programming. |
[148] | On Defining Recursive Functions in Live Data Structure Programming (Akio Oka, Hidehiko Masuhara and Tomoyuki Aotani), In The 21st JSSST Workshop on Programming and Programming Languages, 2019. [bibtex] [url] [PDF] [abstract] Kanon is a live programming environment that automatically visualizes data structures created by the program being edited. Though its visualization is useful for the programmer to think about the next code fragment to be written, it becomes useless when defining recursive functions. This paper proposes an extended feature of Kanon that lets the programmer manually build an expected structure. The expected structure not only makes the visualization useful again, but also serves as a test case. This paper also discusses the usefulness of the extended feature through case studies. |
[147] | A Shell-like Model for General Purpose Programming (Jeanine Miller Adkisson, Hidehiko Masuhara and Johannes Westlund), In Presented at IPSJ SIG-PRO 122th Workshop on Programming,, 2019. [bibtex] [url] [PDF] [abstract] Shell languages such as bash are designed to integrate with an OS, which mainly involves managing processes with implicit input and output streams. They also attempt to do this in a compact way that could be reasonably typed on a command-line interface. However, existing shell languages are not sufficient to serve as general-purpose languages - values are not observable except in raw streams of bytes, and they lack modern language features such as lexical scope and higher-order functions. By way of a new programming language, Magritte, we propose a general-purpose programming language with semantics similar to bash. In this presentation, we discuss the early design of such a system, in which the primary unit of composition, like bash, is processes with asynchronous inputs and outputs, which can be read from or written to at any time, and which can be chained together via a pipe operator. We also explore concurrency semantics for such a language. We explore the implementation and design challenges that come with such a model, and also show that this model is able to easily create and compose concurrent algorithms. |
[146] | (Preview) Live, Synchronized, and Mental Map Preserving Visualization for Data Structure Programming (Akio Oka, Hidehiko Masuhara and Tomoyuki Aotani), Talk at PLATEU Workshop 2018, 2018. [bibtex] [url] |
[145] | Live, Synchronized, and Mental Map Preserving Visualization for Data Structure Programming (Akio Oka, Hidehiko Masuhara and Tomoyuki Aotani), In Proceedings of the 2018 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, ACM, 2018. [bibtex] [url] [doi] [PDF] [abstract] Live programming is an activity in which the programmer edits code while observing the result of the program. It has been exercised mainly for pedagogical and artistic purposes, where outputs of a program are not straightforwardly imagined. While most live programming environments so far target programs that explicitly generate visual or acoustic outputs, we believe that live programming is also useful for data structure programming, where the programmer often has a hard time to grasp a behavior of programs. However, it is not clear what features a live programming environment should provide for such kind of programs. In this paper, we present a design of live programming environment for data structure programming, identify the problems of synchronization and mental map preservation, and propose solutions based on a calling-context sensitive identification technique. We implemented a live programming environment called Kanon, and tested with 13 programmers. |
[144] | Stochastic Energy Optimization for Mobile GPS Applications (Anthony Canino, Yu David Liu and Hidehiko Masuhara), In Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ACM, 2018. [bibtex] [url] [doi] [PDF] [abstract] Mobile applications regularly interact with their noisy and ever-changing physical environment. The fundamentally uncertain nature of such interactions leads to significant challenges in energy optimization, a crucial goal of software engineering on mobile devices. This paper presents Aeneas, a novel energy optimization framework for Android in the presence of uncertainty. Aeneas provides a minimalistic programming model where acceptable program behavioral settings are abstracted as knobs and application-specific optimization goals such as meeting an energy budget are crystallized as rewards, both of which are directly programmable. At its heart, Aeneas is endowed with a stochastic optimizer to adaptively and intelligently select the reward-optimal knob setting through a form of reinforcement learning. We evaluate Aeneas on mobile GPS applications built over Google LocationService API. Through an in-field case study that covers approximately 6500 miles and 150 hours of driving as well as 20 hours of biking and hiking, we find that Aeneas can effectively and resiliently meet programmer-specified energy budgets in uncertain physical environments where individual GPS readings undergo significant fluctuation. Compared with non-stochastic approaches such as profile-guided optimization, Aeneas produces significantly more stable results across runs. |
[143] | Narratives for Multi-party Mechanisms and Concerns (Robert Hirschfeld, Tobias Durschmid, Patrick Rein, Marcel Taeumel and Hidehiko Masuhara), In Proceedings of the 35th JSSST Annual Conference (Akimasa Morihata, ed.), 2018. [bibtex] [PDF] [abstract] Cross-cutting concerns are an inherent property of the implementation of non-trivial software systems. Their study led to the development of advanced modularity constructs, usually supported by meta-level frameworks and programming language constructs, to improve comprehensibility. Because of their invasive nature, systems need to be refactored or rewritten to take advantage of these constructs. However, practical considerations such as organizational or economical constraints often do not allow for such reengineering efforts, leaving those systems without explicit representations of their cross-cutting concerns. We propose a lightweight, non-invasive approach to explicate and document cross-cutting, multi-party concerns called Crosscutting Commentary, or Commentary for short. Our proposal is based on the observation that comments are co-located with the individual semantic units they are about and with that scattered and tangled in the absence of advanced modularity constructs for crosscutting concerns and the assumption that well-crafted, informal explanations of system properties (their intents and the mechanisms they provide) improve comprehensibility. Commentaries are to help communicate narratives about system properties that involve multiple participants, both co-located in a single module or crosscutting several of them, and allow for navigating to, from, and between them to explore the implementation artifacts involved. Commentary was inspired by layers introduced with Context-oriented Programming to associate and manage partial definitions of system elements. While layers contribute to system comprehension during development and software composition at run-time, Commentary focuses on narratives for system exploration. We present our first attempt to provide Commentaries in Squeak/Smalltalk. We explain implementation details and discuss several application scenarios considering the documentation of basic mechanisms of this programming and runtime environment. |
[142] | A Context-Oriented Programming Approach to Dependency Hell (Yudai Tanabe, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 10th International Workshop on Context-Oriented Programming: Advanced Modularity for Run-time Composition, ACM, 2018. [bibtex] [url] [doi] [PDF] [abstract] Two or more incompatible versions of a library are sometimes needed in one software artifact, which is so-called dependency hell. One likely faces the problem if he or she uses two or more libraries that depend on the same library. In this paper, we propose versioned values to solve the problem. They allow us to have multiple versions of functions in a binary file. This gets rid of requiring two or more incompatible binaries. We develop a calculus $\lambda_{VL}$ to discuss type safety in the case where definitions are available only in specific versions, which is a common and important nature of versioned programs. |
[141] | Inner Array Inlining for Structure of Arrays Layout (Matthias Springer, Yaozhu Sun and Hidehiko Masuhara), In Proceedings of the 5th ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming (ARRAY@PLDI 2018), 2018. [bibtex] [url] [doi] [PDF] [abstract] Previous work has shown how the well-studied and SIMD-friendly Structure of Arrays (SOA) data layout strategy can speed up applications in high-performance computing compared to a traditional Array of Structures (AOS) data layout. However, a standard SOA layout cannot handle structures with inner arrays; such structures appear frequently in graph-based applications and object-oriented designs with associations of high multiplicity. This work extends the SOA data layout to structures with array-typed fields. We present different techniques for in-lining (embedding) inner arrays into an AOS or SOA layout, as well as the design and implementation of an embedded C++/CUDA DSL that lets programmers write such layouts in a notation close to standard C++. We evaluate several layout strategies with a traffic flow simulation, an important real-world application in transport planning. |
[140] | Method Safety Mechanism for Asynchronous Layer Deactivation (Tetsuo Kamina, Tomoyuki Aotani, Hidehiko Masuhara and Atsushi Igarashi), In Science of Computer Programming, volume 156, 2018. [bibtex] [url] [doi] [PDF] [abstract] Context-oriented programming (COP) enhances the modularity of context-dependent behavior in context-aware systems, as it provides modules to implement context- dependent behavior (layers) and composes them dynamically in a disciplined manner (layer activation). We propose a COP language that enables layers to define base methods, while the layers can be asynchronously activated and deactivated. Base methods in layers enhance modularity because they extend the interface of classes without modifying original class definitions. However, calling such a method defined in a layer is problematic as the layer may be inactive when the method is called. We address this problem by introducing a method lookup mechanism that uses the static scope of method invocation for COP; i.e., in addition to currently activated layers, the layer where the method invocation is written, as well as the layers on which that layer depends, are searched during method lookup. We formalize this mechanism as a small calculus referred to as ContextFJ a and prove its type soundness. We implement this mechanism in ServalCJ, a COP language that supports asynchronous, as well as synchronous, layer activation. |
[139] | Proactive Empirical Assessment of New Language Feature Adoption via Automated Refactoring: The Case of Java 8 Default Methods (Raffi Khatchadourian and Hidehiko Masuhara), In The Art, Science, and Engineering of Programming, volume 2, 2018. (Article no.6) [bibtex] [doi] [PDF] [abstract] Programming languages and platforms improve over time, sometimes resulting in new language features that offer many benefits. However, despite these benefits, developers may not always be willing to adopt them in their projects for various reasons. In this paper, we describe an empirical study where we assess the adoption of a particular new language feature. Studying how developers use (or do not use) new language features is important in programming language research and engineering because it gives designers insight into the usability of the language to create meaning programs in that language. This knowledge, in turn, can drive future innovations in the area. Here, we explore Java 8 default methods, which allow interfaces to contain (instance) method implementations. Default methods can ease interface evolution, make certain ubiquitous design patterns redundant, and improve both modularity and maintainability. A focus of this work is to discover, through a scientific approach and a novel technique, situations where developers found these constructs useful and where they did not, and the reasons for each. Although several studies center around assessing new language features, to the best of our knowledge, this kind of construct has not been previously considered. Despite their benefits, we found that developers did not adopt default methods in all situations. Our study consisted of submitting pull requests introducing the language feature to 19 real-world, open source Java projects without altering original program semantics. This novel assessment technique is proactive in that the adoption was driven by an automatic refactoring approach rather than waiting for developers to discover and integrate the feature themselves. In this way, we set forth best practices and patterns of using the language feature effectively earlier rather than later and are able to possibly guide (near) future language evolution. We foresee this technique to be useful in assessing other new language features, design patterns, and other programming idioms. |
[138] | Ikra-Cpp: A C++/CUDA DSL for Object-OrientedProgramming with Structure-of-Arrays Layout (Matthias Springer and Hidehiko Masuhara), In Proceedings of the 2018 4th Workshop on Programming Models for SIMD/Vector Processing (WPMVP 2018), ACM, 2018. [bibtex] [url] [doi] [PDF] [abstract] Structure of Arrays (SOA) is a well-studied data layout technique for SIMD architectures. Previous work has shown that it can speed up applications in high-performance computing by several factors compared to a traditional Array of Structures (AOS) layout. However, most programmers are used to AOS-style programming, which is more readable and easier to maintain. We present Ikra-Cpp, an embedded DSL for object-oriented programming in C++/CUDA. Ikra-Cpp's notation is very close to standard AOS-style C++ code, but data is layouted as SOA. This gives programmers the performance benefit of SOA and the expressiveness of AOS-style object-oriented programming at the same time. Ikra-Cpp is well integrated with C++ and lets programmers use C++ notation and syntax for classes, elds, member functions, constructors and instance creation. |
[137] | Identification and Elimination of the Overhead of Accelerate with a Super-Resolution Application (Izumi Asakura, Hidehiko Masuhara, Takuya Matsumoto and Kiminori Matsuzaki), In Journal of Information Processing, volume 26, 2018. (Accepted on 2017-08-09. A preprint is also archived as IPSJ Transaction on Programming, 10(6), December 2017) [bibtex] [doi] [PDF] [abstract] This paper supplements the evaluation of libraries for parallel computing in Haskell by Matsumoto and Matsuzaki. The previous work implemented an image processing program by using two different libraries and compared expressiveness and parallel execution performance. In particular, it found that a parallel execution of the Accelerate program on a GPU is slower than the execution of the handwritten CUDA-C program by a factor of more than 70. We analyzed the execution of the Accelerate program and identified that the major sources of the overhead are in the process of the syntax tree before execution of a GPU kernel. Since the program realizes repeated execution by constructing a large syntax tree whose size is proportional to the number of repetitions, we rewrote this part by using a while-construct, which significantly reduces the overhead as it runs half as fast as the CUDA-C program. We also discuss language design alternatives for avoiding this type of overhead. |
[136] | Detecting Broken Pointcuts Using Structural Commonality and Degree of Interest (Raffi Khatchadourian, Awais Rashid, Hidehiko Masuhara and Takuya Watanabe), In Science of Computer Programming, volume 150, 2017. (accepted 2017-06-26) [bibtex] [url] [doi] [PDF] [abstract] Pointcut fragility is a well-documented problem in Aspect-Oriented Programming; changes to the base-code can lead to join points incorrectly falling in or out of the scope of pointcuts. Deciding which pointcuts have broken due to base-code changes is a daunting venture, especially in large and complex systems. We present an automated approach that recommends pointcuts that are likely to require modification due to a particular base- code change, as well as ones that do not. Our hypothesis is that join points selected by a pointcut exhibit common structural characteristics. Patterns describing such commonality are used to recommend pointcuts that have potentially broken with a degree of confidence as the developer is typing. The approach is implemented as an extension to the popular Mylyn Eclipse IDE plug-in, which maintains focused contexts of entities relevant to the task at hand using a Degree of Interest (DOI) model. We show that it is accurate in revealing broken pointcuts by applying it to multiple versions of several open source projects and evaluating the quality of the recommendations produced against actual modifications. We found that our tool made broken pointcuts 2.14 times more interesting in the DOI model than unbroken ones, with a p-value under 0.1, indicating a significant difference in final DOI value between the two kinds of pointcuts (i.e., broken and unbroken). |
[135] | Defaultification refactoring: A tool for automatically converting Java methods to default (Raffi Khatchadourian and Hidehiko Masuhara), In 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE), volume , 2017. [bibtex] [doi] [PDF] [abstract] Enabling interfaces to declare (instance) method implementations, Java 8 default methods can be used as a substitute for the ubiquitous skeletal implementation software design pattern. Performing this transformation on legacy software manually, though, may be non-trivial. The refactoring requires analyzing complex type hierarchies, resolving multiple implementation inheritance issues, reconciling differences between class and interface methods, and analyzing tie-breakers (dispatch precedence) with overriding class methods. All of this is necessary to preserve type-correctness and confirm semantics preservation. We demonstrate an automated refactoring tool called MIGRATE SKELETAL IMPLEMENTATION TO INTERFACE for transforming legacy Java code to use the new default construct. The tool, implemented as an Eclipse plug-in, is driven by an efficient, fully-automated, type constraint-based refactoring approach. It features an extensive rule set covering various corner-cases where default methods cannot be used. The resulting code is semantically equivalent to the original, more succinct, easier to comprehend, less complex, and exhibits increased modularity. A demonstration can be found at http://youtu.be/YZHIy0yePh8. |
[134] | Automated Refactoring of Legacy Java Software to Default Methods (Raffi Khatchadourian and Hidehiko Masuhara), 2017. (reproduction of the ICSE'17 talk at JSSST Annual Conference) [bibtex] [slides] |
[133] | Modular Array-based GPU Computing in a Dynamically-typed Language (Matthias Springer, Wauligmann, Peter and Hidehiko Masuhara), In Proceedings of the 4th ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming (ARRAY2017), ACM, 2017. [bibtex] [url] [doi] [PDF] [abstract] Nowadays, GPU accelerators are widely used in areas with large data-parallel computations such as scientific computations or neural networks. Programmers can either write code in low-level CUDA/OpenCL code or use a GPU extension for a high-level programming language for better productivity. Most extensions focus on statically-typed languages, but many programmers prefer dynamically-typed languages due to their simplicity and flexibility. This paper shows how programmers can write high-level modular code in Ikra, a Ruby extension for array-based GPU computing. Programmers can compose GPU programs of multiple reusable parallel sections, which are subsequently fused into a small number of GPU kernels. We propose a seamless syntax for separating code regions that extensively use dynamic language features from those that are compiled for efficient execution. Moreover, we propose symbolic execution and a program analysis for kernel fusion to achieve performance that is close to hand-written CUDA code. |
[132] | Dart2Java: Running Dart in Java-based Environments (Matthias Springer, Krieger, Andrew, Manilov, Stanislav and Hidehiko Masuhara), In Proceedings of the 12th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems (ICOOOLPS'17), ACM, 2017. [bibtex] [doi] [PDF] [abstract] We present the design and implementation of dart2java, an experimental Dart to Java compiler. It is implemented in Dart and currently supports many but not all Dart language constructs. dart2java is a playground to evaluate performance implications of running Dart code on the JVM and to investigate if it is possible to write Dart code in a largely Java-dominated environment. This paper describes the architecture of dart2java, performance optimizations such as non-nullability of primitive types and generic specialization (and their implications), as well as ideas for language interoperability, i.e., calling Java code from Dart and vice versa. |
[131] | Push-based Reactive Layer Activation in Context-Oriented Programming (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In COP'17: Proceedings of the International Workshop on Context-Oriented Programming, ACM, 2017. [bibtex] [doi] [PDF] [abstract] There are context-dependent behaviors that are active only when a certain condition holds, and that require a certain transition process before activation. We propose a layer-activation mechanism of context-oriented programming languages for such context-dependent behaviors. Our mechanism supports the implicit layer activation (as opposed to the event-based layer activation) in a sense that a condition of activation is written as a conditional expression over reactive values (e.g., values obtained from sensors). In addition, it is push-based in a sense that it executes the transition process immediately after the condition becomes valid (as opposed to the mechanisms that defer the transition process until the first execution of a context-dependent behavior). In this paper, we present how this mechanism works in an extension of ServalCJ with push-based reactive values, and identify open issues raised by this proposal. |
[130] | Automated Refactoring of Legacy Java Software to Default Methods (Raffi Khatchadourian and Hidehiko Masuhara), In Proceedings of International Conference on Software Engineering (ICSE'17), IEEE Press, 2017. [bibtex] [url] [doi] [PDF] [abstract] Java 8 default methods, which allow interfaces to contain (instance) method implementations, are useful for the skeletal implementation software design pattern. However, it is not easy to transform existing software to exploit default methods as it requires analyzing complex type hierarchies, resolving multiple implementation inheritance issues, reconciling differences between class and interface methods, and analyzing tie-breakers (dispatch precedence) with overriding class methods to preserve type-correctness and confirm semantics preservation. In this paper, we present an efficient, fully-automated, type constraint-based refactoring approach that assists developers in taking advantage of enhanced interfaces for their legacy Java software. The approach features an extensive rule set that covers various corner-cases where default methods cannot be used. To demonstrate applicability, we implemented our approach as an Eclipse plug-in and applied it to 19 real-world Java projects, as well as submitted pull requests to popular GitHub repositories. The indication is that it is useful in migrating skeletal implementation methods to interfaces as default methods, sheds light onto the pattern's usage, and provides insight to language designers on how this new construct applies to existing software. |
[129] | Live Data Structure Programming (Akio Oka, Hidehiko Masuhara, Tomoki Imai and Tomoyuki Aotani), In Proceedings of the 2nd Edition of the Programming Experience Workshop (PX/17) in Companion to the First International Conference on the Art, Science and Engineering of Programming (Richard P. Gabriel, Robert Hirschfeld, Hidehiko Masuhara, eds.), ACM, 2017. [bibtex] [url] [doi] [PDF] [abstract] When we write a program that manipulates data structures, we often draw and manipulate a visual image of the structures in our mind. In order to immediately connect those mental images with the data objects created by the program, we propose a live programming environment, called Kanon, specialized for data structure programming. It automatically executes a program being edited, and draws objects and their mutual references as a node-link diagram. In order to visualize information relevant to the programmer's concern, it offers two visualization modes based on the cursor position in the editor. It also offers two interactive mechanisms that relate elements in the program to elements on the diagram, and vice versa. The implementation includes a novel technique for mental map preservation of visual diagrams. |
[128] | A Layer-based Approach to Hierarchical Dynamically-scoped Open Classes (Matthias Springer, Hidehiko Masuhara and Robert Hirschfeld), In Journal of Information Processing, volume 25, 2017. (Also published in IPSJ Transactions on Programming.) [bibtex] [doi] [PDF] [abstract] Open classes are frequently used in programming languages such as Ruby and Smalltalk to add or change methods of a class that is defined in the same component or in a different one. They are typically used for bug fixing, multi-dimensional separation of concerns, or to modularly add new operations to an existing class. However, they suffer from modularity issues if globally visible: Other components using the same classes are then affected by their modifications. This work presents Extension Classes, a hierarchical approach for dynamically scoping such modifications in Ruby, built on top of ideas from Context-oriented Programming (COP). Our mechanism organizes modifications in classes and allows programmers to define their scope according to a class nesting hierarchy and based on whether programmers regard an affected class as a black box or not. Moreover, Extension Classes support modularizing modifications as mixins, such that they can be reused in other components. |
[127] | Iterative Stencil Computations in Ruby on GPUs (Matthias Springer, Peter Wauligmann and Hidehiko Masuhara), Poster presentation at PPL'17, 2017. [bibtex] [url] [PDF] |
[126] | Unravel Programming Sessions with THRESHER: Identifying Coherent and Complete Sets of Fine-granular Source Code Changes (Marcel Taeumel, Stephanie Platz, Bastian Steinert, Robert Hirschfeld and Hidehiko Masuhara), In JSSST Journal on Computer Software, volume 34, 2017. (JSSST Best Research Paper Award) [bibtex] [doi] [PDF] [abstract] Development teams benefit from version control systems, which manage shared access to code repositories and persist entire project histories for analysis or recovery. Such systems will be efficient if developers commit coherent and complete change sets. These best practices, however, are difficult to follow because multiple activities often interleave without notice and existing tools impede unraveling changes before committing them. We propose an interactive, graphical tool, called Thresher, that employs adaptable scripts to support developers to group and commit changes—especially for fine-granular change tracking where numerous changes are logged even in short programming sessions. We implemented our tool in Squeak/Smalltalk and derived a foundation of scripts from five refactoring sessions. We evaluated those scripts' precision and recall, which indicate a reduced manual effort because developers can focus on project-specific adjustments. Having such an interactive approach, they can easily intervene to accurately reconstruct activities and thus follow best practices. |
[125] | CertSkel: a Verified Compiler for a Coq-embedded GPGPU DSL (Izumi Asakura, Hidehiko Masuhara and Tomoyuki Aotani), In Proceedings of The Third International Workshop on Coq for Programming Languages (CoqPL 2017), colocated with PoPL'17, 2017. () [bibtex] [url] [PDF] |
[124] | Declaring Constraints on Object-Oriented Collections (Tim Felgentreff, Robert Hirschfeld, Maria Graber, Alan Borning and Hidehiko Masuhara), In Journal of Information Processing, volume 24, 2016. (A preprint is also archived as IPSJ Transaction on Programming, 9(4), September 2016) [bibtex] [doi] [PDF] [abstract] Logic puzzles such as Sudoku are described by a set of properties that a valid solution must have. Constraints are a useful technique to describe and solve for such properties. However, constraints are less suited to express imperative interactions in a user interface for logic puzzles, a domain that is more readily expressed in the object-oriented paradigm. Object constraint programming provides a design to integrate constraints with dynamic, object- oriented programming languages. It allows developers to encode multi-way constraints over objects using existing, object-oriented abstractions. These constraints are automatically maintained at run-time. In this paper we present an application of this design to logic puzzles in the Squeak/Smalltalk programming environment, as well as an extension of the design and the formal semantics of Babelsberg to allow declaring constraints using the imperative collection API provided in Squeak. We argue that our implementation facilitates creating applications that use imperative construction of user interfaces and mutable program state as well as constraint satisfaction techniques for different parts of the system. The main advantage of our approach is that it moves the burden to maintain constraints from the developer to the runtime environment, while keeping the development experience close to the purely object-oriented approach. |
[123] | Towards a Formally Verified Skeleton-based Data Parallel DSL for GPGPU (Izumi Asakura, Hidehiko Masuhara and Tomoyuki Aotani), 14th Asian Symposium on Programming Languages and Systems (APLAS 2016), poster presentation, 2016. [bibtex] [url] [PDF] |
[122] | Generalized Layer Activation Mechanism for Context-Oriented Programming (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Transactions on Modularity and Composition (TOMC), volume 9800, 2016. (extendend from [kamina2015modularity]) [bibtex] [doi] [PDF] [abstract] Context-oriented programming (COP) languages modularize context-dependent behaviors in multiple classes into layers. These languages have layer activation mechanisms so that the behaviors in layers take effect on a particular unit of computation during a particular period of time. Existing COP languages have different layer activation mechanisms, and each of them has its own advantages. However, since these mechanisms interfere with each other in terms of extent (time duration) and scope (a set of units of computations) of activation, combining them into a single language is not trivial. We propose a generalized layer activation mechanism based on contexts and subscribers to implement the different activation mechanisms in existing COP languages in a single language called ServalCJ. We formalize the operational semantics of ServalCJ as a small calculus and prove priority preservation, i.e., ensuring that layer prioritization, which resolves the interference between layers, is preserved during computation. To prove this property, we give a formal definition of layer priority that is general so that we can discuss the priorities of layers in other COP calculi and implementations. We implement a ServalCJ compiler, and demonstrate its effectiveness through several example applications. |
[121] | A Layer-based Approach to Hierarchical Dynamically-scoped Open Classes (Matthias Springer, Hidehiko Masuhara and Robert Hirschfeld), Presented at IPSJ SIG-PRO 110th Workshop on Programming, 2016-2-(6), 2016. (Published as [springer2017jip]) [bibtex] [url] |
[120] | Classes As Layers: Rewriting Design Patterns with COP: Alternative Implementations of Decorator, Observer, and Visitor (Matthias Springer, Hidehiko Masuhara and Robert Hirschfeld), In Proceedings of the 8th International Workshop on Context-Oriented Programming, ACM, 2016. [bibtex] [doi] [PDF] [abstract] This paper analyzes and presents alternative implementations of three well-known Gang of Four design patterns: Decorator, Observer, and Visitor. These implementations are more than mere refactorings and take advantage of a variant of context-oriented programming that unifies classes and layers to overcome shortcomings in a conventional, object-oriented implementation. |
[119] | Classes as Layers: Rewriting Design Patterns with COP (Matthias Springer, Hidehiko Masuhara and Robert Hirschfeld), Poster Presentation at ECOOP'16, 2016. [bibtex] [url] [PDF] |
[118] | Improving Sequential Performance of Erlang based on a Meta-tracing Just-In-Time Compiler (Ruochen Huang, Hidehiko Masuhara and Tomoyuki Aotani), In Trends in Functional Programming (Van Horn, David, Hughes, John, eds.), Springer-Verlag, 2016. (Post-sympoisum proceedings will be published in 2017.) [bibtex] [doi] [PDF] [abstract] In widely-used actor-based programming languages, such as Erlang, sequential execution performance is as important as scalability of concurrency. In order to improve sequential performance of Erlang, we develop Pyrlang, an Erlang virtual machine with a just-in-time (JIT) compiler by applying an existing meta-tracing JIT compiler. In this paper, we overview our implementation and present the optimization techniques for Erlang programs, most of which heavily rely on function recursion. Our preliminary evaluation showed approximately 38% speedup over the standard Erlang interpreter. |
[117] | Object Support in an Array-based GPGPU Extension for Ruby (Matthias Springer and Hidehiko Masuhara), In Proceedings of the 3rd ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming, ACM, 2016. [bibtex] [doi] [PDF] [abstract] This paper presents implementation and optimization techniques to support objects in Ikra, an array-based parallel extension to Ruby with dynamic compilation. The high-level goal of Ikra is to allow developers to exploit GPU-based high-performance computing without paying much attention to intricate details of the underlying GPU infrastructure and CUDA. Ikra supports dynamically-typed object-oriented programming in Ruby and performs a number of optimizations. It supports parallel operations (e.g., map, each) on arrays of polymorphic objects, allowing polymorphic method calls inside a kernel by compiling them to conditional branches. To reduce branch divergence, Ikra shuffles thread assignments to base array elements based on runtime types of elements. To facilitate memory coalescing, Ikra stores objects in a structure-of-arrays (SoA) representation (columnar object layout). To eliminate intermediate data in global memory, Ikra merges cascaded parallel sections into one kernel using symbolic execution. |
[116] | Matriona: Class Nesting with Parameterization in Squeak/Smalltalk (Matthias Springer, Fabio Niephaus, Robert Hirschfeld and Hidehiko Masuhara), In Proceedings of International Conference on Modularity (Modularity'16), 2016. [bibtex] [doi] [PDF] [abstract] We present Matriona, a module system for Squeak, a Smalltalk dialect. It supports class nesting and parameterization and is based on a hierarchical name lookup mechanism. Matriona solves a range of modularity issues in Squeak. Instead of a flat class organization, it provides a hierarchical namespace, that avoids name clashes and allows for shorter local names. Furthermore, it provides a way to share behavior among classes and modules using mixins and class hierarchy inheritance (a form of inheritance that subclasses an entire class family), respectively. Finally, it allows modules to be externally configurable, which is a form of dependency management decoupling a module from the actual implementation of its dependencies. Matriona is implemented on top of Squeak by introducing a new keyword for run-time name lookups through a reflective mechanism, without modifying the underlying virtual machine. We evaluate Matriona with a series of small applications and will demonstrate how its features can benefit modularity when porting a simple application written in plain Squeak to Matriona. |
[115] | Ikra: Leveraging Object-Oriented Abstractions in a Ruby-to-CUDA JIT Translator (Matthias Springer and Hidehiko Masuhara), 18th JSSST Workshop on Programming and Programming Languages, 2016. (Poster presentation) [bibtex] [PDF] |
[114] | An Advice Mechanism for Non-local Flow Control (Hidehiko Masuhara, Kenta Fujita and Tomoyuki Aotani), In Proceedings of Foundations of Aspect-Oriented Langauges (FOAL2016) (Henrique Rebêlo, ed.), 2016. (ACM Digital library) [bibtex] [doi] [PDF] [slides] [abstract] We propose an advice mechanism called Chop&Graft for non-local flow control. It offers a novel chop pointcut that lets a piece of advice terminate the current execution, and graft and retry operators that resume and restart the terminated executions. By using pointcuts for specifying the region of termination, the mechanism is more robust and more concise than the traditional exception handling mechanisms that rely on names or exception classes. The paper presents the design of the mechanism along with the sketches of two implementations using delimited continuations or threads and exceptions. |
[113] | Towards Improving Interface Modularity in Legacy Java Software through Automated Refactoring (Raffi Khatchadourian, Olivia Moore and Hidehiko Masuhara), In Proceedings of the Workshop on Language Modularity À La Mode Workshop (LaMOD'16), included in Companion Proceedings of International Conference on Modularity (Raffi Khatchadourian, David H. Lorenz, Jacques Noyé, eds.), ACM, 2016. [bibtex] [doi] [PDF] [abstract] The skeletal implementation pattern is a software design pattern consisting of defining an abstract class that provides a partial interface implementation. However, since Java allows only single class inheritance, if implementers decide to extend a skeletal implementation, they will not be allowed to extend any other class. Also, discovering the skeletal implementation may require a global analysis. Java 8 enhanced interfaces alleviate these problems by allowing interfaces to contain (default) method implementations, which implementers inherit. Java classes are then free to extend a different class, and a separate abstract class is no longer needed; developers considering implementing an interface need only examine the interface itself. We argue that both these benefits improve software modularity, and discuss our ongoing work in developing an automated refactoring tool that would assist developers in taking advantage of the enhanced interface feature for their legacy Java software. |
[112] | A Lightweight Optimization Technique for Data Types à la Carte (Hirotada Kiriyama, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the Workshop on Language Modularity À La Mode Workshop (LaMOD'16), included in Companion Proceedings of International Conference on Modularity (Raffi Khatchadourian, David H. Lorenz, Jacques Noyé, eds.), ACM, 2016. [bibtex] [doi] [PDF] [abstract] Data types a la carte (DTC) is a technique for adding new variants to data types modularly. A drawback of DTC compared with simple variant types, which are commonly used to define data types in functional programming languages, is runtime inefficiency caused by the destruction of these values. In this paper, we propose a lightweight optimization technique for functions that destruct the values of DTC data types. It makes their execution as efficient as their non-DTC counterparts by just (1) deriving non-extensible algebraic data types isomorphic to extensible data types defined in DTC fashion and (2) using them within the type annotations that specify concrete data types using the composition operator given in DTC. The approach is based on an insight on the functions: the functions never depend on any concrete data types but merely constrain them. We implemented functions that take an extensible data type defined in DTC fashion and derive an isomorphic non-extensible algebraic data type using Template Haskell. Our experimental results show that DTC functions using our approach run as efficiently as their non-DTC counterparts and avoid performance slow down even if the data types are extended multiple times. |
[111] | Hierarchical Layer-based Class Extensions in Squeak/Smalltalk (Matthias Springer, Hidehiko Masuhara and Robert Hirschfeld), In Proceedings of the Workshop on Live Adaptation of Software Systems (LASSY 2016), included in Companion Proceedings of International Conference on Modularity (Kim Mens, ed.), ACM, 2016. [bibtex] [doi] [PDF] [abstract] Class extensions are frequently used in programming languages such as Ruby and Smalltalk to add or change methods of a class that is defined in the same application or in a different one. They suffer from modularity issues if globally visible: Other applications using the same classes are then affected by the modifications. This paper presents a hierarchical approach for dynamically scoping class extensions in dynamically-typed, class-based programming languages supporting class nesting. Our mechanism allows programmers to define the scope of class extensions and to reuse class extensions in other programs. Class extensions can be scoped according to a nested class hierarchy or based on whether programmers regard a potentially affected class as a black box or not. Class extensions are organized in layers, where multiple layers targeting the same class can be active at the same time. |
[110] | Toward Fluent Module Interactions (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the Workshop on Modularity Across the System Stack (MASS 2016), included in Companion Proceedings of International Conference on Modularity (David Liu, ed.), ACM, 2016. [bibtex] [doi] [PDF] [abstract] Recent progress on sensor technologies poses challenges on software development such as more interaction with physical environment and context-awareness. This trend makes it difficult to decide the boundaries between changing module interactions. In this paper, we propose a concept of fluent module interactions where we characterize the module interactions in three dimensions, i.e., definition, duration, and scope. Module interactions in any of those dimensions can change dynamically. We also propose a possible extension of existing programming language with fluent module interactions based on context-oriented programming (COP). Then, we derive a future research roadmap for realizing fluent module interactions that covers a wide range of research fields including theory, implementation, engineering, and applications. |
[109] | Proof of Soundness of Concurrent Separation Logic for GPGPU in Coq (Izumi Asakura, Hidehiko Masuhara and Tomoyuki Aotani), In Journal of Information Processing, volume 24, 2016. (IPSJ Outstanding Paper Award) [bibtex] [doi] [PDF] [abstract] We design a concurrent separation logic for GPGPU, namely GPUCSL, and prove its soundness by using Coq. GPUCSL is based on a CSL proposed by Blom et al., which is for automatic verification of GPGPU kernels, but employs different inference rules because the rules in Blom's CSL are not standard. For example, Blom's CSL does not have a frame rule. Our CSL is a simple extension of the original CSL, and it is more suitable as a basis of advanced properties proposed for other studies on CSLs. Our soundness proof is based on Vafeiadis' method, which is for a CSL with a fork-join concurrency model. The proof reveals two problems in Blom's approach in terms of soundness and extensibility. First, their assumption that thread ID independence of a kernel implies barrier divergence freedom does not hold. Second, it is not easy to extend their proof to other CSLs with a frame rule. Although our CSL covers only a subset of CUDA, our preliminary experiment shows that it is useful and expressive enough to verify a simple kernel with barriers. |
[108] | Detecting Broken Pointcuts using Structural Commonality and Degree of Interest (Raffi Khatchadourian, Awais Rashid, Hidehiko Masuhara and Takuya Watanabe), In Proceedings of 30th IEEE/ACM International Conference on Automated Software Engineering (ASE 2015) (Lars Grunske, Michael Whalen, eds.), 2015. [bibtex] [doi] [PDF] [abstract] Pointcut fragility is a well-documented problem in Aspect-Oriented Programming; changes to the base-code can lead to join points incorrectly falling in or out of the scope of pointcuts. Deciding which pointcuts have broken due to base-code changes is a daunting venture, especially in large and complex systems. We present an automated approach that recommends pointcuts that are likely to require modification due to a particular base-code change, as well as ones that do not. Our hypothesis is that join points selected by a pointcut exhibit common structural characteristics. Patterns describing such commonality are used to recommend pointcuts that have potentially broken to the developer. The approach is implemented as an extension to the popular Mylyn Eclipse IDE plug-in, which maintains focused contexts of entities relevant to the task at hand using a Degree of Interest (DOI) model. |
[107] | Pyrlang: A High Performance Erlang Virtual Machine Based on RPython (Ruochen Huang, Hidehiko Masuhara and Tomoyuki Aotani), In Companion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity (Jonathan Aldrich, ed.), ACM, 2015. (Poster presentation.) [bibtex] [doi] [PDF] |
[106] | Making Live Programming Practical by Bridging the Gap Between Trial-and-error Development and Unit Testing (Tomoki Imai, Hidehiko Masuhara and Tomoyuki Aotani), In Companion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity (Jonathan Aldrich, ed.), ACM, 2015. (Demonstration.) [bibtex] [doi] [PDF] |
[105] | Shiranui: A Live Programming with Support for Unit Testing (Tomoki Imai, Hidehiko Masuhara and Tomoyuki Aotani), In Companion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity (Jonathan Aldrich, ed.), ACM, 2015. (Poster presentation.) [bibtex] [doi] [PDF] |
[104] | Fraglight: Shedding Light on Broken Pointcuts in Evolving Aspect-Oriented Software (Raffi Khatchadourian, Awais Rashid, Hidehiko Masuhara and Takuya Watanabe), In Companion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity (Jonathan Aldrich, ed.), ACM, 2015. (Demonstration.) [bibtex] [doi] [PDF] |
[103] | Context-Oriented Programming and Units of Adaptation (Hidehiko Masuhara), talk at NII Shonan Meeting on Engineering Adaptive Software Systems (EASSy), 2015. [bibtex] [slides] |
[102] | Unravel Programming Sessions With THRESHER: Identifying Coherent and Complete Sets of Fine-granular Source Code Changes (Stephanie Platz, Marcel Taeumel, Bastian Steinert, Robert Hirschfeld and Hidehiko Masuhara), In Proceedings of the 32nd JSSST Annual Conference (Katsuhisa Maruyama, ed.), 2015. [bibtex] [url] [PDF] |
[101] | Visibility of Context-Oriented Behavior and State in L (Robert Hirschfeld, Hidehiko Masuhara, Atsushi Igarashi and Tim Felgentreff), In Computer Software, volume 32, 2015. (revised from [hirschfeld2014jssst], accepted 2015-04-15) [bibtex] [doi] [PDF] [abstract] One of the properties of context-oriented programming languages is the composition of partial module definitions. While in most such language extensions the state and behavior introduced by partial definitions are treated equally at the module level, we propose a refinement of that approach to allow for both public and restricted visibility of methods and local and shared visibility of fields in our experimental language L. Furthermore, we propose a new lookup mechanism to reduce the risk of name captures. |
[100] | The Omission Finder for Debugging What-Should-Have-Happened Bugs in Object-Oriented Programs (Kouhei Sakurai and Hidehiko Masuhara), In In Proceedings of The 30th ACM/SIGAPP Symposium On Applied Computing (SAC 2015), 2015. [bibtex] [doi] [PDF] [abstract] Trace-based debuggers help a debugging process by displaying a history of executed operations with their parameters in a run of a program. However, those debuggers are unable to provide any clues when a program does not perform operations that ought to occur. This paper proposes a novel feature called the omission finder for trace-based debuggers. This feature correlates points-to analysis results with an execution history to show operations that could have been but actually were not performed on a specified instance if the program behaved differently. We implemented the omission finder on top of an existing trace-based debugger, and confirmed reduction of the number of debugging steps with an omission bug in a real-world program. Our user-study also showed reduction of debugging times with programs containing omission bugs. |
[99] | Generalized Layer Activation Mechanism Through Contexts and Subscribers (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of International Conference on Modularity (Modularity'15), 2015. [bibtex] [doi] [PDF] [abstract] Context-oriented programming (COP) languages modularize context-dependent behaviors in multiple classes into layers. These languages have layer activation mechanisms so that the behaviors in layers take effect on a particular unit of computation during a particular period of time. Existing COP languages have different layer activation mechanisms, and each of them has its own advantages. However, because these mechanisms interfere with each other in terms of extent (time duration) and scope (a set of units of computations) of activation, it is not trivial to combine them into a single language. We propose a generalized layer activation mechanism based on contexts and subscribers to implement the different activation mechanisms in existing COP languages in a single COP language called ServalCJ. Contexts specify the extent of activation through temporal logic terms, and subscribers specify the scope of activation through operators provided by the language. We implement a compiler of ServalCJ, and demonstrate its expressiveness by writing a couple of application programs. |
[98] | A Dynamically-typed Language for Prototyping High-Performance Data Parallel Programs (Hidehiko Masuhara and Tomoyuki Aotani), Poster presentation at JST/CREST International Symposium on Post Petascale System Software, 2014. [bibtex] [PDF] |
[97] | Crossver: a Code Transformation Language for Crosscutting Changes (Kouhei Sakurai and Hidehiko Masuhara), In Proceedings of the 9th International Workshop on Advanced Modularization Techniques (AOAsia/Pacific 2014), 2014. [bibtex] [url] [PDF] [abstract] Software evolution sometimes requires changes of module interfaces, which in turn cause crosscutting changes, or changes of module clients that are spreading over a program. Such changes on the client-side can be too complicated to be automatically achieved by text replacement and refactoring tools. We propose a code transformation language, called Crossver, for consistently updating code fragments in a program. Crossver offers a source-level pattern sublanguage to express complicated transformation conditions. The patterns are robust against variety among clients thanks to the dataflow-based pattern matcher. In the paper, we overview the design and core semantics of Crossver. |
[96] | Visibility of Context-Oriented Behavior and State in L (Robert Hirschfeld, Hidehiko Masuhara, Atsushi Igarashi and Tim Felgentreff), In Proceedings of the 31st JSSST Annual Conference (Atsushi Igarashi, ed.), 2014. (revised version appears in Computer Software journal [hirschfeld2015compsoft]) [bibtex] [url] |
[95] | Code Recommendation Based on a Degree-of-Interest Model (Naoya Murakami, Hidehiko Masuhara and Tomoyuki Aotani), In Proeceedings of the Fourth International Workshop on Recommendation Systems in Software Engineering (RSSE 2014) (Reid Holmes, Werner Janjic, Walid Maalej, eds.), 2014. [bibtex] [doi] [PDF] |
[94] | Context Holders: Realizing Multiple Layer Activation Mechanisms in a Single Context-Oriented Language (Tomoyuki Aotani, Tetsuo Kamina and Hidehiko Masuhara), In Proceedings of the Workshop on Foundations of Aspect-Oriented Languages (FOAL'14) (Eric Bodden, ed.), 2014. [bibtex] [url] [doi] [PDF] [abstract] We propose LamFJ, a calculus for expressing various layer activation mechanisms in context-oriented programming languages. LamFJ extends FeatherweightJava with context holders, which are the abstraction of dynamic layer activation. By encoding programs with different layer activation mechanisms into a program manipulating context holders, LamFJ serves as a foundation to reason about interactions between different mechanisms. This paper presents a sketch of the context holders and encodings of existing layer activation mechanisms. |
[93] | Context-Oriented Software Engineering: A Modularity Vision (Tetsuo Kamina, Tomoyuki Aotani, Hidehiko Masuhara and Tetsuo Tamai), In Proceedings of International Conference on Modularity (Modularity'14), 2014. [bibtex] [doi] [PDF] [abstract] There are a number of constructs to implement context-dependent behavior, such as conditional branches using if statements, method dispatching in object-oriented programming (such as the state design pattern), dynamic deployment of aspects in aspect-oriented programming, and layers in context-oriented programming (COP). Uses of those constructs significantly affect the modularity of the obtained implementation. While there are a number of cases where COP improves modularity, it is not clear when we should use COP in general. This paper presents a preliminary study on our software development methodology, the context-oriented software engineering (COSE), which is a use-case-driven software development methodology that guides us to a specification of context-dependent requirements and design. We provide a way to map the requirements and design formed by COSE to the implementation in our COP language ServalCJ. We applied COSE to two applications in order to assess its feasibility. We also identify key linguistic constructs that make COSE effective by examining existing COP languages. These feasibility studies and examination raise a number of interesting open issues. We finally show our future research roadmap to address those issues. |
[92] | Mapping Context-Dependent Requirements to Event-Based Context-Oriented Programs for Modularity (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the Workshop on Reactivity, Events and Modularity (REM 2013), colocated with OOPSLA'13, 2013. [bibtex] [url] [PDF] [slides] [abstract] There are several challenges in development of context-aware systems. First, while contexts are abstract from the viewpoint of behavior that depends on them, we need to elicit more concrete level of contexts that are sensed by complex context sensing technologies. Second, there are complicated relations between contexts and behavioral variations. Several variations may depend on multiple contexts, and several behavioral variations crosscut across several requirements. Third, contexts and context-dependent behavior reactively change with respect to external/internal events, and these changes also crosscut across several requirements. Finally, these complexities in requirements make it difficult to modularly map requirements to the implementation. This paper proposes a model of context-dependent requirements and shows the modular mapping from the model to the implementation in the existing COP language EventCJ. The model represents the following facts: (1) abstract contexts, context-dependent use cases, and groups of related use cases called layers; (2) concrete level of contexts, context-related external entities, and their correspondence to the abstract contexts; and (3) events that trigger changes of the contexts and thus switch the variations of behavior. We show that all such facts are injectively translated into the program written in EventCJ. |
[91] | Layer and Object Refinement for Context-Oriented Programming in L (Robert Hirschfeld, Hidehiko Masuhara and Atsushi Igarashi), Presented at IPSJ SIG-PRO 95th Workshop on Programming, 2013-2-(2), 2013. (Kitakyushu, Japan) [bibtex] [PDF] [abstract] Context-oriented programming (COP) languages provide layers as an abstraction mechanism for modularizing context-dependent behavioral variations. While existing COP languages offer layers in addition to other constructs like classes asymetrically, we propose an experimental language called L that removes such asymmetry. The design of L started from ContextFJ, our minimalistic COP language, with extensions for state and refinement. This proposal presents one such refinement mechanism as a first step towards a small yet practical COP kernel. |
[90] | A Unified Context Activation Mechanism (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In COP'13: Proceedings of the International Workshop on Context-Oriented Programming, ACM, 2013. [bibtex] [doi] [PDF] [abstract] With the increase of research interest in context-oriented programming (COP), several COP languages with different characteristics have been proposed. Although they share common language features to modularize context-dependent variations of behavior, they take quite different ways to realize them. Because of such differences, each language cannot solely cover all use cases of implementing context-dependent behavioral variations. In this paper, we propose a new COP language Javanese that unifies several COP mechanisms into general linguistic constructs. Specifically, it provides context declarations to identify context and its specification of the range of execution sequences where this context is active, activate declarations to define the relation between contexts and layers, and context group declarations that modularize these declarations and specify the set of instances where they are applied. This paper describes design of Javanese and an implementation strategy. |
[89] | L: Context-Oriented Programming With Only Layers (Robert Hirschfeld, Hidehiko Masuhara and Atsushi Igarashi), In COP'13: Proceedings of the International Workshop on Context-Oriented Programming, ACM, 2013. [bibtex] [doi] [PDF] [abstract] Most if not all extensions to object-oriented languages that allow for context-oriented programming (COP) are asymmetric in the sense that they assume a base implementation of a system to be composed into classes and a set of layers to provide behavioral variations applied to those classes at run-time. We propose L as an experimental language to further explore the design space for COP languages. In this position paper we talk about first steps towards the unification of classes and layers and with that the removal of the asymmetry in composition mechanisms of contemporary COP implementations. |
[88] | Aspect Interfaces: Towards Separate Type-checking of Aspect-Oriented Programs with Inter-Type Declarations (Manabu Toyama, Tomoyuki Aotani, Eric Bodden, Hidehiko Masuhara and Éric Tanter), Presented at IPSJ SIG-PRO 94th Workshop on Programming, 2013-1-(4), 2013. [bibtex] [url] |
[87] | A Core Calculus of Composite Layers (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of Foundations of Aspect-Oriented Langauges (FOAL2013) (Erik Ernst, ed.), 2013. (ACM Digital library) [bibtex] [doi] [PDF] [abstract] Composite layers in context-oriented programming (COP) are the abstraction that localizes conditions about when the specified layer becomes active. A composite layer changes the behavior of the system by implicit layer activation triggered by explicit activation of contexts. Existing studies on formalization of COP languages do not cover such an activation mechanism. This paper formalizes composite layers to clarify the operational semantics of implicit layer activation. Based on this formalization, we prove that the translation of composite layers into the existing COP language is sound, which ensures the correctness of the existing implementation of composite layers. |
[86] | Introducing Composite Layers in EventCJ (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In IPSJ Transaction on Programming, volume 6, 2013. [bibtex] [doi] [PDF] [abstract] Context-oriented programming (COP) languages provide a modularization mechanism called a layer, which modularizes behaviors that are executable under specific contexts, and specify a way to dynamically switch behaviors. However, the correspondence between real-world contexts and units of behavioral variations is not simple. Thus, in existing COP languages, context-related concerns can easily be tangled within a piece of layer activation code. In this paper, we address this problem by introducing a new construct called a composite layer, which declares a proposition in which ground terms are given other layer names (true when active). A composite layer is active only when the proposition is true. We introduce this construct into EventCJ, out COP language, and verify this approach by conducting two case studies involving a context-aware Twitter client and a program editor. The results obtained in our approach show that the layer activation code is simple and free from tangled context-related concerns. We also discuss the efficient implementation of this mechanism in EventCJ. |
[85] | A Type System for Dynamic Layer Composition (Atsushi Igarashi, Robert Hirschfeld and Hidehiko Masuhara), In Proceedings of 19th International Workshop on Foundations of Object-Oriented Languages (FOOL 2012), 2012. [bibtex] [url] [PDF] [abstract] Dynamic layer composition is one of the key features in context-oriented programming (COP), an approach to improving modularity of behavioral variations that depend on the dynamic context of the execution environment. It allows a layer—a set of new or overriding methods that can belong to several classes—to be added to or removed from existing objects in a disciplined way. We develop a type system for dynamic layer composition, which may change the interfaces of objects at run time, based on a variant of ContextFJ, a core calculus for COP, and prove its soundness. |
[84] | Optimizing a Search-based Code Recommendation System (Naoya Murakami and Hidehiko Masuhara), In Proceedings of the third International Workshop on Recommendation Systems for Software Engineering (RSSE'12), 2012. [bibtex] [doi] [PDF] |
[83] | Duplication Removal for a Search-based Recommendation System (Hidehiko Masuhara, Naoya Murakami and Takuya Watanabe), In Proceedings of the 4th International Workshop on Search-driven development: Users, Infrastructure, Tools and Evaluation (SUITE'12), 2012. [bibtex] [doi] [PDF] [abstract] A search-based recommendation system looks, in the code repository, for programs that are relevant to the program being edited. Storing a large amount of open source programs into the repository will make the search results better, but also causes the code clone problem; i.e., recommending a set of program fragments that are almost idential. To tackle this problem, we propose a novel approach that ranks recommended programs by taking their "freshness" count into account. This short paper discusses the background of the problem, and illustrates the proposed algorithm. |
[82] | Bridging Real-World Contexts and Units of Behavioral Variations by Composite Layers (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the Workshop on Context-Oriented Programming (COP'12), ACM, 2012. [bibtex] [doi] [PDF] [abstract] This paper proposes a new linguistic construct composite layers and an extension of EventCJ with it. A composite layer is implicitly activated when the declared condition is met. This extension bridges the gap between contexts and units of behavioral variations that complicates programs written in COP languages. In this proposal, only atomic layers (layers that directly correspond to a context) can be explicitly controlled by linguistic operations for layer activation. Composite layers (layers that are not atomic) are declared with a proposition constructed from other layers. Examples show that the extension simplifies programs and enhances separation of concerns. |
[81] | A Data-Parallel Extension to Ruby for GPGPU: Toward a Framework for Implementing Domain-Specific Optimizations (Hidehiko Masuhara and Yusuke Nishiguchi), In Proceedings of the 9th Workshop on Reflection, AOP and Meta-Data for Software Evolution (RAM-SE'12), ACM, 2012. [bibtex] [doi] [PDF] [abstract] We propose Ikra, a data-parallel extension to Ruby for general-purpose computing on graphical processing unit (GPGPU). Our approach is to provide a special array class with higher-order methods for describing computation on a GPU. With a static type inference system that identifies code fragments that shall be executed on a GPU and with a skeleton-based compiler that generates CUDA code, we aim at separating application logic and parallelization and optimizations. The paper presents the design of Ikra and an overview of its implementation along with preliminary performance evaluation. |
[80] | Reflection on the Power of Pointcuts (Hidehiko Masuhara), Talk at the Symposium in Honor of Professor Akinori Yonezawa's 65th Birthday "Concurrent Objects and Beyond: From Theory to High-Performance Computing", 2012. [bibtex] [url] [slides] |
[79] | Test-Driven Fault Navigation for Debugging Reproducible Failures (Michael Perscheid, Michael Haupt, Robert Hirschfeld and Hidehiko Masuhara), In JSSST Journal on Computer Software, volume 29, 2012. (Presented as [perscheid2011jssst]. Also appears in Journal of Information and Media Technologies, Vol.7, No.4, pp.1370–1376, 2012.) [bibtex] [doi] [PDF] [abstract] Debugging failing test cases, particularly the search for failure causes, is often a laborious and time-consuming activity. With the help of spectrum-based fault localization developers are able to reduce the potentially large search space by detecting anomalies in tested program entities. However, such anomalies do not necessarily indicate defects and so developers still have to analyze numerous candidates one by one until they find the failure cause. This procedure is inefficient since it does not take into account how suspicious entities relate to each other, whether another developer is better qualified for debugging this failure, or how erroneous behavior comes to be. We present test-driven fault navigation as an interconnected debugging guide that integrates spectrum-based anomalies and failure causes. By analyzing failure-reproducing test cases, we reveal suspicious system parts, developers most qualified for addressing localized faults, and erroneous behavior in the execution history. The Paths tool suite realizes our approach: PathMap supports a breadth first search for narrowing down failure causes and recommends developers for help; PathFinder is a lightweight back-in-time debugger that classifies failing test behavior for easily following infection chains back to defects. The evaluation of our approach illustrates the improvements for debugging test cases, the high accuracy of recommended developers, and the fast response times of our corresponding tool suite. |
[78] | A Per-Type Instantiation Mechanism for Generic Aspects (Manabu Toyama, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 3rd International Workshop on Variablity and Composition (VariComp'12), 2012. [bibtex] [doi] [PDF] [abstract] We propose a per-type instantiation mechanism for generic aspects. Though AspectJ supports generic aspects, which declare type parameters, we cannot declare aspects that are parametrized over both field types and return types of applied join points without manually concretizing the type parameters. Our mechanism creates an instance of a generic aspect for each type of the applied join points. |
[77] | Test-Driven Fault Navigation for Debugging Reproducible Failures (Michael Perscheid, Michael Haupt, Robert Hirschfeld and Hidehiko Masuhara), In Proceedings of the 28th Annual Conference of Japan Society for Software Science and Technology (Masahiro Yasugi, ed.), 2011. (Published as [perscheid2012compsoft]) [bibtex] [url] [PDF] [abstract] Debugging activities, particularly those for searching for failure causes, are often laborious and time-consuming. Techniques such as spectrum-based fault localization or back-in-time debugging help programmers to reduce development cost. However, such approaches are often limited to a single point of view, ignoring the need for combined perspectives. We present test-driven fault navigation as an interconnected guide to failure causes. Based on failure-reproducing unit tests, we introduce a novel systematic top-down debugging process with corresponding tool support. With spectrum-based fault localization, we offer navigation to suspicious system parts and erroneous behavior in the execution history and rank developers most qualified for addressing the faults localized. Our evaluation illustrates the practicability of this approach, its high accuracy of developer recommendation, and the fast response times of its corresponding tool suite |
[76] | Featherweight EventCJ: a Core Calculus for a Context-Oriented Language with Event-Based Per-Instance Layer Transition (Tomoyuki Aotani, Tetsuo Kamina and Hidehiko Masuhara), In Proceedings of the Workshop on Context-Oriented Programming (COP'11), 2011. [bibtex] [doi] [PDF] [abstract] We propose Featherweight EventCJ, which is a small calculus for context-oriented languages with event-based per-instance layer controls like EventCJ. It extends ContextFJ with stores, labels and transitions for modeling the per-instance layer management, events and declarative layer transition rules, respectively. |
[75] | A Spontaneous Code Recommendation Tool Based on Associative Search (Takuya Watanabe and Hidehiko Masuhara), In Proceedings of the 3rd International Workshop on Search-driven development: Users, Infrastructure, Tools and Evaluation (SUITE'11), 2011. [bibtex] [doi] [PDF] [abstract] We present Selene, a source code recommendation tool based on an associative search engine. It spontaneously searches and displays example programs while the developer is editing a program text. By using an associative search engine, it can search a repository of two million example programs within a few seconds. This paper discusses issues that are revealed by our ongoing implementation of Selene, in particular those of performance, similarity measures and user interface. |
[74] | Supporting covariant return types and generics in type-relaxed weaving (Tomoyuki Aotani, Manabu Toyama and Hidehiko Masuhara), In Proceedings of Foundations of Aspect-Oriented Langauges (FOAL2011) (Gary T. Leavens, Shmuel Katz, Hidehiko Masuhara, eds.), 2011. [bibtex] [url] [doi] [PDF] [abstract] This paper introduces our ongoing study on type safety of the type relaxed weaving mechanism in the presence of two Java 5 features, namely covariant return types and generics. We point out additional conditions that are necessary to ensure type safety, which can be checked by a slightly modified type checking rules for the type relaxed weaving. |
[73] | ContextFJ: A Minimal Core Calculus for Context-Oriented Programming (Robert Hirschfeld, Atsushi Igarashi and Hidehiko Masuhara), In Proceedings of Foundations of Aspect-Oriented Langauges (FOAL2011) (Gary T. Leavens, Shmuel Katz, Hidehiko Masuhara, eds.), 2011. [bibtex] [url] [doi] [PDF] [abstract] We develop a minimal core calculus called ContextFJ to model language mechanisms for context-oriented programming (COP). Unlike other formal models of COP, ContextFJ has a direct operational semantics that can serve as a precise description of the core of COP languages. We also discuss a simple type system that helps to prevent undefined methods from being accessed via proceed. |
[72] | ContextJ: Context-Oriented Programming with Java (Malte Appeltauer, Robert Hirschfeld, Michael Haupt and Hidehiko Masuhara), In JSSST Journal on Computer Software, volume 28, 2011. (Presented as [appeltauer2009jssst]. JSSST Best Paper Award.) [bibtex] [doi] [PDF] [abstract] The development of context-aware systems requires dynamic adaptation that challenges state-of-the-art programming language support. Context-oriented programming (COP) provides dedicated abstractions for first-class representation of context-dependent behavior. So far, COP has been implemented for dynamically-typed languages such as Lisp, Smalltalk, Python, Ruby, and JavaScript relying on reflection mechanisms, and for the statically-typed programming language Java based on libraries and pre-processors. ContextJ is our compiler-based COP implementation for Java that properly integrates COP's layer concept into the Java type system. In this paper, we introduce ContextJ's language constructs, semantics, and implementation. We present a case-study of a ContextJ-based desktop application. |
[71] | EventCJ: A Context-Oriented Programming Language with Declarative Event-based Context Transition (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 10th International Conference on Aspect-Oriented Software Development (AOSD'11) (Shigeru Chiba, ed.), ACM Press, 2011. [bibtex] [doi] [PDF] [abstract] This paper proposes EventCJ, a context-oriented programming (COP) language that can modularly control layer activation based on user-defined events. In addition to defining context-specific behaviors by using existing COP constructs, the EventCJ programmer declares events to specify when and on which instance layer switching should happen, and layer transition rules to specify which layers should be activated/deactivated upon events. These constructs enable controlling layer activation on a per-instance basis, separately from a base program. We also demonstrate an approach to verify safety properties of layer transitions by using a model checker. With these advantages, EventCJ enables more modular descriptions of context-aware programs, especially when layer switching is triggered in many places of a program, or by activities external to the base program. We implemented a prototype EventCJ compiler with Eclipse IDE support. |
[70] | Combining Static Analysis and Runtime Checking in Security Aspects for Distributed Tuple Spaces (Fan Yang, Hidehiko Masuhara, Tomoyuki Aotani, Flemming Nielson and Hanne Riis Nielson), In Proceedings of the 13th International Conference on Coordination Models and Languages, volume 6721, 2011. [bibtex] [doi] [PDF] [abstract] Enforcing security policies to distributed systems is difficult, in particular, to a system containing untrusted components. We designed AspectKE*, an aspect-oriented programming language based on distributed tuple spaces to tackle this issue. One of the key features in AspectKE* is the program analysis predicates and functions that provide information on future behavior of a program. With a dual value evaluation mechanism that handles results of static analysis and runtime values at the same time, those functions and predicates enable the users to specify security policies in a uniform manner. Our two-staged implementation strategy gathers fundamental static analysis information at load-time, so as to avoid performing all analysis at runtime. We built a compiler for AspectKE*, and successfully implemented security aspects for a distributed chat system and an electronic healthcare record workflow system. |
[69] | Designing Event-based Context Transition in Context-Oriented Programming (Tetsuo Kamina, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of 2nd International Workshop on Context-Oriented Programming (COP'10) (Pascal Costanza, ed.), 2010. [bibtex] [doi] [PDF] [abstract] This paper proposes a new programming language EventCJ. Its design stems from our observation that, in many context-aware applications, context changes are triggered by external events. Thus, in addition to the current COP language mechanisms, namely the one to activate/deactivate layers in accordance with a flow of control in programs, and the one to dispatch method calls to partial methods on active layers, we propose a mechanism to declaratively switch contexts of the receiver of events. EventCJ can declare events that trigger context transitions, and context transition rules that define how each instance's context changes when it receives a specific event. After the transition, the instance acquires the context dependent behaviors provided by the activated context. Each event is declared in an AspectJ-like pointcut that specifies where the event is fired in the join points of the system. EventCJ separates the specification of when each context is activated and deactivated that may crosscut whole program in the existing COP languages. Furthermore, the declarative nature of the context transition rules help validation of some properties that the contexts should satisfy |
[68] | StrongRelaxAJ: integrating adaptability of RelaxAJ and expressiveness of StrongAspectJ (Tomoyuki Aotani, Manabu Toyama and Hidehiko Masuhara), In Proceedings of Foundations of Aspect-Oriented Langauges (FOAL2010) (Klaus Ostermann, ed.), 2010. (Technical report CS-TR-10-04, School of Electrical Engineering and Computer Science, University of Central Florida) [bibtex] [url] [PDF] [slides] [abstract] A sketch of StrongRelaxAJ is presented. StrongRelaxAJ is an extension to AspectJ with a type system for around advice that integrates the ones in RelaxAJ and StrongAspectJ. In other words, StrongRelaxAJ employs the type-relaxed weaving mechanism in RelaxAJ for better adaptability of around advice, and supports type variables and explicit signatures of proceed for better expressiveness without relying on dangerous and annoying dynamic casting on the return values from proceed. |
[67] | AspectKE*: Security Aspects with Program Analysis for Distributed Systems (Fan Yang, Hidehiko Masuhara, Tomoyuki Aotani, Flemming Nielson and Hanne Riis Nielson), In Proceedings of the 9th Workshop on Aspects, Components, and Patterns for Infrastructure Software (ACP4IS'10), (published as Technical Report No. 33, Hasso-Plattner Institut, University of Potsdam) (Bram Adams, Michael Haupt, Daniel Lohmann, eds.), 2010. [bibtex] [url] [PDF] [abstract] Enforcing security policies to distributed systems is difficult, in particular, when a system contains untrusted components. We designed AspectKE*, a distributed AOP language based on a tuple space, to tackle this issue. In AspectKE*, aspects can enforce access control policies that depend on future behavior of running processes. One of the key language features is the predicates and functions that extract results of static program analysis, which are useful for defining security aspects that have to know about future behavior of a program. AspectKE* also provides a novel variable binding mechanism for pointcuts, so that pointcuts can uniformly specify join points based on both static and dynamic information about the program. Our implementation strategy performs fundamental static analysis at load-time, so as to retain runtime overheads minimal. We implemented a compiler for AspectKE*, and demonstrate usefulness of AspectKE* through a security aspect for a distributed chat system. |
[66] | AspectKE*: Security Aspects with Program Analysis for Distributed Systems (Fan Yang, Hidehiko Masuhara, Tomoyuki Aotani, Flemming Nielson and Hanne Riis Nielson), Demonstration presentation at Aspect-Oriented Software Development, 2010. [bibtex] [url] |
[65] | Type Relaxed Weaving (Hidehiko Masuhara, Atsushi Igarashi and Manabu Toyama), In Proceedings of the 9th International Conference on Aspect-Oriented Software Development (AOSD'10) (Mario Südholt, ed.), ACM Press, 2010. [bibtex] [doi] [PDF] [abstract] Statically typed aspect-oriented programming languages restrict application of around advice only to the join points that have conforming types. Though the restriction guarantees type safety, it can prohibit application of advice that is useful, yet does not cause runtime type errors. To this problem, we present a novel weaving mechanism, called the type relaxed weaving, that allows such advice applications while preserving type safety. We formalized the mechanism, and implemented as an AspectJ compatible compiler, called RelaxAJ. |
[64] | Event-specific Software Composition in Context-Oriented Programming (Malte Appeltauer, Robert Hirschfeld, Hidehiko Masuhara, Michael Haupt and Kazunori Kawauchi), In Proceedings of the Conference on Software Composition (SC'10), Springer-Verlag, volume 6144, 2010. [bibtex] [doi] [PDF] [abstract] Context-oriented programming (COP) introduces dedicated abstractions for the modularization and dynamic composition of crosscutting context-specific functionality. While existing COP languages offer constructs for control-flow specific composition, they do not yet consider the explicit representation of event-specific context-dependent behavior, for which we observe two distinguishing properties: First, context can affect several control flows. Second, events can establish new contexts asynchronously. In this paper, we propose new language constructs for event-specific composition and explicit context representation and introduce their implementation in JCop, our COP extension to Java. |
[63] | Optimizing Dynamic Pointcuts by using SCoPE (Tomoyuki Aotani and Hidehiko Masuhara), Poster presentation at AOSD.09, 2009. [bibtex] |
[62] | Can we use AOP for patching?: A weakness in AspectJ's type system and a remedy (Hidehiko Masuhara), Talk at the Workshop on Trade-offs in Software Language Engineering, University of Twente, the Netherlands, 2009. [bibtex] [abstract] Whether you like or not, one of the typical usages of AOP is to tentatively modify program's behavior in order to fix a bug, to quickly add a new feature, to simulate different execution environment, and so on. This talk illustrates a weakness in AspectJ's type system for such purposes, which is too restrictive about types of the around advice. We then propose an AspectJ compiler that has a more relaxed type system without compromising type safety. |
[61] | Improving the Development of Context-dependent Java Applications (Malte Appeltauer, Robert Hirschfeld and Hidehiko Masuhara), In Proceedings of the Intenational workshop on Context-Oriented Programming (COP'09), 2009. [bibtex] [doi] [PDF] [abstract] Context-oriented programming languages ease the design and implementation of context-dependent applications. ContextJ is a context-oriented extension to the Java programming language. In this paper, we assess the applicability of ContextJ language abstractions for the development of a graphical user interface-based application. We present a text editor that has been implemented with ContextJ based on the Qt Jambi framework and discuss possible extensions to ContextJ to improve its applicability. |
[60] | ContextJ: Context-Oriented Programming with Java (Malte Appeltauer, Robert Hirschfeld, Michael Haupt and Hidehiko Masuhara), In Proceedings of the 26th Annual Conference of Japan Society for Software Science and Technology (Hideya Iawasaki, ed.), 2009. (Full paper veresion is published as [appeltauer2011compsoft]) [bibtex] [url] [PDF] [abstract] Context-oriented programming (COP) allows for the modularization of context-dependent behavioral variations. So far, COP has been implemented for dynamically-typed languages such as Lisp, Smalltalk, Python, and Ruby relying on reflection mechanisms, and for the statically-typed programming language Java based on a library and a pre-processor. ContextJ is our COP implementation for Java. It properly integrates COP's layer concept into the Java type system. ContextJ is compiler-based. As confirmed by a benchmark and a case study, it provides both better performance and higher-level abstraction mechanisms than its Java-based predecessors. In this paper, we present the ContextJ language and explain its constructs and semantics. Further, we give an overview of the implementation of our compiler and discuss run-time benchmarks. |
[59] | A Join Point Model for Implicit Conversion (Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 5th Asian Workshop on Aspect-Oriented Softawer Development (AOAsia 5), 2009. (Position paper) [bibtex] [url] |
[58] | An Abstraction Mechanism for Aspect-Oriented Programming Based on Test Cases" (Hidehiko Masuhara), Talk at the 12th GRACE Seminar, 2008. [bibtex] [url] [slides] |
[57] | On Type Restriction of Around Advice and Aspect Interference (Hidehiko Masuhara), In Proceedings of the 3rd International Workshop on Aspects, Dependencies and Interactions (ADI'08), 2008. [bibtex] [url] [PDF] [abstract] Statically typed AOP languages restrict application of around advice only to the join points that have conforming types. Though the restriction guarantees type safety, it can prohibit application of advice that is useful, yet does not cause runtime type errors. To this problem, we present a novel weaving mechanism, called the type relaxed weaving, that allows such advice applications while preserving type safety. This paper discusses language design issues to support the type relaxed weaving in AOP languages. |
[56] | Towards Right Abstraction Mechanisms for Crosscutting Concerns (Hidehiko Masuhara), Workshop on Reflection, AOP and Meta-Data for Software Evolution (RAM-SE'08), 2008. (Keynote talk) [bibtex] [url] [PDF] |
[55] | Test-Based Pointcuts for Robust and Fine-Grained Join Point Specification (Kouhei Sakurai and Hidehiko Masuhara), In Proceedings of the 7th International Conference on Aspect-Oriented Software Development (AOSD'08) (Mira Mezini, ed.), ACM Press, 2008. [bibtex] [doi] [PDF] [abstract] We propose test-based pointcuts, a novel pointcut mechanism for AspectJ-like aspect-oriented programming languages. The idea behind the test-based pointcuts is to specify join points through unit test cases associated with the target program. The test-based pointcuts improve robustness and precision of pointcut languages. The test-based pointcuts are more robust against software evolution because they do not directly rely on identifier names in a target program. The test-based pointcuts are more precise because they can distinguish fine grained execution histories including conditional branches by comparing the runtime execution histories with recorded for ones of the unit test cases. This paper presents design and implementation of the test-based pointcuts as an extension of an AspectJ compiler. We evaluated robustness and runtime efficiency of test-based pointcuts through case studies that applied test-based pointcuts to several versions of practical application programs. |
[54] | SCoPE: an AspectJ compiler for developing intuitive and robust aspects by using program analysis (Tomoyuki Aotani and Hidehiko Masuhara), Poster presentation at AOSD.08, 2008. [bibtex] |
[53] | Spontaneous Source Code Recommendation Tool based on Text Search Techniques (Hidehiko Masuhara and Takuya Watanabe), Poster presentation at Microsoft Research Asia (MSRA) Regional Workshop on Web-Scale Natural Language Processing, 2008. [bibtex] [PDF] |
[52] | SCoPE: an AspectJ Compiler for Supporting User-Defined Analysis-Based Pointcuts (Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the 6th International Conference on Aspect-Oriented Software Development (AOSD'07) (Oege de Moor, ed.), ACM Press, 2007. [bibtex] [doi] [PDF] [abstract] This paper proposes an approach called SCoPE, which supports user-defined analysis-based pointcuts in aspect-oriented programming (AOP) languages. The advantage of our approach is better integration with existing AOP languages than previous approaches. Instead of extending the language, SCoPE allows the programmer to write a pointcut that analyzes a program by using a conditional (if) pointcut with introspective reflection libraries. A compilation scheme automatically eliminates runtime tests for such a pointcut. The approach also makes effects of aspects visible to the analysis, which is essential for determining proper aspect interactions. We implemented a SCoPE compiler for the AspectJ language on top of the AspectBench compiler using a backpatching technique. The implementation efficiently finds analysis-based pointcuts, and generates woven code without runtime tests for those pointcuts. Our benchmark tests with JHotDraw and other programs showed that SCoPE compiles programs with less than 1% compile-time overhead, and generates a program that is as efficient as an equivalent program that uses merely static pointcuts. |
[51] | Towards A Type System for Rejecting Never-Matching Pointcut Compositions (Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of Foundations of Aspect-Oriented Langauges (FOAL2007) (Shmuel Katz, ed.), 2007. [bibtex] [url] [PDF] [abstract] Pointcuts in the current AspectJ family of languages are loosely checked because the languages allow compositions of pointcuts that never match any join points, which developers are unlikely to intend, for example, \verb|set(* *)&&get(* *)|. We formalize the problem by defining well-formedness of pointcuts and design a novel type system for assuring well-formedness. The type of pointcuts is encoded by using record, union and the bottom types. |
[50] | Test-based Pointcuts: A Robust Pointcut Mechanism Based on Unit Test Cases for Software Evolution (Kouhei Sakurai and Hidehiko Masuhara), In Workshop on Linking Aspect Technology and Evolution (LATE 2007), 2007. [bibtex] [url] [PDF] [abstract] This paper proposes test-based pointcuts, a new aspect-oriented programming language construct that uses unit test cases as interface of crosscutting concerns. A test-based pointcut primarily specifies a set of test cases associated to a program. At execution time, it matches the join points that have the same execution history to the one of the specified test cases. The test-based approach improves pointcut definitions in two respects. First, test-based pointcuts are less fragile with respect to program changes because rather than directly relying on type and operation names in a program, they indirectly specify join points through unit test cases, which are easier to be kept up-to-date. Second, test-based pointcuts can discriminate execution histories without requiring to specify detailed execution steps, as they use test cases as abstractions of execution histories. With the abstractions, the second respect contributes to the first respect. We designed and implemented the test-based pointcuts as an extension to AspectJ, and confirmed, through an case study, test-based pointcuts are more robust against evolution when used for a practical application program. |
[49] | Relaxing Type Restrictions of Around Advice in Aspect-Oriented Programming (Hidehiko Masuhara), (Zhong Shao, ed.), Poster presentation at APLAS 2007, volume 4807, 2007. (poster presentation) [bibtex] [url] [doi] [PDF] [slides] |
[48] | A Fine-Grained Join Point Model for More Reusable Aspects (Hidehiko Masuhara, Yusuke Endoh and Akinori Yonezawa), In Proceedings of the Fourth ASIAN Symposium on Programming Languages and Systems (APLAS 2006) (Naoki Kobayashi, ed.), Springer-Verlag, volume 4279, 2006. [bibtex] [doi] [PDF] [abstract] We propose a new join point model for aspect-oriented programming (AOP) languages. In most AOP languages including AspectJ, a join point is a time interval of an action in execution. While those languages are widely accepted, they have problems in aspects reusability, and awkwardness when designing advanced features such as tracematches. Our proposed join point model, namely the point-in-time join point model redefines join points as the moments both at the beginning and end of actions. Those finer-grained join points enable us to design AOP languages with better reusability and flexibility of aspects. In this paper, we designed an AspectJ-like language based on the point-in-time model. We also give a denotational semantics of a simplified language in a continuation passing style, and demonstrate that we can straightforwardly model advanced language features such as exception handling and cflow pointcuts. |
[47] | Issues on Observing Aspect Effects from Expressive Pointcuts (Hidehiko Masuhara and Tomoyuki Aotani), In Proceedings of Workshop on Aspects, Dependencies and Interactions (ADI'06), 2006. [bibtex] [PDF] [abstract] This paper discusses issues on interactions of aspects with expressive pointcuts. Since expressive pointcuts specify join points based on the results of program analysis, they should be carefully designed in order to analyze effects of aspects and their precedence correctly. We show examples in which aspects with expressive pointcuts interact, and point out the required properties to those pointcuts for correct aspect interaction. We also briefly present our approach to satisfy those properties in our SCoPE compiler, which supports expressive pointcuts within AspectJ language. |
[46] | Aspect Mining using Structural Program Properties (Jan Hannemann and Hidehiko Masuhara), A talk at The Second DIKU-IST Joint Workshop on Foundations of Software, 2006. [bibtex] |
[45] | Continuation Join Points (Yusuke Endoh, Hidehiko Masuhara and Akinori Yonezawa), In Proceedings Foundations of Aspect-Oriented Languages Workshop (FOAL 2006) at AOSD 2006 (Curtis Clifton, Ralf Lämmel, Gary T. Leavens, eds.), volume TR \#06-01, 2006. [bibtex] [PDF] [abstract] In AspectJ-like languages, there are several different kinds of advice declarations, which are specified by using advice modifiers such as before and after returning. This makes semantics of advice complicated and also makes advice declarations less reusable since advice modifiers are not param- eterized unlike pointcuts. We propose a simpler join point model and an experimental AOP language called PitJ. The proposed join point model has only one kind of advice, but has finer grained join points. Even though we unified different kinds of advice into one, the resulted language is sufficiently expressive to cover typical advice usages in AspectJ, and has improved advice reusability by allowing pointcuts, rather than advice modifiers, to specify when advice body runs. Along with the language design, this paper gives a formalization of the join point model in a continuation-passing style (CPS). |
[44] | Design and Implementation of An Aspect Instantiation Mechanism (Kouhei Sakurai, Hidehiko Masuhara, Naoyasu Ubayashi, Saeko Matsuura and Seiichi Komiya), In LNCS Transactions on Aspect-Oriented Software Development (Awais Rashid, Mehmet Akşit, eds.), volume 3880/2006, 2006. (Extended from [sakurai2004aosd].) [bibtex] [doi] [PDF] [abstract] This paper describes the design and implementation of association aspects, which are a linguistic mechanism for the AspectJ language that concisely associates aspect instances to object groups by extending the per-object aspects in AspectJ. This mechanism allows an aspect instance to be associated to a group of objects, and by providing a new pointcut primitive to specify aspect instances as execution context of advice. With association aspects, we can straightforwardly implement crosscutting concerns that have stateful behavior related to a particular group of objects. The new pointcut primitive can more flexibly specify aspect instances when compared against previous implicit mechanisms. We implemented a compiler for association aspects by modifying the AspectJ compiler, which reduces the size of data structures for keeping associations. Our benchmark tests confirm that the overheads of association aspects are reasonably small when compared against functionally equivalent aspects in pure AspectJ that manually manage associations. The expressiveness of association aspects is demonstrated through development of an integrated development environment with and without association aspects. |
[43] | Pointcut & Advice Mechanism and Types: the case of Aspectual Caml (Hidehiko Masuhara), Talk at the First Asian Workshop on Aspect-Oriented Software Development, 2005. [bibtex] [url] |
[42] | A Parameterized Interpreter for Modeling Different AOP Mechanisms (Naoyasu Ubayashi, Hidehiko Masuhara and Tetsuo Tamai), In 2005 IEEE/ACM International Conference on Automated Software Engineering (ASE 2005), 2005. [bibtex] [PDF] [abstract] We present a parameterized interpreter for modeling aspect-oriented mechanisms. The interpreter takes several param- eters to cover different AOP mechanisms found in AspectJ, Hyper/J, and Demeter. The interpreter helps our understanding of the AOP mechanisms in two ways. First, its core part represents the common mechanical structure shared by different AOP mechanisms. Second, by reconstructing the existing AOP mechanisms and using parameters to configure the interpreter, we can illustrate the differences and similarities of those mechanisms clearly. This will also be helpful in rapid-prototyping a new AOP mechanism or a reflective AOP system that supports different mechanisms. |
[41] | Aspectual Caml: an Aspect-Oriented Functional Language (Hidehiko Masuhara, Hideaki Tatsuzawa and Akinori Yonezawa), In Proceedings of International Conference on Functional Programming (ICFP 2005) (Benjamin Pierce, ed.), 2005. (Extended from [tatsuzawa2005foal].) [bibtex] [url] [PDF] [slides] [abstract] We propose an aspect-oriented programming (AOP) language called Aspectual Caml based on a strongly-typed functional language Objective Caml with two AOP mechanisms similar to those in AspectJ language. This paper describes the design and implementation issues of those AOP mechanisms that give us insights into the interaction between AOP features and common features in strongly-typed functional languages such as type inference, polymorphic types and curried functions. We implemented a prototype compiler of the language and used the language for separating crosscutting concerns in application programs, including for separating descriptions of a type system from compiler descriptions. |
[40] | Is Join Point a Point?: a pointcut and advice mechanism for making aspects more reusable (Yusuke Endoh, Hidehiko Masuhara and Akinori Yonezawa), In Proceedings of Workshop on New Approaches to Software Construction (WNASC 2005) (Tetsuo Tamai, ed.), 2005. [bibtex] [PDF] [slides] |
[39] | Aspectual Caml: an Aspect-Oriented Functional Language (Hideaki Tatsuzawa, Hidehiko Masuhara and Akinori Yonezawa), In Proceedings of Foundations of Aspect-Oriented Langauges (FOAL2005) (Curtis Clifton, Ralf Lämmel, Gary T. Leavens, eds.), 2005. (An extended version appears as [masuhara2005icfp].) [bibtex] [url] [PDF] [abstract] We propose an aspect-oriented programming (AOP) language called Aspectual Caml based on a strongly-typed functional language Objective Caml. Aspectual Caml offers two AOP mechanisms, namely the pointcut and advice mechanism and the type extension mechanism, which gives similar functionality to the inter-type declarations in AspectJ. Those mechanisms are not simple adaptation of the similar mechanisms in existing AOP languages, but re-designed for common programming styles in functional languages such as type inference, polymorphic types, and curried functions. We implemented a prototype compiler of the language and used the language for separating crosscutting concerns in application programs, including separating a type system from a compiler of a simple language. |
[38] | Compiling Conditional Pointcuts for User-Level Semantic Pointcuts (Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of Software-Engineering Properties of Languages and Aspect Technologies (SPLAT05) (Lodewijk Bergmans, Kris Gybels, Peri Tarr, Erik Ernst, eds.), 2005. [bibtex] [PDF] [abstract] We propose a compilation framework that compiles conditional pointcuts (i.e., if pointcuts) in AspectJ for allowing the programmer to define expressive pointcuts without runtime overheads. The framework automatically finds conditional pointcuts that are static with respect to join point shadows, evaluates them at compile-time, and generates compiled code that performs no runtime tests for those pointcuts. By writing conditions that examine static properties of a program, the programmer can simulate many semantic pointcuts within current AspectJ's semantics yet without runtime overheads. Our compiler implementation identifies static conditional pointcuts by using a technique similar to the binding-time analysis in partial evaluation, and employs double-compilation scheme to guarantee the same behavior to the code generated by the existing AspectJ compilers. Our experiments confirmed that the compiler is capable of compiling several semantic pointcuts, such as the ones testing class membership (e.g., has and hasfield), testing join point location (e.g., withinstaticinitialization), matching by using regular expressions, and checking high-level coding rules (e.g., the Law of Demeter). |
[37] | A Unit Testing Framework for Aspects without Weaving (Yudai Yamazaki, Kouhei Sakurai, Saeko Matsuura, Hidehiko Masuhara, Hiroaki Hashiura and Seiichi Komiya), In Proceedings of Workshop on Testing Aspect-Oriented Programs (WTAOP'05) (Roger T. Alexander, Anneliese A. Andrews, eds.), 2005. [bibtex] [PDF] [abstract] Unit testing of aspects can verify aspects implementations of aspects against their specification. Current technique for unit testing of aspects requires to weave the aspect definition into a target program, which thus makes it difficult to write comprehensive test cases and to avoid interference from other aspects. In this paper, we propose a framework for unit testing aspects without weaving. Our framework generates testing methods from an aspect definition so that test cases can directly verify properties of aspects such as the advice behavior and pointcut matching. |
[36] | A Value Profiler for Assisting Object-Oriented Program Specialization (Takahiro Kamio and Hidehiko Masuhara), In Proceedings of Workshop on New Approaches to Software Construction (WNASC 2004) (Tetsuo Tamai, ed.), 2004. [bibtex] [PDF] [abstract] We present a value profiler for object-oriented programs that counts frequencies parameters to method calls. It is aimed at identifying methods that can be optimized by program specialization techniques. By adding timestamps to objects, the profiler accurately tests equality over mutable objects on a per-method basis. Our experiments with a 64602 lines of Java program showed that the profile report can reduce effort at manually finding the target methods of optimization, which speeded the overall execution time up more than 10%. |
[35] | An AOP Implementation Framework for Extending Join Point Models (Naoyasu Ubayashi, Hidehiko Masuhara and Tetsuo Tamai), In ECOOP2004 Workshop on Reflection, AOP and Meta-Data for Software Evolution (RAM-SE'04), 2004. [bibtex] [url] [PDF] [abstract] Mechanisms in AOP (aspect-oriented programming) can be characterized by a JPM (join point model). AOP is effective in unanticipated software evolution because crosscutting concerns can be added or removed without making invasive modifications on original programs. However, the effectiveness would be restricted if new crosscutting concerns cannot be described with existing JPMs. Mechanisms for extending JPMs are needed in order to address the problem. In this paper, an implementation framework for extending JPMs is proposed. Using the framework, we can introduce new kinds of JPMs or extend existing JPMs in the process of software evolution. |
[34] | Association Aspects (Kouhei Sakurai, Hidehiko Masuhara, Naoyasu Ubayashi, Saeko Matsuura and Seiichi Komiya), In Proceedings of the 3rd International Conference on Aspect-Oriented Software Development (AOSD'04) (Karl Lieberherr, ed.), ACM Press, 2004. [bibtex] [doi] [PDF] [abstract] We propose a linguistic mechanism for AspectJ-like languages that concisely associates aspect instances to object groups. The mechanism, which supports association aspects, extends the per-object aspects in AspectJ by allowing an aspect instance to be associated to a group of objects, and by providing a new pointcut primitive to specify aspect instances as execution contexts of advice. With association aspects, we can straightforwardly implement crosscutting concerns that have stateful behavior related to a particular group of objects. The new pointcut primitive can more flexibly specify aspect instances when compared against previous implicit mechanisms. The comparison of execution times between the programs with association aspects and the ones with regular AspectJ aspects revealed that the association aspects exhibited almost equivalent for the medium-sized configurations. |
[33] | Dataflow Pointcut for Integrity Concerns (Kazunori Kawauchi and Hidehiko Masuhara), In Proceedings of AOSD Technology for Application-level Security (AOSDSEC'04), 2004. [bibtex] [url] [PDF] [abstract] Some security concerns, such as secrecy and integrity, are sensitive to flow of information in a program execution. We proposed a new pointcut to aspect-oriented programming (AOP) languages in order to easily implement such security concerns as aspects. The pointcut identifies join points based on the origins of values, and can be used with the other kinds of pointcuts in existing AOP languages. This paper presents an example how the pointcut can be applied to an integrity concern in a web-application. |
[32] | Dataflow Pointcut in Aspect-Oriented Programming (Hidehiko Masuhara and Kazunori Kawauchi), In Proceedings of The First Asian Symposium on Programming Languages and Systems (APLAS'03) (Atsushi Ohori, ed.), volume 2895, 2003. [bibtex] [doi] [PDF] [slides] [abstract] A dataflow-based pointcut is proposed for aspect-oriented programming (AOP) languages. The pointcut specifies where aspects should be applied based on the origins of values. It is designed to be compatible with the other kinds of pointcuts in existing AOP languages. Primary application fields of the pointcut are the aspects in which flow of information is important, such as security. This paper presents the design of the pointcut with a web-application example, and its prototype implementation. |
[31] | Modeling Crosscutting in Aspect-Oriented Mechanisms (Hidehiko Masuhara and Gregor Kiczales), In Proceedings of European Conference on Object-Oriented Programming (ECOOP2003) (Luca Cardelli, ed.), Springer-Verlag, volume 2743, 2003. [bibtex] [url] [doi] [PDF] [slides] [abstract] Modeling four aspect-oriented programming mechanisms shows the way in which each supports modular crosscutting. Comparing the models produces a clear three part characterization of what is required to support crosscutting structure: a common frame of reference that two (or more) programs can use to connect with each other and each provide their semantic contribution. |
[30] | A Compilation and Optimization Model for Aspect-Oriented Programs (Hidehiko Masuhara, Gregor Kiczales and Chris Dutchyn), In Proceedings of 12th International Conference on Compiler Construction (CC2003), volume 2622, 2003. [bibtex] [url] [doi] [PDF] [abstract] This paper presents a semantics-based compilation model for an aspect-oriented programming language based on its operational semantics. Using partial evaluation, the model can explain several issues in compilation processes, including how to find places in program text to insert aspect code and how to remove unnecessary run-time checks. It also illustrates optimization of calling-context sensitive pointcuts (cflow), implemented in real compilers. |
[29] | Aspect SandBox (Chris Dutchyn, Gregor Kiczales and Hidehiko Masuhara), project homepage at http://www.cs.ubc.ca/labs/spl/projects/asb.html, 2002. [bibtex] |
[28] | Supporting Objects in Run-time Bytecode Specialization (Reynald Affeldt, Hidehiko Masuhara, Eijiro Sumii and Akinori Yonezawa), In ACM SIGPLAN ASIAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (ASIA-PEPM'02) (Wei-Ngan Chin, ed.), ACM Press, 2002. [bibtex] [doi] [PDF] [abstract] This paper describes a run-time specialization system for the Java language. One of the main difficulties of supporting the full Java language resides in a sound yet effective management of references to objects. This is because the specialization process may share references with the running application that executes the residual code, and because side-effects through those references by the specialization process could easily break the semantics of the running application. To cope with these difficulties, we elaborate requirements that ensure sound run-time specialization. Based on them, we design and implement a run-time specialization system for the Java language, which exhibits, for instance, approximately 20-25% speed-up factor for a ray-tracing application. |
[27] | Compilation Semantics of Aspect-Oriented Programs (Hidehiko Masuhara, Gregor Kiczales and Chris Dutchyn), In FOAL 2002 Proceedings: Foundations Of Aspect-Oriented Languages, Workshop at AOSD 2002 (Gary T. Leavens, Ron Cytron, eds.), 2002. (revised version in [masuhara2003cc]) [bibtex] [url] [PDF] [abstract] This paper presents a semantics-based compilation framework for an aspect-oriented programming language based on its operational semantics model. Using partial evaluation, the framework can explain several issues in compilation processes, including how to find places in program text to insert aspect code and how to remove unnecessary run-time checks. It also illustrates optimization of calling-context sensitive pointcuts (cflow), implemented in real compilers. |
[26] | AOP Language Exploration Using the Aspect Sand Box (Chirs Dutchyn, Gregor Kiczales and Hidehiko Masuhara), Tutorial on 1st International Conference on Aspect-Oriented Software Development (AOSD 2002), 2002. [bibtex] [url] |
[25] | A Portable Approach to Dynamic Optimization in Run-time Specialization (Hidehiko Masuhara and Akinori Yonezawa), In Journal of New Generation Computing, volume 20, 2001. (Extended from [masuhara2001pado2].) [bibtex] [url] [doi] [PDF] [abstract] This paper proposes a run-time bytecode specialization (BCS) technique that analyzes programs and generates specialized programs at run-time in an intermediate language. By using an intermediate language for code generation, a back-end system can optimize the specialized programs after specialization. The system uses Java virtual machine language (JVML) as the intermediate language, which allows the system to easily achieve practical portability and to use existing sophisticated just-in-time (JIT) compilers as its back-end. The binding-time analysis algorithm is based on a type system, and covers a non-object-oriented subset of JVML. The specializer generates programs on a per-instruction basis, and can perform method inlining at run-time. Our performance measurements show that a non-trivial application program specialized at run-time by BCS runs approximately 3–4 times faster than the unspecialized one. Despite the large overhead of JIT compilation of specialized code, we observed that the overall performance of the application can be improved. |
[24] | Reflection in Concurrent Object-Oriented Languages (Hidehiko Masuhara and Akinori Yonezawa), Chapter in Formal Methods for Distributed Processing: An Object Oriented Approach (Howard Bowman, John Derrick, eds.), Cambridge University Press, 2001. [bibtex] [url] |
[23] | Run-time Bytecode Specialization: A Portable Approach to Generating Optimized Specialized Code (Hidehiko Masuhara and Akinori Yonezawa), In Second Symposium on Programs as Data Objects (PADO II) (Olivier Danvy, Andrzej Filinski, eds.), Springer-Verlag, volume 2053, 2001. (An extended version appears as [masuhara2001ngc].) [bibtex] [PDF] [abstract] This paper proposes a run-time bytecode specialization (BCS) technique that analyzes programs and generates specialized programs at run-time in an intermediate language. By using an intermediate language for code generation, a back-end system can optimize the specialized programs after specialization. As the intermediate language, the system uses Java virtual machine language (JVML), which allows the system to easily achieve practical portability and to use sophisticated just-in-time compilers as its back-end. The binding-time analysis algorithm, which is based on a type system, covers a non-object-oriented subset of JVML. A specializer, which generates programs on a per-instruction basis, can perform method inlining at run-time. The performance measurement showed that a non-trivial application program specialized at run-time by BCS runs approximately 3–4 times faster than the unspecialized one. Despite the large amount of overheads at JIT compilation of specialized code, we observed that the overall performance of the application can be improved. |
[22] | DynJava: Type Safe Dynamic Code Generation in Java (Yutaka Oiwa, Hidehiko Masuhara and Akinori Yonezawa), In JSSST Workshop on Programming and Programming Languages (PPL2001) (Kenjiro Taura, Jacuques Garrigue, eds.), 2001. [bibtex] [url] |
[21] | Dynamic Compilation of a Reflective Language Using Run-Time Specialization (Hidehiko Masuhara, Yuuya Sugita and Akinori Yonezawa), In International Symposium on Principles of Software Evolution (Takuya Katayama, Tetsuo Tamai, Naoki Yonezaki, eds.), IEEE Computer Society, 2000. [bibtex] [url] [PDF] [abstract] In reflective languages, application programs can customize a language system that executes the application programs. Our premise is that this customizability of reflective languages can be a basic mechanisms of software evolution. In this paper, we present a simple architecture of a reflective language that can dynamically select meta-interpreters, and a dynamic compilation scheme by using run-time specialization (RTS) techniques, which could also be useful to dynamically optimize systems with mechanisms of dynamic software evolution. Our prototype system showed that dynamically compiled reflective programs run more than four times faster than the interpreted ones, and that compilation processes are fast enough to be invoked at runtime. Compared to statically compiled programs, however, dynamically compiled ones yet have 20-30% overheads. We also discuss this problem. |
[20] | Wrapping Class Libraries for Migration-Transparent Resource Access by Using Compile-Time Reflection (Hiroshi Yamauchi, Hidehiko Masuhara, Daisuke Hoshina, Tatsurou Sekiguchi and Akinoni Yonezawa), In Workshop on Reflective Middleware (RM2000) (Gordon Blair, Roy Campbell, eds.), 2000. [bibtex] [PDF] |
[19] | An Object-Oriented Concurrent Reflective Language ABCL/R3: Its Meta-level Design and Efficient Implementation Techniques (Hidehiko Masuhara and Akinori Yonezawa), Chapter in Object-Oriented Parallel and Distributed Programming (Jean-Paul Bahsoun, Takanobu Baba, Jean-Pierre Briot, Akinori Yonezawa, eds.), HERMES Science Publications, 2000. [bibtex] |
[18] | Generating Optimized Residual Code in Run-time Specialization (Hidehiko Masuhara and Akinori Yonezawa), In Proceedings of International Colloquium on Partial Evaluation and Program Transformation, 1999. [bibtex] [PDF] [abstract] Run-time specialization (RTS) techniques efficiently generate specialized programs with respect to run-time values. They construct compiled native-code fragments called templates at compile-time, and generate a specialized program by merely copying the templates. The generated programs are less efficient than those generated by static partial evaluation techniques because the RTS techniques prevent many optimizations. The proposed bytecode specialization (BCS) technique is used to generate programs in a bytecode language and then translate the generated bytecode into native code by using a just-in-time (JIT) compiler. Its advantages are (1) efficient specialization processes that are similar to those of RTS techniques, (2) efficient specialized programs thanks to optimizations by the JIT compilers, and (3) that it is independent of the source-to-bytecode and the bytecode-to-native compilers thanks to a binding-time analysis algorithm that directly handles bytecode programs. Thus far, a BCS system has been implemented for a Java virtual machine subset. Micro-benchmarking showed that BCS with JIT compilation generates specialized programs that run more than 3-times faster than ones generated by traditional RTS techniques and that this specialization process takes less than one second. |
[17] | ByteCode Specialization (BCS): A Run-Time Specialization Technique in JVM Bytecode (Hidehiko Masuhara), Poster Presentation at ACM Java Grande'99, 1999. [bibtex] |
[16] | A Simple Extension of Java Language for Controllable Transparent Migration and Its Portable Implementation (Tatsurou Sekiguchi, Hidehiko Masuhara and Akinori Yonezawa), In Proceedings of Third International Conference on Coordination Models and Languages (COORDINATION'99) (Paolo Ciancarini, Alexander L. Wolf, eds.), Springer-Verlag, 1999. [bibtex] [doi] [PDF] [abstract] A scheme has been developed that enables a Java program to be migrated across computers while preserving its execution state, such as the values of local variables and the dynamic extents of try-and-catch blocks. This scheme provides the programmer with flexible control of migration, including transparent migration. It is based on source-code-level transformation. The translator takes as input code a Java program written in a Java language extended with language constructs for migration, and outputs pure Java source code that uses JavaRMI. The translated code can run on any Java interpreter and can be compiled by any just-in-time compiler. We have measured some execution performance for several application programs, and found that the translated programs are only about 20% slower than the original programs. Because migration is completely controlled by using only three language constructs added to the Java language (go , undock and migratory), the programmer can write programs to be migrated easily and succinctly. Our system is available in the public domain. |
[15] | Optimizing Reflective Languages by Using Partial Evaluation (Hidehiko Masuhara, Yuuya Sugita and Akinori Yonezawa), In Program Transformation Workshop (PTW'99), 1999. [bibtex] |
[14] | On-the-fly Specialization of Reflective Programs Using Dynamic Code Generation Techniques (Yuuya Sugita, Hidehiko Masuhara, Kenichi Harada and Akinori Yonezawa), In OOPSLA'98 Workshop on Reflective Programming in C++ and Java (Jean-Charles Fabre, Shigeru Chiba, eds.), volume 98–4, 1998. [bibtex] [PDF] |
[13] | Design and Partial Evaluation of Meta-objects for a Concurrent Reflective Language (Hidehiko Masuhara and Akinori Yonezawa), In Proceedings of European Conference on Object-Oriented Programming (ECOOP'98) (Eric Jul, ed.), Springer-Verlag, volume 1445, 1998. [bibtex] [url] [doi] [PDF] [abstract] Customizable meta-objects are a powerful abstraction for extending language features and implementation mechanisms, but interpretive execution suffers from severe performance penalty. Some of this penalty can be reduced by applying partial evaluation to meta-interpreters, but partial evaluation of meta-objects in existing concurrent object-oriented languages is ineffective. This paper proposes a new meta-object design for our reflective language ABCL/R3. It yields meta-objects that can be optimized effectively using partial evaluation. The crux of the design is the separation of state-related operations from other operations, and this separation is accomplished by using reader/writer methods in our concurrent object-oriented language called Schematic. Our benchmark trials show that non-trivial programs with partially evaluated meta-objects run more than six times faster than ones that are interpreted by meta-objects. In addition, a partially evaluated program that uses a customized meta-object runs as efficiently as a program that is manually rewritten so as to have the same functionality without using meta-objects. |
[12] | A Reflective Approach to Support Software Evolution (Hidehiko Masuhara and Akinori Yonezawa), In International Workshop on Principles of Software Evolution (IWPSE'98) (Takuya Katayama, ed.), 1998. [bibtex] |
[11] | Reasoning-conscious Meta-object Design of a Reflective Concurrent Language (Hidehiko Masuhara and Akinori Yonezawa), In Proceedings of International Symposium on Biologically Inspired Computation (IMSA'97), 1997. [bibtex] |
[10] | Partial Evaluation of Call-by-value lambda-calculus with Side-effects (Kenichi Asai, Hidehiko Masuhara and Akinori Yonezawa), In Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM'97), 1997. [bibtex] [url] [doi] [PDF] [abstract] We present a framework of an online partial evaluator for a call-by-vahre A-calculus with destructiveupdatesof data structures. It properly and correctly specializes expressions that contain side-effects, while preserving pointer equality, which is an important property for programs using updates. Our partial evaluator uses a side-effect analysis to extract immutable data structures and then performs an online specialization using preactions. Once mutable and immutable data structures are separated, partial evaluation is done in such a way that accesses to immutable ones are performed at specialization time, while accesses to mutable ones are residualized. For the correct residualization of side-effecting operations, preactions are used to solve various issues, including code elimination, code duplication, and execution order preservation. The preaction mechanism also enables us to reduce expressions that were residualized when the conventional let-expression approach of Similix was used. The resulting partial evaluator is simple enough to prove its correctness. Based on the framework, we have constructed a partial evaluator for Scheme, which is powerful enough to specialize fairly complicated programs with side-effects, such as an interpreter. |
[9] | Partial Evaluation of Call-by-value lambda-calculus with side-effects (Kenichi Asai, Hidehiko Masuhara and Akinori Yonezawa), Technical report 96–04, Department of Information Science, the University of Tokyo, 1996. [bibtex] |
[8] | Implementing Parallel Language Constructs Using a Reflective Object-Oriented Language (Hidehiko Masuhara, Satoshi Matsuoka and Akinori Yonezawa), In Reflection'96 (Gregor Kiczales, ed.), 1996. [bibtex] [url] [PDF] [abstract] To provide various parallel language constructs, extensible languages based on reflection are attractive for both implementors and users. This paper describes our proposed meta-level architecture of a concurrent object-oriented language ABCL/R3, which has the following characteristics: (1) language customization through meta-interpreters and meta-objects, (2) delegation and inheritance mechanisms facilitating modular and re-usable meta-level programming, and (3) the reflective annotations and meta-level arguments realizing separation of base- and meta-level programs. We also show that several meta-level programs that provide common parallel programming strategies, such as object replication and latency hiding, are easily implemented. |
[7] | Partial Evaluator as a Compiler for Reflective Languages (Kenichi Asai, Hidehiko Masuhara, Satoshi Matsuoka and Akinori Yonezawa), Technical report 95–10, Department of Information Science, the University of Tokyo, 1995. [bibtex] [PDF] |
[6] | Compiling Away the Meta-Level in Object-Oriented Concurrent Reflective Languages Using Partial Evaluation (Hidehiko Masuhara, Satoshi Matsuoka, Kenichi Asai and Akinori Yonezawa), In Proceedings of Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA) (OOPSLA'95) (Mary E. S. Loomis, ed.), volume 30(10), 1995. [bibtex] [doi] [PDF] [abstract] Meta-level programmability is beneficial for parallel/distributed object-oriented computing to improve performance, etc. The major problem, however, is interpretation overhead due to meta-circular interpretation. To solve this problem, we propose a compilation framework for object-oriented concurrent reflective languages using partial evaluation. Since traditional partial evaluators do not allow us to directly deal with meta-circular interpreters written with concurrent objects, we devised techniques such as pre-/post-processing, a new proposed preaction extension to partial evaluation in order to handle side-effects, etc. Benchmarks of a prototype compiler for our language ABCL/R3 indicate that (1) the meta-level interpretation is essentially `compiled away,' and (2) meta-level optimizations in a parallel application, running on a Fujitsu MPP AP1000, exhibits only 10–30% overhead compared to the hand-crafted source-level optimization in a non-reflective language. |
[5] | Efficient Implementation Technique for Object-Oriented Concurrent Reflective Languages Using Partial Evaluation (Hidehiko Masuhara, Satoshi Matsuoka, Kenichi Asai and Akinori Yonezawa), In Proceedings of International Workshop on New Models for Software Architecture (IMSA'95), 1995. (Digested version of [masuhara95oopsla].) [bibtex] |
[4] | An Object-Oriented Concurrent Reflective Language for Dynamic Resource Management in Highly Parallel Computing (Hidehiko Masuhara, Satoshi Matsuoka and Akinori Yonezawa), In IPSJ Technical Reports SIG-PRG, volume 1994, 1994. [bibtex] [url] [PDF] |
[3] | Distributed Memory Reflective Architecture for High Performance Object-Oriented Computing (Hidehiko Masuhara, Satoshi Matsuoka and Akinori Yonezawa), In Workshop on Object Oriented Computing (WOOC), 1994. [bibtex] |
[2] | Designing an OO Reflective Language for Massively-Parallel Processors (Hidehiko Masuhara, Satoshi Matsuoka and Akinori Yonezawa), In Proceedings of OOPSLA'93 Workshop on Object-Oriented Reflection and Metalevel Architectures, 1993. [bibtex] |
[1] | Object-Oriented Concurrent Reflective Languages can be Implemented Efficiently (Hidehiko Masuhara, Satoshi Matsuoka, Takuo Watanabe and Akinori Yonezawa), In Proceedings of Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA) (OOPSLA'92) (John Pugh, ed.), ACM Press, 1992. [bibtex] [doi] [PDF] [abstract] Computational reflection is beneficial in concurrent computing in offering a linguistic mechanism for incorporating user-specific policies . New challenges are (1) how to implement them, and (2) how to do so efficiently. We present efficient implementation schemes for object-oriented concurrent reflective languages using our language ABCL/R2 as an example. The schemes include: efficient lazy creation of metaobjects/meta-groups, partial compilation of scripts (methods), dynamic progression, self-reification, and light-weight objects, all appropriately integrated so that the user-level semantics remain consistent with the meta-circular definition so that the full power of reflection is retained, while achieving practical efficiency. ABCL/R2 exhibits two orders of magnitude speed improvement over its predecessor, ABCL/R, and in fact compares favorably to the ABCL/1 compiler and also C + Sun LWP, neither supporting reflection. |