Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Journal articles
  4. Lightweight Modular Staging: A Pragmatic Approach to Runtime Code Generation and Compiled DSLs
 
research article

Lightweight Modular Staging: A Pragmatic Approach to Runtime Code Generation and Compiled DSLs

Rompf, Tiark  
•
Odersky, Martin  
2012
Communications Of The Acm

Good software engineering practice demands generalization and abstraction, whereas high performance demands specialization and concretization. These goals are at odds, and compilers can only rarely translate expressive high-level programs to modern hardware platforms in a way that makes best use of the available resources. Generative programming is a promising alternative to fully automatic translation. Instead of writing down the target program directly, developers write a program generator, which produces the target program as its output. The generator can be written in a high-level, generic style and still produce efficient, specialized target programs. In practice, however, developing high-quality program generators requires a very large effort that is often hard to amortize. We present Lightweight Modular Staging (LMS), a generative programming approach that lowers this effort significantly. LMS seamlessly combines program generator logic with the generated code in a single program, using only types to distinguish the two stages of execution. Through extensive use of component technology, LMS makes a reusable and extensible compiler framework available at the library level, allowing programmers to tightly integrate domain-specific abstractions and optimizations into the generation process, with common generic optimizations provided by the framework. LMS is well suited to develop embedded domain specific languages (DSLs) and has been used to develop powerful performance-oriented DSLs for demanding domains such as machine learning, with code generation for heterogeneous platforms including GPUs. LMS has also been used to generate SQL for embedded database queries and JavaScript for web applications.

  • Files
  • Details
  • Metrics
Type
research article
DOI
10.1145/2184319.2184345
Web of Science ID

WOS:000304442000032

Author(s)
Rompf, Tiark  
Odersky, Martin  
Date Issued

2012

Published in
Communications Of The Acm
Volume

55

Start page

121

End page

130

Subjects

Languages

•

Libraries

Editorial or Peer reviewed

REVIEWED

Written at

EPFL

EPFL units
LAMP1  
Available on Infoscience
June 15, 2012
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/81907
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés