Pith. sign in

Elaborating Evaluation-Order Polymorphism

1 Pith paper cite this work. Polarity classification is still indexing.

1 Pith paper citing it
abstract

We classify programming languages according to evaluation order: each language fixes one evaluation order as the default, making it transparent to program in that evaluation order, and troublesome to program in the other. This paper develops a type system that is impartial with respect to evaluation order. Evaluation order is implicit in terms, and explicit in types, with by-value and by-name versions of type connectives. A form of intersection type quantifies over evaluation orders, describing code that is agnostic over (that is, polymorphic in) evaluation order. By allowing such generic code, programs can express the by-value and by-name versions of a computation without code duplication. We also formulate a type system that only has by-value connectives, plus a type that generalizes the difference between by-value and by-name connectives: it is either a suspension (by name) or a "no-op" (by value). We show a straightforward encoding of the impartial type system into the more economical one. Then we define an elaboration from the economical language to a call-by-value semantics, and prove that elaborating a well-typed source program, where evaluation order is implicit, produces a well-typed target program where evaluation order is explicit. We also prove a simulation between evaluation of the target program and reductions (either by-value or by-name) in the source program. Finally, we prove that typing, elaboration, and evaluation are faithful to the type annotations given in the source program: if the programmer only writes by-value types, no by-name reductions can occur at run time.

fields

cs.PL 1

years

2019 1

verdicts

CONDITIONAL 1

representative citing papers

Bidirectional Typing

cs.PL · 2019-08-16 · conditional · novelty 4.0

A survey and tutorial that distills the design principles behind bidirectional typing, presents a recipe for designing such systems, and argues that bidirectionality is about information flow rather than polarized logic.

citing papers explorer

Showing 1 of 1 citing paper.

  • Bidirectional Typing cs.PL · 2019-08-16 · conditional · none · ref 2015 · internal anchor

    A survey and tutorial that distills the design principles behind bidirectional typing, presents a recipe for designing such systems, and argues that bidirectionality is about information flow rather than polarized logic.