C++ Books

Showing posts with label Gabriel Dos Reis. Show all posts
Showing posts with label Gabriel Dos Reis. Show all posts

Tuesday, November 6, 2012

Open and Efficient Type Switch for C++

by Yuriy Solodkyy, Gabriel Dos Reis, and Bjarne Stroustrup

Selecting operations based on the run-time type of an object is key to many object-oriented and functional programming techniques. We present a technique for implementing open and efficient type switching on hierarchical extensible data types. The technique is general and copes well with C++ multiple inheritance.

To simplify experimentation and gain realistic performance using production-quality compilers and tool chains, we implement a type switch construct as an ISO C++11 library, called Mach7. This library-only implementation provides concise notation and outperforms the visitor design pattern, commonly used for case analysis on types in object-oriented programming. For closed sets of types, its performance roughly equals equivalent code in functional languages, such as OCaml and Haskell. The type-switching code is easier to use and is more expressive than hand-coded visitors are. The library is non-intrusive and circumvents most of the extensibility restrictions typical of the visitor design pattern. It was motivated by applications involving large, typed, abstract syntax trees.

See also: OOPSLA'12 paper, slides, notes, extras, Mach7 Library

Wednesday, March 30, 2011

An Automatic Parallelization Framework for Algebraic Computation Systems

A paper "An Automatic Parallelization Framework for Algebraic Computation Systems" by Yue Li and Gabriel Dos Reis was accepted by ISSAC 2011


Abstract:
This paper proposes an automatic parallelization framework for an existing computer algebra system. The framework performs a semantics-based static analysis to extract reductions in library components. Reductions using associative binary operators are automatically transformed to their parallel versions. Our implementation is evaluated using algebraic library functions and a self-implemented application. Experimental results show that up to 5 times speed-up for the application is obtained. It is feasible to adapt the core of this framework to other algebraic computation systems and programming languages. The adaptation requires a type system which is able to provide semantics algebraic information from users.