Functional Programming for Concurrent and Distributed Computing

Functional Programming for Concurrent and Distributed Computing
复制标题

并发和分布式计算的函数式编程

DOI:
10.1093/comjnl/30.5.437
复制
发表时间:
1987
期刊:
Comput. J.
影响因子:
--
通讯作者:
F. Burton
F. Burton
中科院分区:
--
文献类型:
--
作者:
F. Burton

文献摘要

被引文献

相似文献

至少有两种设计并行计算语言的方法。一种方法是使用易于阅读、编写、转换和验证的函数式或关系型语言。更传统的方法是使用过程性语言,它使程序员能够高度控制程序的运行时行为。有必要用一种既简单又有效的语言协调这两种方法。我们建议使用一组小而简单的注释(或pragmas)来控制函数式程序的运行时行为。注释允许程序员使用三种形式的参数传递。参数传递机制对应于顺序语言中按名称、值和需求传递。此外,在分布式系统中,程序员可以指定工作应该在当前处理器、任意处理器或特定处理器(如包含特定数据项的处理器)上完成。注释不会影响函数式程序的意义(结果),除非在某些情况下导致不终止(我们认为这是效率低下的一种极端形式)。这种意义与控制的分离使得程序既简单又高效。由于在并发系统中,不确定性似乎是不可避免的,而且不会造成显著的效率损失,因此简要地考虑了所建议的注释与不确定性的相互作用。带注释的函数式程序的运行时行为类似于使用消息传递、信号量或集合来控制通信和同步的过程式程序。
There are at least two approaches to the design of languages for parallel computing. One approach is to use functional or relational languages which are easy to read, write, transform and verify. The more conventional approach is to use procedural languages which give a programmer a high degree of control over the run-time behaviour of a program. There is a need to reconcile these two approaches in a language which permits both simplicity and efficiency. We propose a small and simple set of annotations {or pragmas) to control the run-time behaviour of a functional program. The annotations allow a programmer to use three forms of parameter passing. The parameter-passing mechanisms correspond to passing by name, value and need in a sequential language. In addition, in a distributed system a programmer can specify that work should be done on the current processor, an arbitrary processor, or a particular processor such as the one containing a specific data item. The annotations cannot affect the meaning (result) of a functional program, except for causing non-termination in some cases (which we view as an extreme form of inefficiency). This separation of meaning from control allows a program to be both simple and efficient. Since non-determinism appears to be unavoidable without significant loss of efficiency in a concurrent system, the interaction of the proposed annotations with non-determinism is briefly considered. The run-time behaviour of an annotated functional program is similar to that of procedural programs using message passing, semaphores or rendezvous to control communication and synchronisation.