Skip to main content

A Haskell Implementation of a Rule-Based Program Transformation for C Programs

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2015)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9131))

Included in the following conference series:

Abstract

Obtaining good performance when programming heterogeneous computing platforms poses significant challenges for the programmer. We present a program transformation environment, implemented in Haskell, where architecture-agnostic scientific C code is transformed into a functionally equivalent one better suited for a given platform. The transformation rules are formalized in a domain-specific language (STML) that takes care of the syntactic and semantic conditions required to apply a given transformation. STML rules are compiled into Haskell function definitions that operate at AST level. Program properties, to be matched with rule conditions, can be automatically inferred or, alternatively, stated as annotations in the source code. Early experimental results are described.

Work partially funded by EU FP7-ICT-2013.3.4 project 610686 POLCA, Comunidad de Madrid project S2013/ICE-2731 N-Greens Software and MINECO Projects TIN2012-39391-C04-03 and TIN2012-39391-C04-04 (StrongSoft) and TIN2013-44742-C4-1-R (CAVI-ROSE).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Bagge, O.S., Kalleberg, K.T., Visser, E., Haveraaen, M.: Design of the codeboost transformation system for domain-specific optimisation of C++ programs. In: 3rd. Intl. Workshop on Source Code Analysis and Manipulation (SCAM2003), pp. 65–75. IEEE (2003)

    Google Scholar 

  2. Boekhold, M., Karkowski, I., Corporaal, H.: High-performance computing and networking. In: Sloot, P.M.A., Hoekstra, A.G., Bubak, M., Hertzberger, B. (eds.) HPCN-Europe 1999. LNCS, vol. 1593, pp. 673–682. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  3. Brown, A., Luk, W., Kelly, P.: Optimising Transformations for Hardware Compilation. Tech. rep, Imperial College London (2005)

    Google Scholar 

  4. Danalis, A., Marin, G., McCurdy, C., Meredith, J.S., Roth, P.C., Spafford, K., Tipparaju, V., Vetter, J.S.: The scalable heterogeneous computing (SHOC) benchmark suite. In: Proc. of the 3rd Workshop on General-Purpose Computation on GPUs, pp. 63–74. ACM (2010)

    Google Scholar 

  5. Huber, B.: The language-c Package (2014). https://hackage.haskell.org/package/language-c

  6. Lammel, R., Jones, S.P., Magalhaes, J.P.: The syb Package (2009). https://hackage.haskell.org/package/syb

  7. Lindtjorn, O., Clapp, R.G., Pell, O., Fu, H., Flynn, M.J., Mencer, O.: Beyond Traditional Microprocessors for Geoscience High-Performance Computing Applications. IEEE Micro 31(2), 41–49 (2011)

    Article  Google Scholar 

  8. Schupp, S., Gregor, D., Musser, D., Liu, S.M.: Semantic and Behavioral Library Transformations. Information and Software Technology 44(13), 797–810 (2002)

    Article  Google Scholar 

  9. The POLCA Consortium: Specific Use Case Requirements. POLCA Project (#610686) Deliverable D-5.1, February 2014

    Google Scholar 

  10. Visser, E.: Program transformation with Stratego/XT. In: Lengauer, C., Batory, D., Blum, A., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Salvador Tamarit .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Tamarit, S., Vigueras, G., Carro, M., Mariño, J. (2015). A Haskell Implementation of a Rule-Based Program Transformation for C Programs. In: Pontelli, E., Son, T. (eds) Practical Aspects of Declarative Languages. PADL 2015. Lecture Notes in Computer Science(), vol 9131. Springer, Cham. https://doi.org/10.1007/978-3-319-19686-2_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-19686-2_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-19685-5

  • Online ISBN: 978-3-319-19686-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics