skip to main content
research-article

Composing typemaps in Twig

Published:26 September 2012Publication History
Skip Abstract Section

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.Google ScholarGoogle Scholar
  2. F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, New York, NY, USA, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. M. Beazley. Automated scientific software scripting with SWIG. Future Gener. Comput. Syst., 19: 599--609, July 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  5. K. Fisher, R. Pucella, and J. Reppy. Data-level interoperability. In Electronic Notes in Theoretical Computer Science, 2001.Google ScholarGoogle Scholar
  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.Google ScholarGoogle ScholarCross RefCross Ref
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. E. Visser and Z. el Abidine Benaissa. A core language for rewriting. Electronic Notes in Theoretical Computer Science, 15: 422--441, Jan 1998.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Composing typemaps in Twig

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      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
      • 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

      Copyright © 2012 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 26 September 2012

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!