{"title":"爱丽丝还是鲍勃?编排图中的进程多态性","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":"{\"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}","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
摘要
我们介绍 PolyChor $\lambda$ ,这是一种用于高阶函数式编排编程的语言--一种新兴的并发编程范式。在编排式编程中,程序员编写进程系统所需的合作行为,然后将其编译成每个进程的实现,这种转换称为端点投影。与它的前身 Chor $\lambda$ 不同,PolyChor $\lambda$ 在 System F $_\omega$ 的启发下具有类型和进程多态性。也就是说,PolyChor $\lambda$ 是第一种(高阶)功能编排语言,它使程序员能够编写通用编排,并在运行时确定参与者。这种新颖的功能组合还允许 PolyChor $\lambda$ 进程交流分布式值,从而为编写委托提供了一种新的直观方式。虽然与其他一些编排语言相比,PolyChor $\lambda$ 的一些功能特性使其在编排语义与端点投射并发系统之间的对应关系较弱,但我们仍然得到了编排编程的标志性最终结果:投射程序在设计上是无死锁的。
Alice or Bob?: Process polymorphism in choreographies
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.