[Haskell-cafe] newbie - how to call a Haskell interpreter from C

Henk-Jan van Tuyl hjgtuyl at chello.nl
Sat Aug 25 07:35:24 EDT 2007


The easiest way to run Haskell software from a C program is to give the  
shell command:
   runhaskell Foo.hs

This command is part of the GHC package.

A more advanced way is, to link Haskell libraries by means of the foreign  
function interface (FFI) [1].
There are several tools to support FFI development [2]. I am sure my list  
of URL's is not complete.

[1] http://www.cse.unsw.edu.au/~chak/haskell/ffi/
     http://www.haskell.org/haskellwiki/FFI_Introduction
     http://www.haskell.org/haskellwiki/FFI_cook_book

[2] http://www.haskell.org/haskellwiki/FFI_imports_packaging_utility
     http://www.haskell.org/haskellwiki/HSFFIG

Met vriendelijke groet,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--

On Fri, 24 Aug 2007 01:12:56 +0200, Brock Peabody  
<brock.peabody at gmail.com> wrote:

> I've been trying to find place to use Haskell at work, and I think a good
> opportunity will be to use it for our scripting language. To do that, I  
> need
> to be able to invoke an interpreter directly from another language.
>
> I've investigated using HaskellScript (too web/ActiveX centric), but  
> really
> I just want to compile ghci or hugs into my executable/library. It seems
> like this is something I should be able to figure out easily, but so far
> I've failed and have not found any reference to others succeeding.
-- 


More information about the Haskell-Cafe mailing list