Interact with a locally long-running Common Lisp image, possibly daemonized, from the command line

后端 未结 2 820
春和景丽
春和景丽 2021-02-14 17:33

How could one interact with a locally long-running Common Lisp image, possibly daemonized, from the command line?

I know it is possible to run a Common Lisp function fro

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-14 17:50

    You may find scriptl useful: http://quickdocs.org/scriptl/. However, it depends on iolib, which depends on some nonstandard C or C++ library, so building it is not quite straighforward.

    It is indeed possible to communicate with a swank server if you familiarize yourself with the swank protocol, which seems to be underdocumented (see e. g. here: https://github.com/astine/swank-client/blob/master/swank-description.markdown). However, this exposes a TCP socket over a network, which could be unsafe. Once I tried that, too, but I was not satisfied with the IPC speed.

    A while ago I wrote a rather naive SBCL-specific server that uses a local domain socket for communication, and a client in C. It's very raw, but you could take a look: https://github.com/quasus/lispserver. In particular, it supports interactive IO and exit codes. The server and the client form the core of a simple framework for deploying Unix style software. Feel free to borrow code and/or contact me for explanations, suggestions, etc.

提交回复
热议问题