
In another thread's discussion, we touched on the implementation of a text editor. It invariably comes up, in building a text editor, as to whether to allow editing of things larger than will fit in memory, etc. And so, practical concerns enter in that, in my mind at least, take us away from solving the conceptual problem at hand, and now the focus shifts to implementation details that we'd rather not be bothered with. One approach is to let the OS's virtual memory take care of it. Sometimes this is fine, sometimes not, often times around issues of performance, where a completely general purpose swapping device can't perform as well as a more specifically targeted design. Question: Should the Haskell runtime enviroment provide swapping services for large objects?

On 6 Dec 2004, at 14:55, GoldPython wrote:
Question: Should the Haskell runtime enviroment provide swapping services for large objects?
I can't immediately see why the haskell runtime should be able to guess better than the underlying VM how to handle memory: might as well leave that to the OS. Unless you're not running on an OS with VM, I suppose... If you were really writing an editor in haskell for larger-than-memory files, I imagine you would have a structure which is lazily-read-from-disk, so that only actual changes need storing in memory. Further more at idle time you can write out unsaved changes to disk (to a temporary file, of course, not the main file) and thus stop memory usage creeping up. This could all be quite fast and efficient (perhaps slightly more so if we had an interface to mmap()). Jules
participants (2)
-
GoldPython
-
Jules Bean