HPorter: using arrows to compose parallel processes

  • Authors:
  • Liwen Huang;Paul Hudak;John Peterson

  • Affiliations:
  • Dept. of Computer Science, Yale University;Dept. of Computer Science, Yale University;Western State College, Computer Information Science

  • Venue:
  • PADL'07 Proceedings of the 9th international conference on Practical Aspects of Declarative Languages
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

HPorter is a DSL embedded in Haskell for composing processes running on a parallel computer. Using arrows (a generalization of monads), one can “wire together” processes in a manner analogous to a signal-processing application. The processes themselves are typically existing C or C++ programs, but may also be programs written in a first-order sub-language in Haskell that supports basic arithmetic, trigonometric functions, and other related operations. In both cases, once the processes are wired together, the supporting Haskell implementation is out of the loop – imported C programs run unimpeded, the Haskell sub-language is compiled into C code, and all data paths run directly between C processes. But in addition, HPorter's event-driven reactivity permits reconfiguration of these tightly-coupled processes at any time, thus providing a degree of dynamism that is critical in many applications. The advantages of our approach over conventional scripting languages include a higher degree of type safety, a declarative style, dynamic reconfiguration of processes, having the full power of Haskell, and portability across operating systems. We have implemented HPorter both on the QNX operating system and using conventional TCP/IP sockets, and are using it in a practical application in Yale's Humanoid Robotics Laboratory, where the processes correspond to soft-real-time tasks such as computer vision, motor control, planning, and limb kinematics.