Re: [Haskell-cafe] Embedded scripting Language for haskell app

From: Hemanth Kapila
Subject: [Haskell-cafe] Embedded scripting Language for haskell app Hi,
Can some one please give me a suggestion on the best choice for an embedded scripting Language for a haskell application? I mean, something like guile/lua for c/c++ and groovy/jruby for java.
I'm sure that the best option depends on the features you want from your embedded scripting language. With no prior experience, it took me about 15 minutes to install hint and add scripting support to an application. This involves interpreting an EDSL which uses associated types, so at least that much appears to work without problems. The example file on the hint project website is terse but sufficient. One question I have regards distributing applications using hint. Does the target computer need ghc/libs installed? I think so, but would like to have this confirmed. If so, this might be a good reason to use Lua. John
For quite some time, I've been using a lisp-like interpreter that I implemented myself. But this is not going too well - going by this road, I suspect I will end up with a mule. I am looking for a pony (a declarative programming language). I am okay with a donkey too.
baskell[1] seems interesting. And there's hslua[2]. Can one use hint[3] like this ?
Thanks Hemanth K [1] baskell - http://hackage.haskell.org/package/baskell [2] hslua - http://hackage.haskell.org/package/hslua [3] hint - http://hackage.haskell.org/package/hint

Can some one please give me a suggestion on the best choice for an embedded scripting Language for a haskell application?
Why not use Haskell itself? I agree that C and Java aren't perhaps the best choice for application scripting – but both Xmonad and Yi have had quite some success using Haskell to script/configure a Haskell application. Wouter

On Tue, Aug 17, 2010 at 8:50 AM, Wouter Swierstra
Can some one please give me a suggestion on the best choice for an embedded scripting Language for a haskell application?
Why not use Haskell itself? I agree that C and Java aren't perhaps the best choice for application scripting – but both Xmonad and Yi have had quite some success using Haskell to script/configure a Haskell application.
First of all, size. AFAIK, hint requires the full GHC to be installed, which means that to distribute your program you need to distribute at least a dozen mebibytes more. And perhaps more importantly, sandboxing. Reading hint's documentation it isn't clear to me how one could have a whitelist of packages and/or modules. With Lua this is a no-brainer. But I also think that Haskell makes a great scripting language. I guess its suitability depends on what kind of scripting you want to do. Cheers! -- Felipe.

Wouter Swierstra wrote:
Can some one please give me a suggestion on the best choice for an embedded scripting Language for a haskell application?
Why not use Haskell itself?
That's not a half-bad idea. However, installing the whole of GHC (or worse, HP) just to do a little scripting is almost the very definition of the term "overkill". I don't know if Hugs or JHC would be any easier. Then again, how many embedded script languages need Software Transactional Memory, Nested Data Parallelism, the Foreign Function Interface, advanced program optimisation capabilities, and all the other things that GHC provides? I think there would probably be some mileage in somebody building a simplified Haskell interpretter specifically for embedding as a scripting language.
participants (4)
-
Andrew Coppin
-
Felipe Lessa
-
John Lato
-
Wouter Swierstra