4 ms·
This reminded me of that story about Lisp at the JPL, when the author debugged and hotswapped code midway through a mission thanks to a built-in REPL. "Having
by ojosilva 15y ago
This reminded me of that story about Lisp at the JPL, when the author debugged and hotswapped code midway through a mission thanks to a built-in REPL.
"Having a read-eval-print loop running on the spacecraft proved invaluable in finding and fixing the problem."
http://www.flownet.com/gat/jpl-lisp.html http://www.flownet.com/gat/jpl-lisp.html
Since then, I always make sure I have a (safe) REPL backdoor into my long-running Perl apps.
- berntb 15y ago>>(safe) REPL backdoor into my long-running Perl apps. Is it on CPAN?
- ojosilva 15y agoNot that I know of. But it's so simple to hook input to an eval in Perl (or any dynamic language for that matter), that I've always wrote it myself. It can also be implementation specific (preforking server, event-loop, dispatcher daemon...). I've used different approaches throughout the years: - a controller action in Catalyst that listens at http://host/repl http://host/repl which evals the POST parameters. As a client, I use a simple admin-repl html page. - in the main loop of a daemon script, a quick check for a row in a DB table or a special file in the server. When the server detects a new repl event, it evals the contents and writes the response back (either to the DB or to a file log). - a 3 line AnyEvent::JSONRPC::Lite server that listens on a given local port for a string to eval. A matching JSONRPC client that calls that port with the repl string. I've used it to run scripts, and recently with a Corona-based Dancer app. Maybe it could become a Plack::Middleware someday.
- jerf 15y agoPoke the word REPL into search.cpan.org and start looking around. Since you frequently want it integrated with some network you might be able to find one for whatever network thing you are doing.