tags:

views:

178

answers:

2

Has anyone ever written a Haskell extension to Perl? Maybe something simple, like a function that calculates the fib. sequence? I'm interested in using Haskell, and I see some overlap between the Haskell and Perl community. Any pointers to Haskell / Perl projects, or cool things that manage to use both of these? I've seen Language::Haskell -which is only an interpreter- but it seems poorly documented, 6 years old, and lots of fail.

Is it possible to build extentions to Perl using ghci comparable to using XS (something I don't claim to know anything about)? I realize this question is probably all kinds of wrong, and badly worded. I'm attempting two things that I know little about - Haskell and extending Perl (which have both always interested me). Feel free to edit this.

+1  A: 

The closest work was Inline::Haskell I think, during the pugs / perl6 time.

You can also embed Perl5 in a Haskell program: http://hackage.haskell.org/package/HsPerl5

The Haskell FFI happily supports calling into Haskell from other languages, but I'm not sure this is sensible in the larger scheme of things. Sounds like you're doing it wrong.

Don Stewart
Where did you get Inline::Haskell from? I can't find it on CPAN, and the only thing I found relating to it was [this post on perlmonks on a similar tune](http://www.perlmonks.org/?node_id=369242).
Evan Carroll
I believe it was part of Pugs itself, rather than a separate package.
Edward Kmett
A: 

It's perhaps worth noting here that you can write shell scripts in Haskell as well using runhaskell:

#! /usr/bin/env runhaskell

There's HSH for mixing shell expressions into Haskell programs.

And the Simple UNIX Tools Haskell wiki page is full of ideas too.

dino