Juaskell: Implementing Evaluation Strategies in Java

Kevin Hammond and David Walsh-Kemmis. Submitted to CLaPF'99, Recife, Brazil, November 1998.

We report on a novel attempt to incorporate functional language technology in the widely used object-oriented language Java. Juaskell takes the concept of evaluation strategies, which are designed to cleanly separate control from algorithm in a parallel setting, from Glasgow Parallel Haskell and re-implements this technology in Java. While Java does have rudimentary support for concurrent threads, experience has shown that the standard mechanism is difficult to exploit correctly, and error-prone in use. It is thus highly desirable to provide high-level behavioural abstractions over threads such as evaluation strategies.

The implementation of Juaskell involves finding a number of analogies to common functional language concepts and implementation techniques in an object-oriented setting, notably higher-order functions, parametric polymorphism and lazy evaluation. Solutions to some of these problems proved to be more complex than expected, due to deficiencies in the Java language definition. The resulting Juaskell system has been used to implement a multi-threaded version of the Mandelbrot algorithm. For this program, which involves the creation of a large number of threads, performance overhead due to strategic code amounts to 9.6% of the total execution time, an acceptably low figure.

@InProceedings{juaskell,
  author = 	 {Kevin Hammond and David Walsh-Kemmis},
  title = 	 {Juaskell: Implementing Evaluation Strategies in {J}ava},
  booktitle = 	 {Submitted to the 3rd Latin-American Conference on Functional Programming},
  year = 	 1998,
  month = 	 nov
}

Available in: ps, ps.gz


GPH Papers | GPH