Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread Edward Kmett
lazycat, You may find the following link useful, as it talks about much the same approach. http://nathanwiegand.com/wp/2010/02/hot-swapping-binaries/ Sadly, any hot-swap mechanism is going to suffer from the potential loss of state where that state is not controlled by your code. When that loss

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread Evan Laforge
On Fri, Jul 16, 2010 at 11:21 AM, Don Stewart wrote: > Generally, in Erlang or Haskell, the semantics we use is to keep > all the old code in memory, for  the case of closures and thunks that > point back into that code. > > You can imagine a fine-grained semantics where as each top level > functi

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread Don Stewart
Generally, in Erlang or Haskell, the semantics we use is to keep all the old code in memory, for the case of closures and thunks that point back into that code. You can imagine a fine-grained semantics where as each top level function is no longer referenced, the *code* for that is swapped. I be

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread austin seipp
Sorry Andy! CC'ing to the rest of -cafe in case anybody notices (I need to stop haskelling so early in the morning...) On Fri, Jul 16, 2010 at 8:59 AM, austin seipp wrote: > You also may like one project I wrote, an IRC bot that used hs-plugins > to do hot code reloading (only works on GHC 6.8.)

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread Andy Stewart
Bartek Ćwikłowski writes: > Hello Andy, > > 2010/7/16 Andy Stewart : > >> 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. > > Fo

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread Bartek Ćwikłowski
Hello Andy, 2010/7/16 Andy Stewart : > 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. For my 2008 GSOC application I wrote a demo

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread Andy Stewart
Thomas Schilling writes: > What would be the semantics of hot-swapping? For, example, somewhere > in memory you have a thunk of expression e. Now the user wants to > upgrade e to e'. Would you require all thunks to be modified? A > similar problem occurs with stack frames. > > You'd also have

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread Thomas Schilling
What would be the semantics of hot-swapping? For, example, somewhere in memory you have a thunk of expression e. Now the user wants to upgrade e to e'. Would you require all thunks to be modified? A similar problem occurs with stack frames. You'd also have to make sure that e and e' have the s

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-15 Thread Don Stewart
lazycat.manatee: > 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" > technology: > >re-compile new code with new binary entry > >when re-compile succe

[Haskell-cafe] Hot-Swap with Haskell

2010-07-15 Thread Andy Stewart
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" technology: re-compile new code with new binary entry when re-compile success $ do save state bef