10.1145/3162072acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedings
research-article

Program generation for ML modules (short paper)

ABSTRACT

Program generation has been successful in various domains which need high performance and high productivity. Yet, programming-language supports for program generation need further improvement. An important omission is the functionality of generating modules in a type safe way. Inoue et al. have addressed this issue in 2016, but investigated only a few examples. We propose a language as an extension of (a small subset of) MetaOCaml in which one can manipulate and generate code of a module, and implement it based on a simple translation to MetaOCaml. We show that our language solves the performance problem in functor applications pointed out by Inoue et al., and that it provides a suitable basis for writing code generators for modules.

References

  1. Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. 2009. Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. J. Funct. Program. 19, 5 (2009), 509–543. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Rowan Davies. 1996. A Temporal-Logic Approach to Binding-Time Analysis. In Proceedings, 11th Annual IEEE Symposium on Logic in Computer Science, New Brunswick, New Jersey, USA, July 27-30, 1996. 184–195. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Robert Harper and Mark Lillibridge. 1994. A Type-Theoretic Approach to Higher-Order Modules with Sharing. In Conference Record of POPL’94: 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Portland, Oregon, USA, January 17-21, 1994. 123–137. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Jun Inoue, Oleg Kiselyov, and Yukiyoshi Kameyama. 2016. Staging Beyond Terms: Prospects and Challenges. In Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM ’16). ACM, New York, NY, USA, 103–108. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Oleg Kiselyov. 2014. The Design and Implementation of BER MetaO-Caml - System Description. In Functional and Logic Programming -12th International Symposium, FLOPS 2014, Kanazawa, Japan, June 4-6, 2014. Proceedings (Lecture Notes in Computer Science), Michael Codish and Eijiro Sumii (Eds.), Vol. 8475. Springer, 86–102.Google ScholarGoogle Scholar
  6. Oleg Kiselyov, Aggelos Biboudis, Nick Palladinos, and Yannis Smaragdakis. 2017. Stream fusion, to completeness. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, Giuseppe Castagna and Andrew D. Gordon (Eds.). ACM, 285–299. http://dl.acm.org/citation. cfm?id=3009880 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Yannis Klonatos, Christoph Koch, Tiark Rompf, and Hassan Chafi. 2014. Building Efficient Query Engines in a High-Level Language. PVLDB 7, 10 (2014), 853–864. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Xavier Leroy. 2000. A Modular Module System. J. Funct. Program. 10, 3 (May 2000), 269–303. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Junpei Oishi and Yukiyoshi Kameyama. 2017. Staging with control: type-safe multi-stage programming with control operators. In Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, GPCE 2017, Vancouver, BC, Canada, October 23-24, 2017. 29–40. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Tiark Rompf. 2016. Lightweight modular staging (LMS): generate all the things! (keynote). In Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, GPCE 2016, Amsterdam, The Netherlands, October 31 -November 1, 2016, Bernd Fischer and Ina Schaefer (Eds.). ACM, 1. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Kenichi Suzuki, Oleg Kiselyov, and Yukiyoshi Kameyama. 2016. Finally, Safely-extensible and Efficient Language-integrated Query. In Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM ’16). ACM, New York, NY, USA, 37–48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Walid Taha. 2003. A Gentle Introduction to Multi-stage Programming. In Domain-Specific Program Generation, International Seminar, Dagstuhl Castle, Germany, March 23-28, 2003, Revised Papers. 30–50.Google ScholarGoogle Scholar
  13. Walid Taha and Michael Florentin Nielsen. 2003. Environment Classifiers. In Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’03). ACM, New York, NY, USA, 26–37. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Leo White, Frédéric Bour, and Jeremy Yallop. 2014. Modular implicits. In Proceedings ML Family/OCaml Users and Developers workshops, ML/OCaml 2014, Gothenburg, Sweden, September 4-5, 2014. 22–63.Google ScholarGoogle Scholar
  15. Jeremy Yallop. 2017. Staged generic programming. PACMPL 1, ICFP (2017), 29:1–29:29. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Program generation for ML modules (short paper)

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!