5 ms·
Connecting SLIME to a remote Clojure Repl
- alrex021 17y agoI use this approach myself to remotely modify my clojure app bytecode at runtime. So if, for instance, I need to add a new function at runtime to my personal clojure blog app, all I do is connect to my remote REPL, write the function and refresh my browser. Thats extremely powerful I'd say. Technically what this does in the case of my blog is modify the proxied Java Servlet bytecode at runtime.
- sgrove 17y agoWow, that sounds insane. I'm really going to have to spend more time diving into clojure. Or is this a normal feature of most lisp variants?
- gruseom 17y agois this a normal feature of most lisp variants? Yes.
- jrockway 17y agoAnd indeed, most programming languages.
- jrockway 17y agoI am serious about this. I get this exact functionality with Perl, and I'm sure it's possible in Python and Ruby just as easily. Depending on where you want to draw the line, you can do this in Haskell (see xmonad and yi, for example), and even in C. I like Lisp, but this is not particularly amazing.
- kyleburton 17y agoYes, in fact most common lisps support quite a bit more run-time features than Clojure does - like saving and restarting the image, conditions, etc. I found the uncommon-web screen casts to be very inspirational.
- mark_h 17y agouncommon web was fantastic -- I haven't looked at it for a while, but the mailing list (which I'm subscribed to but no longer read) isn't too active. There do seem to be a few people still using and developing it though. An approach like that for clojure would be a great thing IMO; that is, something different from the normal web framework approach, while exploiting the strengths of the clojure language and JVM ecosystem.
- radu_floricica 17y agoSame here with the casts, but actually making it work turned out to be quite a challenge. Weblocks looked a lot better, but it was still in development at the time. Since then I switched to clojure completely.
- ZitchDog 17y agoDo you use source control? I think this stuff is very cool but I have misgivings about my production code not being in a VCS.
- kyleburton 17y agoYes, currently using git for all my projects at the moment.
- alrex021 17y agoYes, I do use a VCS. This is not something I'd recommend performing in prod on mission critical type system for obvious reasons. I quite often use the approach to apply patches, which at runtime modifies the bytecode in my remote running JVM. (So I apply a patch to my blog without needing to restart the proxied servlet, just hit refresh in browser. Something old Java guys like myself are not used to :-))