13
views
0
recommends
+1 Recommend
0 collections
    0
    shares
      • Record: found
      • Abstract: found
      • Article: found
      Is Open Access

      Generating Code with Polymorphic let: A Ballad of Value Restriction, Copying and Sharing

      Preprint

      Read this article at

      Bookmark
          There is no author summary for this article yet. Authors can add summaries to their articles on ScienceOpen to make them more accessible to a non-specialist audience.

          Abstract

          Getting polymorphism and effects such as mutation to live together in the same language is a tale worth telling, under the recurring refrain of copying vs. sharing. We add new stanzas to the tale, about the ordeal to generate code with polymorphism and effects, and be sure it type-checks. Generating well-typed-by-construction polymorphic let-expressions is impossible in the Hindley-Milner type system: even the author believed that. The polymorphic-let generator turns out to exist. We present its derivation and the application for the lightweight implementation of quotation via a novel and unexpectedly simple source-to-source transformation to code-generating combinators. However, generating let-expressions with polymorphic functions demands more than even the relaxed value restriction can deliver. We need a new deal for let-polymorphism in ML. We conjecture the weaker restriction and implement it in a practically-useful code-generation library. Its formal justification is formulated as the research program.

          Related collections

          Most cited references21

          • Record: found
          • Abstract: not found
          • Article: not found

          The next 700 programming languages

          P. Landin (1966)
            Bookmark
            • Record: found
            • Abstract: not found
            • Article: not found

            “Memo” Functions and Machine Learning

              Bookmark
              • Record: found
              • Abstract: not found
              • Article: not found

              Guarded recursive datatype constructors

                Bookmark

                Author and article information

                Journal
                2017-02-07
                Article
                10.4204/EPTCS.241.1
                1702.02280
                588af3e3-1aaa-4068-92ce-150a7727b712

                http://arxiv.org/licenses/nonexclusive-distrib/1.0/

                History
                Custom metadata
                EPTCS 241, 2017, pp. 1-22
                In Proceedings ML/OCaml 2015, arXiv:1702.01872
                cs.PL cs.LO
                EPTCS

                Programming languages
                Programming languages

                Comments

                Comment on this article