{"title":"Alice or Bob?: Process polymorphism in choreographies","authors":"EVA GRAVERSEN, ANDREW K. HIRSCH, FABRIZIO MONTESI","doi":"10.1017/s0956796823000114","DOIUrl":null,"url":null,"abstract":"We present PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline1.png\" /> <jats:tex-math> $\\lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula>, a language for higher-order functional <jats:italic>choreographic programming</jats:italic>—an emerging paradigm for concurrent programming. In choreographic programming, programmers write the desired cooperative behaviour of a system of processes and then compile it into an implementation for each process, a translation called <jats:italic>endpoint projection</jats:italic>. Unlike its predecessor, Chor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline2.png\" /> <jats:tex-math> $\\lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula>, PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline3.png\" /> <jats:tex-math> $\\lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> has both type and <jats:italic>process</jats:italic> polymorphism inspired by System F<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline4.png\" /> <jats:tex-math> $_\\omega$ </jats:tex-math> </jats:alternatives> </jats:inline-formula>. That is, PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline5.png\" /> <jats:tex-math> $\\lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> is the first (higher-order) functional choreographic language which gives programmers the ability to write generic choreographies and determine the participants at runtime. This novel combination of features also allows PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline6.png\" /> <jats:tex-math> $\\lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> processes to communicate <jats:italic>distributed values</jats:italic>, leading to a new and intuitive way to write delegation. While some of the functional features of PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline7.png\" /> <jats:tex-math> $\\lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> give it a weaker correspondence between the semantics of choreographies and their endpoint-projected concurrent systems than some other choreographic languages, we still get the hallmark end result of choreographic programming: projected programmes are deadlock-free by design.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":"9 1","pages":""},"PeriodicalIF":1.1000,"publicationDate":"2024-01-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Functional Programming","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1017/s0956796823000114","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0
Abstract
We present PolyChor $\lambda$ , a language for higher-order functional choreographic programming—an emerging paradigm for concurrent programming. In choreographic programming, programmers write the desired cooperative behaviour of a system of processes and then compile it into an implementation for each process, a translation called endpoint projection. Unlike its predecessor, Chor $\lambda$ , PolyChor $\lambda$ has both type and process polymorphism inspired by System F $_\omega$ . That is, PolyChor $\lambda$ is the first (higher-order) functional choreographic language which gives programmers the ability to write generic choreographies and determine the participants at runtime. This novel combination of features also allows PolyChor $\lambda$ processes to communicate distributed values, leading to a new and intuitive way to write delegation. While some of the functional features of PolyChor $\lambda$ give it a weaker correspondence between the semantics of choreographies and their endpoint-projected concurrent systems than some other choreographic languages, we still get the hallmark end result of choreographic programming: projected programmes are deadlock-free by design.
期刊介绍:
Journal of Functional Programming is the only journal devoted solely to the design, implementation, and application of functional programming languages, spanning the range from mathematical theory to industrial practice. Topics covered include functional languages and extensions, implementation techniques, reasoning and proof, program transformation and synthesis, type systems, type theory, language-based security, memory management, parallelism and applications. The journal is of interest to computer scientists, software engineers, programming language researchers and mathematicians interested in the logical foundations of programming.