Attaining multiple dispatch in widespread object-oriented languages

  1. Francisco Ortin 1
  2. Jose Quiroga 1
  3. J. M. Redondo
  4. Miguel Garcia 1
  1. 1 Computer Science Department, University of Oviedo, Spain
Aldizkaria:
DYNA: revista de la Facultad de Minas. Universidad Nacional de Colombia. Sede Medellín

ISSN: 0012-7353

Argitalpen urtea: 2014

Alea: 81

Zenbakia: 186

Orrialdeak: 242-250

Mota: Artikulua

DOI: 10.15446/DYNA.V81N186.40428 DIALNET GOOGLE SCHOLAR lock_openSarbide irekia editor

Beste argitalpen batzuk: DYNA: revista de la Facultad de Minas. Universidad Nacional de Colombia. Sede Medellín

Laburpena

Multiple dispatch allows determining the actual method to be executed, depending on the dynamic types of its arguments. Although some programming languages provide multiple dispatch, most widespread object-oriented languages lack this feature. Therefore, different implementation techniques are commonly used to obtain multiple dispatch in these languages. We evaluate the existing approaches, presenting a new one based on hybrid dynamic and static typing. A qualitative evaluation is presented, considering factors such as software maintainability and readability, code size, parameter generalization, and compile-time type checking. We also perform a quantitative assessment of runtime performance and memory consumption.

Erreferentzia bibliografikoak

  • Chambers, G., Object-oriented multi-methods in Cecil. European Conference on Object-Oriented Programming (ECOOP). The Netherlands, 1992, pp. 33-56.
  • Erich, G., Richard, H., Ralph, J. and John, V., Design patterns: Elements of reusable object-oriented software. Addison Wesley, 1995.
  • Ortin, F., Zapico, D. and Cueva, J.M., Design patterns for teaching type checking in a compiler construction course, IEEE Transactions on Education 50, pp. 273-283, 2007.
  • Torgersen, M., The expression problem revisited. European Conference on Object-Oriented Programming (ECOOP). Oslo, Norway, 2004, pp. 123-146.
  • Ortin, F., López, B. and Pérez-Schofield, J.B.G., Separating adaptable persistence attributes through computational reflection, IEEE Software 21, pp. 41-49, 2004.
  • Maes, P., Computational Reflection. PhD Thesis, Laboratory for Artificial Intelligence, Vrije Universiteit, Amsterdam, The Netherlands, 1987.
  • Redondo, J.M. and Ortin, F., Efficient support of dynamic inheritance for class- and prototype-based languages, Journal of Systems and Software 86, pp. 278-301, 2013.
  • Meijer, E. and Drayton, P., Static typing where possible, dynamic typing when needed: The end of the cold war between programming languages. OOPSLA 2004 Workshop on Revival of Dynamic Languages. Vancouver, Canada, 2004, pp.1-6.
  • Bierman, G., Meijer, E. and Torgersen, M., Adding dynamic types to C#. European Conference on Object-Oriented Programming (ECOOP). Maribor, Slovenia, 2010, pp. 76-100.
  • Ortin, F., Zapico, D., Perez-Schofield, J.B.G. and Garcia, M., Including both static and dynamic typing in the same programming language, IET Software, 4, pp. 268-282, 2010.
  • Ortin, F., Redondo, J.M. and Perez-Schofield, J.B.G., Efficient virtual machine support of runtime structural reflection, Science of computer Programming 74, pp. 836-860, 2009.
  • Redondo, J.M., Ortin, F. and Cueva, J.M., Optimizing reflective primitives of dynamic languages, International Journal of Software Engineering and Knowledge Engineering 18, pp. 759-783, 2008.
  • Ortin, F., Garcia, M., Redondo, J.M. and Quiroga, J., Achieving multiple dispatch in hybrid statically and dynamically typed languages. World Conference on Information Systems and Technologies (WorldCIST), Advances in Information Systems and Technologies 206, pp. 703-713, 2013.
  • Georges, A., Buytaert, D. and Eeckhout, L., Statistically rigorous Java performance evaluation. Object-Oriented Programming, Systems, Languages & Applications (OOPSLA). Montreal, 2007. Pp.57-76.
  • Lilja, D.J., Measuring computer performance: A practitioner's guide. Cambridge University Press, 2005.
  • Chiles, B. and Turner, A., Dynamic Language Runtime [May 2014] Available at: http://www.codeplex.com/Download?ProjectName=dlr&DownloadId=127512.
  • Gómez-Luna, E., Fernando-Navas, D., Aponte-Mayor, G. and Betancour-Buitrago, L.A., Literature review methodology for scientific and information management, through its structuring and systematization, DYNA 81 (184), pp 158-163, 2014.
  • DeMichiel, L.G. and Gabriel, R.P., The common lisp object system: An overview. European Conference on Object-Oriented Programming (ECOOP). Paris, France, 1987, pp.151-170.
  • Hickey, R., The Clojure programming language. Symposium on Dynamic Languages (DLS). Paphos, Cyprus, 2008, pp.1-10.
  • ClojureCLR., A port of Clojure to the CLR, part of the Clojure project [May 2014]. Available at: https://github.com/clojure/clojure-clr
  • Eclipse Project, Xtend, Java 10 today! [May 2014] Available at: http://www.eclipse.org/xtend.
  • Shalit, A., The Dylan reference manual: The definitive guide to the new object-oriented dynamic language. Addison Wesley Longman Publishing, 1996.
  • Groovy 2.0 release notes. A "static theme" for a dynamic language. [May 2014] Available at: http://groovy.codehaus.org/Groovy+2.0+release+notes
  • Grothoff, C., Walkabout revisited: The Runabout. European Conference on Object-Oriented Programming (ECOOP). Darmstadt, Germany, 2003, pp. 103-125.
  • Palsberg, J. and Jay, C.B., The essence of the visitor pattern. Computer Software and Applications Conference (COMPSAC). Vienna, Austria, 1998, pp. 9-15.
  • Büttner, F., Radfelder, O., Lindow, A. and Gogolla, M., Digging into the visitor pattern. International Conference on Software Engineering & Knowledge Engineering (SEKE). Banff, Alberta, Canada, 2004, pp. 135-141.
  • Forax, R., Duris, E. and Roussel, G., Reflection-based implementation of Java extensions: The double-dispatch use-case. Symposium on Applied Computing (SAC). Santa Fe, New Mexico, 2005, pp. 1409-1413.
  • Clifton, C., Leavens, G.T., Chambers, G. and Millstein, T., MultiJava: Modular open classes and symmetric multiple dispatch for Java. Object-Oriented Programming Systems, Languages, and Applications (OOPSLA). Minneapolis, Minnesota, 2000, pp. 130-145.
  • Forax, R., Duris, E. and Roussel, G., A reflective implementation of Java multi-methods, IEEE Transactions on Software Engineering 30, pp. 1055-1071, 2004.
  • Cunei, A. and Vitek, J., An efficient and flexible toolkit for composing customized method dispatchers, Software: Practice and Experience 38, pp. 33-73, 2008.
  • Ortin, F., Type inference to optimize a hybrid statically and dynamically typed language, Computer Journal 54, pp. 1901-1924, 2011.
  • Ortin, F., Conde, P., Fernandez-Lanvin, D. and Izquierdo, R., A runtime performance of invokedynamic: Evaluation with a Java library, IEEE Software 31, pp. 1-16, 2014.