Hi Sarah,
> 3. What is the best way to interface an existing API to Haskell, given
> that the API has a Win32 DLL style interface? Is it better to reimplement
> the interface as a COM interface, or figure out the necessary IDL code that
> would allow it to link directly?
You can directly interface to either a DLL or a COM component provided that you have
an IDL interface for your API. The tool that you want to use is H/Direct
<http://www.dcs.gla.ac.uk/fp/software/hdirect/>, the person to talk to if you have
questions or problems is Sigbjorn Finne <[EMAIL PROTECTED]>.
> 4. What is the most efficient way to return longish strings from an
> external API to Haskell? Is it better to use a BSTR under COM, or can an
> interface like:
>
> BOOL DifGetNextMessage(DWORD handle, LPSTR buffer, LPDWORD buffsize);
>
> which returns TRUE on success, or FALSE if the buffer is too small (at the
> same time setting buffsize to the correct length).
Using BSTR would be much more convenient and I doubt that the low-level version will
be much more efficient when called from Haskell.
> Assuming we can get this all working, there are quite a few fun things that
> will be possible - the boring stuff is just taking Telergy messages and
> encapsulating them in web pages, but that would just be the first steps.
> Possibilities like scanning news wires in real time using NL understanding
> techniques to get market prediction cues for AI trading, text summarising,
> testing NNs with live market data come to mind immediately - I'm sure there
> is plenty more to be explored, however. It would be extremely interesting in
> particular to see how straightforwardly an English query front-end could be
> adapted to generate Telergy queries. Is anyone from the Durham AI team on
> the list?
You might want to take a look at HaskellDB
<http://www.haskell.org/active/activehaskell.html>, a library for doing database
queries in Haskell and Haskell/CGI which contains amongst others a combinator library
for generating HTML
<http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne/haskell_libs/CGI.html>
(documentation at <www.cs.uu.nl/~erik>). More libraries and Haskell-stuff is available
at http://www.haskell.org. Colin Runciman at York <[EMAIL PROTECTED]> has
done some nice work on "XSL" in Haskell. Another option would be to use the msxml
component from Haskell. It is even quite easy to implement his combinators on top of
this component.
Have you looked at the Microsoft Naturla Language Query stuff. That would work very
well with HaskellDB and our the Haskell binding for ADO.
> Thanks in advance,
> Sarah Thompson
> CEO, Telergy Software International Ltd.
You are welcome, these are the kind of applications that I think Haskell is good at.
Yours,
Erik Meijer