论文标题
合唱:面向对象的编舞编程
Choral: Object-Oriented Choreographic Programming
论文作者
论文摘要
我们提出合唱,这是基于主流抽象的第一个编舞编程语言。合唱中的关键思想是数据类型的新概念,它允许表达数据在不同角色上分布。我们使用这个想法来通过面向对象的抽象来重建编舞编程的范例。编排是类,编舞的实例是具有角色协同实施的状态和行为的对象。 合唱带有编译器,鉴于编排,它为其每个角色生成了实施。这些实现是纯Java中的库,其类型在合唱程序员的控制之下。然后,开发人员可以在自己的程序中模块化撰写这些库,以便正确参与编舞。合唱是提供这种模块化的编舞编程的第一个化身,该模块化最终将有关范式的十多年研究与实用软件开发联系起来。 编舞和面向对象的编程的集成产生了其他强大的优势,其中一个范式的特征以超越零件总和的方式使另一个范式受益。编舞世界的高级抽象和静态检查可用于更简洁,正确地编写并发和分布式面向对象的软件。与以前的工作相比,我们从面向对象的抽象中获得了更具表现力的编排语言。例如,对象传递使合唱成为第一个高阶编排编程语言,从而可以通过其他编舞将编排进行参数,而无需任何中央协调。连同亚型和仿制药,这使得合唱可以优雅地支持用户定义的通信机制和中间件。
We present Choral, the first choreographic programming language based on mainstream abstractions. The key idea in Choral is a new notion of data type, which allows for expressing that data is distributed over different roles. We use this idea to reconstruct the paradigm of choreographic programming through object-oriented abstractions. Choreographies are classes, and instances of choreographies are objects with states and behaviours implemented collaboratively by roles. Choral comes with a compiler that, given a choreography, generates an implementation for each of its roles. These implementations are libraries in pure Java, whose types are under the control of the Choral programmer. Developers can then modularly compose these libraries in their own programs, in order to participate correctly in choreographies. Choral is the first incarnation of choreographic programming offering such modularity, which finally connects more than a decade of research on the paradigm to practical software development. The integration of choreographic and object-oriented programming yields other powerful advantages, where the features of one paradigm benefit the other in ways that go beyond the sum of the parts. The high-level abstractions and static checks from the world of choreographies can be used to write concurrent and distributed object-oriented software more concisely and correctly. We obtain a much more expressive choreographic language from object-oriented abstractions than in previous work. For example, object passing makes Choral the first higher-order choreographic programming language, whereby choreographies can be parameterised over other choreographies without any need for central coordination. Together with subtyping and generics, this allows Choral to elegantly support user-defined communication mechanisms and middleware.