Stateful computations in functional languages

Yung-Syau Chen · University of Southern California Digital Library · 2015

We present a new approach in which stateful computations can be performed within the framework of a functional programming language supporting parallel multithreaded execution. Efficient use of parallel machine is only feasible when applications can be expressed without loss of their inherent parallelism. To extract maximum parallelism from many applications, programmers need stateful computations. A great deal of work has been carried out on functional languages that guarantee the output of a program to be a function of its input. However, in most functional programming languages, programmers are unable to easily manipulate state-based computations since they are not supported by functional languages. To solve this problem, we propose to extend the Sisal language with special user-declared variables. Sisal is a functional language which has been designed by a consortium of industrial and research organizations for the specification and execution of parallel programs. Our approach can greatly help users in writing programs, simplifying parallel compilation, and improving performance. Under this scheme, (1) programmers will be able to manipulate stateful computations, (2) the expressions which can be evaluated in parallel will be easily identified, and (3) higher degree of parallelism can be delivered. In our methodology, programmers are allowed to declare special variables, and the expressions which must be executed in sequence can be identified according to the usage of special variables. In comparison to purely functional languages, extended-Sisal has more expressive power due to the availability of stateful computations. We demonstrate that this approach can greatly improve the performance of a parallel processing system.

Read the paper · More papers on PaperTik