From HaskellWiki
Jump to navigation Jump to search

Resource Limits for Haskell

Edward Z. Yang

Safe Haskell offers the tantalizing possibility of running arbitrary, untrusted code as part of Haskell programs. However, a major obstacle to this dream is how to bound the time and space usage of such untrusted code. In this talk, we would like to describe a first implementation of a resource limits system for Haskell, which reuses the preexisting conceptual framework GHC has for discussing time and space usage: the cost semantics for profiling.

Our first implementation largely reuses the existing implementation of profiling, and requires relatively few changes to the runtime system. However, profiling imposes a substantial memory and time cost on Haskell programs; thus, we'd also like to describe a partially implemented alternate strategy which utilizes a block-structured heap for what should be dramatic performance improvements. We'd like to pose an open question: how can this scheme be implemented in a *parallel* garbage collector?