I'm looking for a way to run an arbitrary Haskell code safely (or refuse to run unsafe code).
Must have:
- module/function whitelist
- timeout on execution
- memory usage restriction
Capabilities I would like to see:
- ability to kill thread
- compiling the modules to native code
- caching of compiled code
- running several interpreters concurrently
- complex datatype for compiler errors (insted of simple message in String)
With that sort of functionality it would be possible to implement a browser plugin capable of running arbitrary Haskell code, which is the idea I have in mind.
EDIT: I've got two answers, both great. Thanks! The sad part is that there doesn't seem to be ready-to-go library, just a similar program. It's a useful resource though. Anyway I think I'll wait for 7.2.1 to be released and try to use SafeHaskell in my own program.