Erlang allows two versions of a module to be stored in memory at any given time. This allows you to do hot code swapping at runtime without taking down the running server. Clojure can obviously do the same thing, but Erlang offers a convenient builtin mechanism for shelling into the running Erlang VM.
I've been thinking about how this would be accomplished in Clojure, and it seems you could simply have a thread listening for a connection and then write a small function to inject the new code across the listening socket. This way, you could fire up your REPL, load your library, and then just call your hot-swap function to send a new callback to the running server without any additional dependencies such as Nailgun (which I wouldn't use in production anyway). -Travis On Sep 4, 8:59 am, Krukow <karl.kru...@gmail.com> wrote: > On Sep 4, 1:38 pm, Christophe Grand <christo...@cgrand.net> wrote: > > > You have to be prepared to deal with potential inconsistencies: a > > closure (or any object) can hold a reference to the value of a > > function. > > OK - I realized this already for running threads, e.g., executing a > function where a var means one thing the first time around and another > the second. But your example points out that laziness and closures > makes this even worse :-( > > I guess the conclusion is that you can't really fix live production > systems without some downtime without carefully designing the system > for this upfront (following certain conventions), i.e., you don't get > this *for free* by using a LISP (of course the development aspects of > change on-the-fly are still good). > > Now I am a complete Erlang novice, but I think OTP has (some kind of) > built-in support for system upgrades. It might be worth checking out > to see if there is something we can adapt to Clojure? > > /Karl --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---