HPorter: Using Arrows to Compose Parallel Processes


Liwen Huang, Paul Hudak, and John Peterson


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.


  ,author="L. Huang and P. Hudak and J. Peterson"
  ,title="HPorter: Using Arrows to Compose Parallel Processes"
  ,booktitle="Proc. Practical Aspects of Declarative Languages"
  ,publisher="Springer Verlag LNCS 4354"