Compiling a New Kind of Faster Curry
Loading...
Date
2022-02-18
Authors
Hairapetian, Shant
Journal Title
Journal ISSN
Volume Title
Publisher
University of Oregon
Abstract
Traditionally, programming languages based on lambda calculus such asHaskell and ML do not support functions with a number of arguments (or arity)
greater than one. In these languages, currying emulates the passing of multiple
arguments by accepting one argument at a time and returning a closure that
accepts the next. This approach is inefficient from a performance perspective.
As such, Downen et al [A faster Curry with Extensional Types] proposed the
addition of a primitive, extensional function type that accepts all of its
arguments at once. Though this new function type enabled optimization for
functions across known types, generic types could not enjoy this optimization.
In their follow-up paper [Kinds are Calling Conventions] Downen et al
proposed a new kind of system which allows for statically tracking arity
information about generic types, thereby enabling faster currying and efficient
compilation for these generic types. This paper will discuss the implementation
of both of these changes in GHC (Glasgow Haskell Compiler).