[Haskell-cafe] Hot-Swap with Haskell

Andy Stewart lazycat.manatee at gmail.com
Thu Jul 15 23:05:36 EDT 2010

Hi all,

I'm research to build a hot-swap Haskell program to developing itself in
Runtime, like Emacs.

Essentially, Yi/Xmonad/dyre solution is "replace currently executing"

   re-compile new code with new binary entry
   when re-compile success 
      $ do
          save state before re-launch new entry
          replace current entry with new binary entry (executeFile)
          store state after re-launch new entry
There are some problems with re-compile solution:

1) You can't save *all* state with some FFI code, such as gtk2hs, you
can't save state of GTK+ widget. You will lost some state after 
re-launch new entry.

2) Sometimes re-execute is un-acceptable, example, you running some command
in temrinal before you re-compile, you need re-execute command to
restore state after re-launch, in this situation re-execute command is un-acceptable.

I wonder have a better way that hot-swapping new code without


  -- Andy

More information about the Haskell-Cafe mailing list