English

Call-By-Name Is Just Call-By-Value with Delimited Control

Programming Languages 2023-06-22 v4

Abstract

Delimited control operator shift0 exhibits versatile capabilities: it can express layered monadic effects, or equivalently, algebraic effects. Little did we know it can express lambda calculus too! We present \Lambda_\ ,acallbyvaluelambdacalculusextendedwithshift0andcontroldelimiter, a call-by-value lambda calculus extended with shift0 and control delimiter $ withcarefullycraftedreductiontheory,suchthatthelambdacalculuswithbetaandetareductionscanbeisomorphicallyembeddedinto with carefully crafted reduction theory, such that the lambda calculus with beta and eta reductions can be isomorphically embedded into \Lambda_$ viaarightinverseofacontinuationpassingstyletranslation.Whilecallbynamereductionsoflambdacalculuscantriviallysimulateitscallbyvalueversion,weshowthatadditionofshift0and via a right inverse of a continuation-passing style translation. While call-by-name reductions of lambda calculus can trivially simulate its call-by-value version, we show that addition of shift0 and $ isthegoldenmeanofexpressivepowerthatsufficestosimulatebetaandetareductionswhilestilladmittingasimulationback.Asacorollary,calculi is the golden mean of expressive power that suffices to simulate beta and eta reductions while still admitting a simulation back. As a corollary, calculi \Lambda\mu_v ,, \lambda_$ ,, \Lambda_$ and and \lambda $ all correspond equationally.

Keywords

Cite

@article{arxiv.2212.08594,
  title  = {Call-By-Name Is Just Call-By-Value with Delimited Control},
  author = {Mateusz Pyzik},
  journal= {arXiv preprint arXiv:2212.08594},
  year   = {2023}
}