Sunday, April 20, 2008
Ten Years After
On 18th April 1998 I got my master degree in Computer Science summa cum laude (Laurea in Informatica) at Dipartimento di Sistemi e Informatica, Universita' di Firenze... so... 10 years has passed now! Oh my God! It seems like yesterday... tempus fugit!
Pubblicato da betto a 1:49 PM 0 commenti
Etichette: research
Saturday, December 15, 2007
doublecpp (dynamic overloading in C++)
Doublecpp is a preprocessor for C++ that handles a new linguistic construct for defining branches of a multi-method. The "right'' branch of such a method will be selected dynamically at run-time according to the actual type of the object on which the method is invoked and to the actual type of the first argument: double dispatch.
This way, you will have dynamic overloading (but only on the first argument, for the other arguments standard static overloading will be adopted).
The home page of the project is http://doublecpp.sourceforge.net. And the documentation can be found on-line at this link.
Doublecpp is based on our research on formalization and implementation of dynamic overloading in languages providing only static overloading. In particular, doublecpp will take as input a program written in C++ extended with the linguistic construct for dynamic overloading and will produce in output a standard C++ program with the same semantics.
The idea of the translation is based on the Visitor pattern, but it does not require the programmer to manually implement such pattern; furthermore, it performs all the type checks to assure type safety; thus, it is not merely an automatic implementation of this pattern.
Such implementation avoids down-casts and it is efficient since it uses dynamic binding twice, i.e., dynamic overloading takes place in constant time (other implementations rely on RTTI checks and require to inspect the class hierarchy, thus their complexity depends on the depth and width of the class hierarchy).
More importantly, our implementation of dynamic overloading is type safe: once the program is successfully compiled, no run-time errors (exceptions) will be raised during the execution of the program. Thus, all possible (static and dynamic) ambiguities are ruled out during the type checking.
The papers concerning this research are the following:
Translating Double-Dispatch into Single-Dispatch
Lorenzo Bettini, Sara Capecchi, Betti Venneri.
Proceedings of the Second Workshop on Object Oriented Developments (WOOD 2004). pp. 59-78. ENTCS vol. 138 no. 2. Elsevier. 2005. abstract doubledisp.pdf bibtex
Double Dispatch in C++
Lorenzo Bettini, Sara Capecchi, Betti Venneri.
Software - Practice and Experience. pp. 581 - 613. vol. 36 no. 6. 2006. abstract spelxb.ps.gz bibtex
Pubblicato da betto a 11:03 PM 1 commenti
Monday, October 01, 2007
Researcher in Turin
It's with great pleasure that I can announce that today I started to work as a Researcher (in Computer Science) at Dipartimento di Informatica, University of Turin! On 20th September 2007 I won the permanent position, and I'm very happy and proud to work in this department :-)
Pubblicato da betto a 3:04 PM 4 commenti
Etichette: research
Tuesday, October 31, 2006
Featherweight Wrap Java
Hurray! They accepted our paper "Featherweight Wrap Java" at SAC (The 22nd Annual ACM Symposium on Applied Computing), Special Track on Object-Oriented Programming Languages and Systems (OOPS), it will then appear on the proceedings of the conference (published by ACM press):
Lorenzo Bettini, Sara Capecchi, Elena Giachino.
Proc. of SAC (The 22nd Annual ACM Symposium on Applied Computing), Special Track on Object-Oriented Programming Languages and Systems (OOPS). ACM Press. 2007. To appear. abstract wrapjava.pdf bibtex
Abstract
We present an extension for a Java like language with a mechanism
for dynamically extending object behaviors. Our approach consists
in moving the addition of new features from class (static) level
to object (dynamic) level: the basic features of entities (representing
their structure) are separated from the additional ones (wrapper
classes whose instances represent run-time added behaviors). At
run-time, these entities can be dynamically composed by instantiating
wrapper objects which are attached to basic entities. We
formalize our extension by adding the new constructs to Featherweight
Java; the core language so extended (Featherweight Wrap
Java) is type safe.
Hopefully, this will become a Java extension (in the shape of a preprocessor) in order to have this "delegation-like" feature. The basic idea is to be able to extend object behaviors (methods) dynamically by wrapping objects. This reminds the Decorator pattern , and indeed this pattern was our main inspiration. (See the image representing the Decorator class diagram).
This way, you won't have to implement the pattern manually: you will simply use our proposed language extension.
Actually the language extension we propose is more powerful than what you get with decorator patterns, since it implements both consultation mechanisms and delegation mechanisms.
The theory of this extension is based on Featherweight Java.
Pubblicato da betto a 8:12 PM 1 commenti
Etichette: Featherweight Java, java, research