Lightweight Modular Staging: A Pragmatic Approach to Runtime Code Generation and Compiled DSLs.
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...
| Published in: | Communications of the ACM Vol. 55; no. 6; pp. 121 - 131 |
|---|---|
| Format: | Article |
| Published: |
Association for Computing Machinery
Jun2012
|
| Subjects: | |
| Online Access: | View this record in EBSCOhost |
| fields | @attributes: recordID: 1 pdfLink: plink: https://search.ebscohost.com/login.aspx?direct=true&db=hlh&AN=76246852&site=ehost-live header: @attributes: shortDbName: hlh uiTerm: 76246852 longDbName: Humanities International Complete uiTag: AN controlInfo: bkinfo: jinfo: jid: 00010782 ACM jtl: Communications of the ACM issn: 00010782 maglogo: N pubinfo: dt: Jun2012 vid: 55 iid: 6 pid: 68 pub: Association for Computing Machinery artinfo: ui: 76246852 10.1145/2184319.2184345 ppf: 121 ppct: 10 formats: tig: atl: Lightweight Modular Staging: A Pragmatic Approach to Runtime Code Generation and Compiled DSLs. aug: su: Software engineering Generative programming (Computer science) Domain-specific programming languages Coding theory Program generators (Computer programs) Code generators sug: subj: Software engineering Generative programming (Computer science) Domain-specific programming languages Coding theory Program generators (Computer programs) Code generators ab: 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 can 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. pubtype: Periodical doctype: Article src: R language: English refInfo: copyright: @attributes: flag: Y dt: @attributes: year: 2012 holdings: @attributes: islocal: N |
|---|