• DocumentCode
    1934015
  • Title

    A graph-based higher-order intermediate representation

  • Author

    Leisa, Roland ; Koster, Marcel ; Hack, Sebastian

  • fYear
    2015
  • fDate
    7-11 Feb. 2015
  • Firstpage
    202
  • Lastpage
    212
  • Abstract
    Many modern programming languages support both imperative and functional idioms. However, state-of-the-art imperative intermediate representations (IRs) cannot natively represent crucial functional concepts (like higher-order functions). On the other hand, functional IRs employ an explicit scope nesting, which is cumbersome to maintain across certain transformations. In this paper we present Thorin: a higher-order, functional IR based on continuation-passing style that abandons explicit scope nesting in favor of a dependency graph. This makes Thorin an attractive IR for both imperative as well as functional languages. Furthermore, we present a novel program transformation to eliminate the overhead caused by higher-order functions. The main component of this transformation is lambda mangling: an important transformation primitive in Thorin. We demonstrate that lambda mangling subsumes many classic program transformations like tail-recursion elimination, loop unrolling or (partial) inlining. In our experiments we show that higher-order programs translated with Thorin are consistently as fast as C programs.
  • Keywords
    data structures; graph theory; high level languages; program compilers; C programs; Thorin; continuation-passing style; dependency graph; functional concepts; functional idioms; functional languages; graph based higher order intermediate representation; imperative languages; lambda mangling; program transformations; programming languages; Benchmark testing; Java; Optimization; Programming; Semantics; Syntactics;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Code Generation and Optimization (CGO), 2015 IEEE/ACM International Symposium on
  • Conference_Location
    San Francisco, CA
  • Type

    conf

  • DOI
    10.1109/CGO.2015.7054200
  • Filename
    7054200