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

Safety at speed: in-place array algorithms from pure functional programs by safely re-using storage

Published:18 August 2019Publication History

ABSTRACT

We present a purely functional array programming language that offers safe, purely functional and crash-free in-place array transformations. The language supports high-level abstractions for pure and efficient array computations that fully support equational reasoning. We show how to execute selected parts of these computations safely in-place, with the compiler guaranteeing that in-place execution does not change the computation’s result. Correctness is ensured by using an off-the-shelf-theorem prover to discharge safety conditions. Our main contribution is the idea of virtual copies for expressing re-use of arrays, and techniques for verifying their safety, which allow a pure language to include in-place transformations without weakening its transparency or reasoning power.

References

  1. Heinrich Apfelmus. 2010. The Operational monad tutorial. The Monad. Reader 15 (2010), 37-55.Google ScholarGoogle Scholar
  2. Markus Aronsson and Mary Sheeran. 2017. Hardware software codesign in Haskell. In Haskell Symposium, Vol. 52. ACM, 162-173. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Emil Axelsson. 2016. Benchmarking FFT in Feldspar. http://fun-discoveries.blogspot.com/2016/11/benchmarking-fft-in-feldspar.htmlGoogle ScholarGoogle Scholar
  4. Emil Axelsson. 2016. Compilation as a Typed EDSL-to-EDSL Transformation. http://fun-discoveries.blogspot.se/2016/03/.Google ScholarGoogle Scholar
  5. Emil Axelsson. 2019. A version of Operational suitable for extensible EDSLs. http://hackage.haskell.org/package/operational-alacarte.Google ScholarGoogle Scholar
  6. Emil Axelsson, Koen Claessen, Mary Sheeran, Josef Svenningsson, David Engdal, and Anders Persson. 2010. The design and implementation of Feldspar. In Symposium on Implementation and Application of Functional Languages. Springer, 121-136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Emil Axelsson and Mary Sheeran. 2011. Feldspar: Application and implementation. In Central European Functional Programming School. Springer, 402-439. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. John Gilbert Presslie Barnes. 2003. High integrity software: the Spark approach to safety and security. Pearson Education. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jean-Philippe Bernardy, Mathieu Boespflug, Ryan R Newton, Simon Peyton Jones, and Arnaud Spiwack. 2017. Linear Haskell: Practical linearity in a higher-order polymorphic language. Proceedings of the ACM on Programming Languages 2, POPL (2017), 5. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Gavin M Bierman, Andrew D Gordon, Catalin Hritcu, and David Langworthy. 2010. Semantic subtyping with an SMT solver. Journal of Functional Programming 45, 9, 105-116. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. James W Cooley and John W Tukey. 1965. An algorithm for the machine calculation of complex Fourier series. Mathematics of computation 19, 90 (1965), 297-301.Google ScholarGoogle Scholar
  12. Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An efficient SMT solver. In International conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, 337-340. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Pierre Duhamel and Martin Vetterli. 1990. Fast Fourier transforms: a tutorial review and a state of the art. Signal processing 19, 4 (1990), 259-299. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Trevor Elliott, Lee Pike, Simon Winwood, Pat Hickey, James Bielman, Jamey Sharp, Eric Seidel, and John Launchbury. 2015. Guilt free ivory. In ACM SIGPLAN Notices, Vol. 50. ACM, 189-200. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Cormac Flanagan and Shaz Qadeer. 2002. Predicate abstraction for software verification, Vol. 37. ACM, POPL '02 Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, 191-202. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Matteo Frigo and Steven G Johnson. 2005. The design and implementation of FFTW3. Proc. IEEE 93, 2 (2005), 216-231.Google ScholarGoogle ScholarCross RefCross Ref
  17. Troels Henriksen, Niels GW Serup, Martin Elsman, Fritz Henglein, and Cosmin E Oancea. 2017. Futhark: purely functional GPU-programming with nested parallelism and in-place array updates. ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017) 52, 6 (2017), 556-571. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Trevor Jim, J Gregory Morrisett, Dan Grossman, Michael W Hicks, James Cheney, and Yanling Wang. 2002. Cyclone: A Safe Dialect of C. In USENIX Annual Technical Conference, General Track. 275-288. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Nicholas D Matsakis and Felix S Klock II. 2014. The rust language. In ACM SIGAda Ada Letters, Vol. 34. ACM, 103-104. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Patrick M Rondon, Ming Kawaguci, and Ranjit Jhala. 2008. Liquid types. In ACM SIGPLAN Notices, Vol. 43. ACM, 159-169. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Nikhil Swamy, Juan Chen, Cédric Fournet, Pierre-Yves Strub, Karthikeyan Bhargavan, and Jean Yang. 2011. Secure distributed programming with value-dependent types. In ACM SIGPLAN Notices, Vol. 46. ACM, 266-278. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Wouter Swierstra. 2008. Data types à la carte. Journal of Functional Programming 18, 4 (2008), 423-436. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Philip Wadler. 1990. Linear types can change the world. In IFIP TC, Vol. 2. 347-359.Google ScholarGoogle Scholar

Index Terms

  1. Safety at speed: in-place array algorithms from pure functional programs by safely re-using storage

      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
        FHPNC 2019: Proceedings of the 8th ACM SIGPLAN International Workshop on Functional High-Performance and Numerical Computing
        August 2019
        59 pages
        ISBN:9781450368148
        DOI:10.1145/3331553

        Copyright © 2019 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: 18 August 2019

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate18of25submissions,72%

        Upcoming Conference

        ICFP '24
      • Article Metrics

        • Downloads (Last 12 months)2
        • Downloads (Last 6 weeks)0

        Other Metrics

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader