skip to main content
10.1145/2371401.2371408acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

Composing typemaps in Twig

Published: 26 September 2012 Publication History

Abstract

Twig is a language for writing typemaps, programs which transform the type of a value while preserving its underlying meaning. Typemaps are typically used by tools that generate code, such as multi-language wrapper generators, to automatically convert types as needed. Twig builds on existing typemap tools in a few key ways. Twig's typemaps are composable so that complex transformations may be built from simpler ones. In addition, Twig incorporates an abstract, formal model of code generation, allowing it to output code for different target languages. We describe Twig's formal semantics and show how the language allows us to concisely express typemaps. Then, we demonstrate Twig's utility by building an example typemap.

References

[1]
Python/C API Reference Manual. http://docs.python.org/c-api/, Jan. 2012.
[2]
F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, New York, NY, USA, 1998.
[3]
D. M. Beazley. Automated scientific software scripting with SWIG. Future Gener. Comput. Syst., 19: 599--609, July 2003.
[4]
M. Blume. No-longer-foreign: Teaching an ML compiler to speak C natively. Electronic Notes in Theoretical Computer Science, 59(1): 36--52, 2001.
[5]
K. Fisher, R. Pucella, and J. Reppy. Data-level interoperability. In Electronic Notes in Theoretical Computer Science, 2001.
[6]
K. Fisher, R. Pucella, and J. Reppy. A framework for interoperability. In Proceedings of the First International Workshop on Multi-Language Infrastructure and Interoperability (BABEL'01), volume 59 of Electronic Notes in Theoretical Computer Science, Sept. 2001.
[7]
K. Fisher and J. Reppy. The design of a class mechanism for Moby. In Proceedings of the SIGPLAN 1999 Conference on Programming Language Design and Implementation, pages 37--49, New York, NY, May 1999. ACM.
[8]
G. Hulette, M. Sottile, and A. Malony. Wool: A workflow programming language. ESCIENCE '08: Proceedings of the 2008 Fourth IEEE International Conference on eScience, Dec 2008.
[9]
J. Reppy and C. Song. Application-specific foreign-interface generation. In Proceedings of the Fifth International Conference on Generative Programming and Component Engineering, pages 49--58, Oct. 2006.
[10]
E. Visser and Z. el Abidine Benaissa. A core language for rewriting. Electronic Notes in Theoretical Computer Science, 15: 422--441, Jan 1998.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
GPCE '12: Proceedings of the 11th International Conference on Generative Programming and Component Engineering
September 2012
148 pages
ISBN:9781450311298
DOI:10.1145/2371401
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 48, Issue 3
    GPCE '12
    March 2013
    140 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2480361
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 26 September 2012

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. foreign function interface
  2. type mapping

Qualifiers

  • Research-article

Conference

GPCE'12
Sponsor:
GPCE'12: Generative Programming and Component Engineering
September 26 - 27, 2012
Dresden, Germany

Acceptance Rates

Overall Acceptance Rate 56 of 180 submissions, 31%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media