skip to main content
10.1145/2636228.2636231acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Defunctionalizing push arrays

Published:03 September 2014Publication History

ABSTRACT

Recent work on embedded domain specific languages (EDSLs) for high performance array programming has given rise to a number of array representations. In Feldspar and Obsidian there are two different kinds of arrays, called Pull and Push arrays. Both Pull and Push arrays are deferred; they are methods of computing arrays, rather than elements stored in memory. The reason for having multiple array types is to obtain code that performs better. Pull and Push arrays provide this by guaranteeing that operations fuse automatically. It is also the case that some operations are easily implemented and perform well on Pull arrays, while for some operations, Push arrays provide better implementations. But do we really need to have more than one array representation? In this paper we derive a new array representation from Push arrays that have all the good qualities of Pull and Push arrays combined. This new array representation is obtained via defunctionalization of a Push array API.

References

  1. M. S. Ager, D. Biernacki, O. Danvy, and J. Midtgaard. A functional correspondence between evaluators and abstract machines. In Proceedings of the 5th ACM SIGPLAN international conference on Principles and practice of declaritive programming, pages 8--19. ACM, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. S. Ager, D. Biernacki, O. Danvy, and J. Midtgaard. From interpreter to compiler and virtual machine: a functional derivation. BRICS, Department of Computer Science, University of Aarhus, 2003.Google ScholarGoogle Scholar
  3. M. S. Ager, O. Danvy, and J. Midtgaard. A functional correspondence between call-by-need evaluators and lazy abstract machines. Information Processing Letters, 90(5):223--232, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. S. Ager, O. Danvy, and J. Midtgaard. A functional correspondence between monadic evaluators and abstract machines for languages with computational effects. BRICS, Department of Computer Science, Univ., 2004.Google ScholarGoogle Scholar
  5. J. Ankner and J. D. Svenningsson. An EDSL Approach to High Performance Haskell Programming. In Proceedings of the 2013 ACM SIGPLAN Symposium on Haskell, Haskell '13, pages 1--12, New York, NY, USA, 2013. ACM. ISBN 978-1-4503-2383-3. . URL http://doi.acm.org/10.1145/2503778.2503789. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. Axelsson, K. Claessen, M. Sheeran, J. Svenningsson, D. Engdal, and A. Persson. The Design and Implementation of Feldspar an Embedded Language for Digital Signal Processing. In Proceedings of the 22nd international conference on Implementation and application of functional languages, IFL'10, pages 121--136, Berlin, Heidelberg, 2011. Springer Verlag. ISBN 978--3--642--24275--5. URL http://dl. acm.org/citation.cfm?id=2050135.2050143. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. M. Bell, F. Bellegarde, and J. Hook. Type-driven defunctionalization. In Proceedings of the Second ACM SIGPLAN International Conference on Functional Programming, ICFP '97, pages 25--37, New York, NY, USA, 1997. ACM. ISBN 0-89791-918-1. . URL http://doi.acm.org/10.1145/258948.258953. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. Biernacka and O. Danvy. A syntactic correspondence between context-sensitive calculi and abstract machines. Theoretical Computer Science, 375(1):76--108, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Biernacki and O. Danvy. From interpreter to logic engine by defunctionalization. In M. Bruynooghe, editor, Logic Based Program Synthesis and Transformation, volume 3018 of Lecture Notes in Computer Science, pages 143--159. Springer Berlin Heidelberg, 2004. ISBN 978-3-540-22174-6. . URL http://dx.doi.org/10.1007/ 978-3-540-25938-1_13.Google ScholarGoogle Scholar
  10. K. Claessen, M. Sheeran, and B. J. Svensson. Expressive Array Constructs in an Embedded GPU Kernel Programming Language. In Proceedings of the 7th workshop on Declarative aspects and applications of multicore programming, DAMP '12, pages 21--30, New York, NY, USA, 2012. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. O. Danvy. Defunctionalized interpreters for programming languages. In Proceedings of the 13th ACM SIGPLAN international conference on Functional programming, ICFP '08, pages 131--142, New York, NY, USA, 2008. ACM. ISBN 978-1-59593-919-7. . URL http://doi.acm.org/10.1145/1411204.1411206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. O. Danvy and L. R. Nielsen. Defunctionalization at work. In Proceedings of the 3rd ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP '01, pages 162--174, New York, NY, USA, 2001. ACM. ISBN 1-58113-388-X. . URL http://doi.acm.org/10.1145/773184.773202. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. O. Danvy and L. R. Nielsen. Defunctionalization at work. In Proceedings of the 3rd ACM SIGPLAN international conference on Principles and practice of declarative programming, pages 162--174. ACM, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. O. Danvy, K. Millikin, J. Munk, and I. Zerny. Defunctionalized interpreters for call-by-need evaluation. In Functional and Logic Programming, pages 240--256. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Elliott, S. Finne, and O. de Moor. Compiling embedded languages. Journal of Functional Programming, 13(2), 2003. URL http://conal.net/papers/jfp-saig/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. J.-C. Filliâtre and F. Pottier. Producing all ideals of a forest, functionally. Journal of Functional Programming, 13(5):945--956, Sept. 2003. URL http://gallium.inria.fr/~fpottier/publis/filliatre-pottier.ps.gz. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T. Harper. A library writer's guide to shortcut fusion. In Proceedings of the 4th ACM Symposium on Haskell, Haskell '11, pages 47--58, New York, NY, USA, 2011. ACM. ISBN 978-1-4503-0860-1. . URL http://doi.acm.org/10.1145/2034675.2034682. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. J. M. Hughes. A novel representation of lists and its application to the function reverse. Information processing letters, 22(3):141--144, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. G. Keller, M. M. Chakravarty, R. Leshchinskiy, S. Peyton Jones, and B. Lippmeier. Regular, shape-polymorphic, parallel arrays in haskell. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming, ICFP '10, pages 261--272, New York, NY, USA, 2010. ACM. ISBN 978-1-60558-794-3. . URL http://doi.acm.org/10.1145/1863543.1863582. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Kulkarni and R. R. Newton. Embrace, Defend, Extend: A Methodology for Embedding Preexisting DSLs, 2013. Functional Programming Concepts in Domain-Specific Languages (FPCDSL'13). Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. B. Lippmeier and G. Keller. Efficient Parallel Stencil Convolution in Haskell. In Proceedings of the 4th ACM Symposium on Haskell, Haskell '11, pages 59--70, New York, NY, USA, 2011. ACM. ISBN 978-1-4503-0860-1. . URL http://doi.acm.org/10.1145/2034675.2034684. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. F. Pottier and N. Gauthier. Polymorphic typed defunctionalization. In Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL '04, pages 89--98, New York, NY, USA, 2004. ACM. . URL http://doi.acm.org/10.1145/964001.964009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. J. C. Reynolds. Definitional interpreters for higher-order programming languages. In Proceedings of the ACM annual conference - Volume 2, ACM '72, pages 717--740, New York, NY, USA, 1972. ACM. . URLhttp://doi.acm.org/10.1145/800194.805852. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Svenningsson and E. Axelsson. Combining Deep and Shallow Embedding for EDSL. In H.-W. Loidl and R. Pea, editors, Trends in Functional Programming, volume 7829 of Lecture Notes in Computer Science, pages 21--36. Springer Berlin Heidelberg, 2013. . URL http://dx.doi.org/10.1007/978-3-642-40447-4_2.Google ScholarGoogle Scholar

Index Terms

  1. Defunctionalizing push arrays

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

        cover image ACM Conferences
        FHPC '14: Proceedings of the 3rd ACM SIGPLAN workshop on Functional high-performance computing
        September 2014
        116 pages
        ISBN:9781450330404
        DOI:10.1145/2636228

        Copyright © 2014 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 3 September 2014

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        FHPC '14 Paper Acceptance Rate10of11submissions,91%Overall Acceptance Rate18of25submissions,72%

        Upcoming Conference

        ICFP '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader