Hi Noah, > On Sat, Feb 16, 2013 at 2:14 PM, Mark H Weaver <m...@netris.org> wrote: [...] > Noah Lavine <noah.b.lav...@gmail.com> writes: [...] > > I have thought a bit about how to fix this. The module system already > > allows us to be notified whenever a variable changes, so it would be > > easy to watch all of the variables in (guile) and recompile procedures > > when they change. I might take a look at this soon. > > > This would be nice too, of course, but I warn you that it's a can of > worms. In the general case, it involves on-stack replacement, because > you might need to recompile a procedure that's currently in the middle > of being run, and thus currently has activation records on the > stack(s). > > > You mean if a function modifies another function that called it.
There are many other cases. Think multiple threads, coroutines, logic programming systems, etc. That's why I wrote "stack(s)". Actually, I should have written "(partial) continuation(s)". There are any number of ways that an activation record for some procedure you modify could still be alive somewhere in the heap. The issue can arise even with simple lazy data structures. I don't think it's something we should punt on. IMO anyway. What do you think? Mark