HaskellScript previous home next  
lambda HaskellDirect
HaskellScript
  Documentation
  Download
  Questions
  History
  Acknowledgements

HaskellAgent
HaskellDirect
HaskellObject
  Example
  Documentation
ScriptServer
  Interface

HaskellDirect is an IDL compiler for Haskell written by Sigbjorn Finne. HaskellDirect has been used to generate all the interface code needed to access COM components in the HaskellScript libraries. There is a separate website describing HaskellDirect.

Interfacing Haskell code to external code involves the conversion of values between the Haskell world and the outside, as data representations and details of how memory is managed, are worlds apart at times. Manually writing the boilerplate code that takes care of this conversion is about as exciting as watching grass grow and, as a result, error prone.

Using an Interface Definition Language (IDL) as basis, HaskellDirect automates the generation of such impedance matching code, generating the necessary marshaling code to interface to external functions (and vice versa.)

With IDL, the functionality provided by a programming interface is specified in a programming language neutral framework. The HaskellDirect IDL compiler converts this specification into a set of method stubs. Depending on how the compiler is invoked, these stubs can be used to:

  • Call upon external functions from within Haskell, using HaskellDirect to create bindings to external (C) libraries.
  • Let external code call upon Haskell functions, using HaskellDirect to create external language interfaces to Haskell libraries. [This mode of operation is currently unsupported]
  • Call COM (Microsoft's Component Object Model) methods from Haskell, using HaskellDirect to help writing COM clients in Haskell. The generated stubs can either be used with HaskellScript or Hugs/GHC.
  • Create COM method wrappers, using HaskellDirect to package up Haskell code as COM objects. [This mode of operation is not yet supported]
 
previous home next