Multiple dispatch using compile-time metaprogramming

Seyed Hossein Haeri, Paul Keir

Research output: Contribution to conferencePresentation

Abstract

We solve the multiple dispatch problem for a components-for-cases encoding of algebraic datatypes in C++. For the multi-method, the programmer is required to specify the decentralised match statements using overloads of template functions. Then, they employ a one-liner preprocessor macro, which expands to the real dispatcher. The expanded one-liner performs iterative pointer introspection to accomplish late-binding using overload resolution. Even though we present our solution for ADTs, one can use the same technology for other types too.
Original languageEnglish
Publication statusPublished - 4 Nov 2018
EventACM SIGPLAN Conference on Systems, Programming, Languages and Applications: Software for Humanity - Boston Park Plaza Hotel, Boston, United States
Duration: 4 Nov 20189 Nov 2018
https://2018.splashcon.org/

Conference

ConferenceACM SIGPLAN Conference on Systems, Programming, Languages and Applications
Abbreviated titleSPLASH 2018
CountryUnited States
CityBoston
Period4/11/189/11/18
Internet address

Fingerprint

Macros

Keywords

  • Metaprogramming
  • C++
  • Functional Programming

Cite this

Haeri, S. H., & Keir, P. (2018). Multiple dispatch using compile-time metaprogramming. ACM SIGPLAN Conference on Systems, Programming, Languages and Applications, Boston, United States.
Haeri, Seyed Hossein ; Keir, Paul. / Multiple dispatch using compile-time metaprogramming. ACM SIGPLAN Conference on Systems, Programming, Languages and Applications, Boston, United States.
@conference{ff7258a847a145e8bd616d5e35f7884b,
title = "Multiple dispatch using compile-time metaprogramming",
abstract = "We solve the multiple dispatch problem for a components-for-cases encoding of algebraic datatypes in C++. For the multi-method, the programmer is required to specify the decentralised match statements using overloads of template functions. Then, they employ a one-liner preprocessor macro, which expands to the real dispatcher. The expanded one-liner performs iterative pointer introspection to accomplish late-binding using overload resolution. Even though we present our solution for ADTs, one can use the same technology for other types too.",
keywords = "Metaprogramming, C++, Functional Programming",
author = "Haeri, {Seyed Hossein} and Paul Keir",
note = "This presentation was delivered remotely.; ACM SIGPLAN Conference on Systems, Programming, Languages and Applications : Software for Humanity, SPLASH 2018 ; Conference date: 04-11-2018 Through 09-11-2018",
year = "2018",
month = "11",
day = "4",
language = "English",
url = "https://2018.splashcon.org/",

}

Haeri, SH & Keir, P 2018, 'Multiple dispatch using compile-time metaprogramming' ACM SIGPLAN Conference on Systems, Programming, Languages and Applications, Boston, United States, 4/11/18 - 9/11/18, .

Multiple dispatch using compile-time metaprogramming. / Haeri, Seyed Hossein; Keir, Paul.

2018. ACM SIGPLAN Conference on Systems, Programming, Languages and Applications, Boston, United States.

Research output: Contribution to conferencePresentation

TY - CONF

T1 - Multiple dispatch using compile-time metaprogramming

AU - Haeri, Seyed Hossein

AU - Keir, Paul

N1 - This presentation was delivered remotely.

PY - 2018/11/4

Y1 - 2018/11/4

N2 - We solve the multiple dispatch problem for a components-for-cases encoding of algebraic datatypes in C++. For the multi-method, the programmer is required to specify the decentralised match statements using overloads of template functions. Then, they employ a one-liner preprocessor macro, which expands to the real dispatcher. The expanded one-liner performs iterative pointer introspection to accomplish late-binding using overload resolution. Even though we present our solution for ADTs, one can use the same technology for other types too.

AB - We solve the multiple dispatch problem for a components-for-cases encoding of algebraic datatypes in C++. For the multi-method, the programmer is required to specify the decentralised match statements using overloads of template functions. Then, they employ a one-liner preprocessor macro, which expands to the real dispatcher. The expanded one-liner performs iterative pointer introspection to accomplish late-binding using overload resolution. Even though we present our solution for ADTs, one can use the same technology for other types too.

KW - Metaprogramming

KW - C++

KW - Functional Programming

UR - https://2018.splashcon.org/track/meta-2018

M3 - Presentation

ER -

Haeri SH, Keir P. Multiple dispatch using compile-time metaprogramming. 2018. ACM SIGPLAN Conference on Systems, Programming, Languages and Applications, Boston, United States.