Next Previous Contents

1. Introduction

The wish is to be able to use Haskell as a software component language. That is, be able to both use and create software components conveniently using Haskell. H/Direct is a set of tools and libraries that aims to provide support for this to the Haskell programmer, and, for now, the software component technology that we consider is the Component Object Model (COM).

Ideally, it should be possible to substitute COM for any other component technology. Experience may prove otherwise, but implementing an interface to one component technology is a non-trivial amount of work, so, as a starting point, we're targetting COM.

A prerequisite for interfacing to a software component is some mechanism for communicating what functionality the component offers. H/Direct makes use of an Interface Definition Language(IDL) to specify component interfaces, and provides an IDL compiler that supports both the creation and use of software components.

There's a couple of IDL flavours around. We're implementing one that is compatible with the IDL accepted by the Microsoft IDL compiler (MIDL), a superset of the IDL defined by OSF's DCE spec.
It takes an IDL specification as input, and generates the support code required to interface Haskell code to a component's functionality.

A `side-effect' of providing an IDL compiler is that it also can be used for `conventional' foreign language interface work. For instance, by specifying the function prototypes provided by an external (C) library as IDL type signatures, the IDL compiler will automatically generate code that lets you call the library's functions from Haskell. This is very similar to what Green Card aims to support, but H/Direct goes further in that it also supports the creation of C interfaces to Haskell code.

This document is split into two main parts: the first part introduces how H/Direct offers a helping hand to the programmer that wants to use COM from Haskell or just integrate his/her Haskell code with the outside world. The second part details the design of how the programmer's view presented in the first part is provided.


Next Previous Contents