[Haskell-beginners] eval command?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Mon Oct 27 19:00:00 EDT 2008


On 2008 Oct 27, at 17:33, Alex Shearn wrote:
> Hey all - I've been trying to write an IRC bot following the guide  
> on the wiki, and we (those of us on the channel) were trying to get  
> it to evaluate commands.
> So far, we have this for "eval" stuff, but is there anyway to  
> specify a "parse in haskell" sort of thing?


No, although you could fake it with the GHC-API (which basically means  
your bot has all of GHC built into it).

In any case, that's not really a good idea; consider what damage could  
be done by arbitrary code.  A better idea is to link the code into a  
small program with a very restricted environment and run that with a  
timeout.  See http://code.haskell.org/lambdabot/Plugin/Eval.hs.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Beginners mailing list