Choreographic programming is a programming paradigm, whereby the overall behaviour of a distributed system is coded as a choreography from a global viewpoint. The choreography can then be automatically compiled (projected) to a correct implementation for each participant. Choreographic programming relieves the programmer from manually writing the separate send and receive actions performed by participants and avoids the problem of communication mismatches. However, the applicability of this paradigm in the real world remains largely unexplored for two reasons. First, while there have been several proposals of choreographic programming languages, none of them have been used to implement a realistic, widely-used protocol. Thus there is a lack of experience on how realistic choreographic programs are structured and on the relevance of the features explored in theoretical models. Second, applications of choreographic programming shown so far are intrusive since each participant must use exactly the code projected from the choreography. This prevents using the projected code with existing third-party implementations of some participants. We carry out the first development in choreographic programming of a widespread real-world protocol: the Internet Relay Chat (IRC) protocol. Our development is based on Choral, an object-oriented choreographic programming language. Two of Choral's features are key to our implementation: higher-order choreographies for modelling the complex interaction patterns due to IRC's asynchronous nature; and user-definable communication semantics for achieving interoperability with third-party implementations. We also discover a missing piece: the capability of statically detecting that choices on alternative distributed behaviours are appropriately communicated by means of message types. We extend the Choral compiler with an elegant solution based on subtyping.
翻译:舞蹈编程是一种编程模式,根据这种模式,一个分布式系统的整体行为从全球角度作为一个舞蹈编程,对一个分布式系统的整体行为进行编解,然后可以自动编译(预测)舞蹈编程,使每个参与者能够正确执行。舞蹈编程使编程者不必手工编写单独的发送和接收参与者执行的行动,避免了沟通不匹配的问题。然而,在现实世界中,这一范式的适用性在很大程度上仍未得到探讨,原因有二。第一,虽然有好评式编程语言的一些提议,但没有一个用于执行现实化和广泛使用的协议。因此,对于如何构建符合现实的舞蹈编程程序以及理论模型中所探讨的特征的相关性,缺乏经验。第二,迄今为止所显示的舞蹈编程的应用具有侵扰性,因为每个参与者必须完全使用从编程中预测的代码。这妨碍了在目前一些参与者的第三方执行中使用预测的代码。我们在编程式编程中首次开发了一个广泛的现实-世界协议的替代编程:互联网重新编程(IRC)自然编程(REchacha ),我们用高层次编程的编程程序发展了一种新的编程方式,我们的编程,我们用新的编程方式是用直路路路段式程序。</s>