4 ms·
It seems that real-time code update is one of Lisp's biggest selling points. Any idea how this is done in a distributed environment with multiple Lisp instance
by papersmith 19y ago
It seems that real-time code update is one of Lisp's biggest selling points. Any idea how this is done in a distributed environment with multiple Lisp instances sharing the same code?
- alec 19y agoIt's a huge development aid - if you're running emacs and slime, you can reload individual functions or files with a quick key combo, and if you want code reload over multiple files, a reload function is easy to write - check times and you're off. You can also do that with compiled code, too - instead of (load "filename"), use (load (compile "filename")) and it'll be compiled. The next time the functions are called, they'll use the new ones. The tricky part is macros and inline functions. Any time you change a macro or a function you want to inline (CL compilers can't do that automatically because of the language spec), you need to recompile all the functions that use that macro/inlined function. ASDF has some dependency-tracking functionality, but I haven't used it.
- papersmith 19y agoThe REPL is pretty cool indeed. :) My question is, once you have to scale to multiple machines, with a separate Lisp instance on each machine, are there any good ways to call load once and update on all instances.
- gibsonf1 19y agoYou can easily set up a "reload" button in a global admin part of your website to coordinate all instances, but my founder pointed out that the danger in doing that is you cant see any error messages on the load that were unanticipated, making it harder to quickly fix any problems. We're using SBCL on Ubuntu, and we have run into some problems with compiled fsl files. Even though we use an asdf load routine with dependencies defined, we sometimes run into certain fsl files not properly getting updated. This is either a dependency error on our part (most likely) or something else, and our work around is to simply delete all .fsl files just before running the asdf (which you can make part of the load process). So our routine is for each machine, (2 net + local instance) is to run an svn update and then run our loader file (sf-load) and thats it. It is most impressive to keep the same process running and update the code with no interruption in service.
- papersmith 19y agoSorry if these are stupid questions, since all my Lisp experiences are academic. Do you need some kind of remote procedure call to coordinate the updates from an admin instance? I only know that there's the swank server for talking to emacs, is there something similar for talking between CL instances? Perhaps you just issue an HTTP Post for each server in a loop?
- mynameishere 19y agoYou guys do realize that this is possible with Java, right? (It depends on your environment, of course.) ...generally, you wouldn't do this production systems, I would hope, whatever the language.