User loginNavigation |
Dynamic Eager HaskellI was looking at at some memory profiles of a misbehaving Haskell program a while back, and the electrical engineer in me couldn't help but think that the graphs looked very much like step responses. And it got me to thinking about how lazy programs with a space leak might be thought of as being an unstable dynamic system (a pole in the RHP). You deal with problems like that with Control Theory. But how do you apply it to a Haskell program? Maybe with something like Eager Haskell. My understanding of Eager Haskell is that it tries to execute your program eagerly, and when it starts to exhaust memory (from trying to evaluate an infinite list, etc.) it resorts back to laziness. That doesn't seem very sophisticated. But what if the "eagerness" knob was available to the program itself, or maybe another agent. You could then start to think about building better controllers. What variables would we want to control? I don't know, and it would probably depend on your algorithm, but interesting candidates might be: rate of change of memory usage, speed at which characters are written to your output file, ratio of memory usage to CPU usage (i.e. we're creating a lot of thunks that aren't being evaluated), etc. I could also imagine that applying a dose of control theory to the behavior of lazy programs might make it easier to reason about their resource usage. Heck, even if it didn't lead to anything useful, it might be interesting to put PID controller into your runtime system, just to see what happens. By Greg Buchholz at 2005-01-18 18:51 | LtU Forum | previous forum topic | next forum topic | other blogs | 11221 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 2 days ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago