I am working on the recently released lisp implementation clasp (https://github.com/drmeister/clasp), and I would like to get it working in slime. I am wondering if there is a general purpose document for adding support for slime to a new implementation out there some where? If not, where is a good place to begin?
Thank you, Charlie
On Mon, Oct 6, 2014 at 8:28 PM, Charlie Andrews charlieandrews.cwa@gmail.com wrote:
I am working on the recently released lisp implementation clasp (https://github.com/drmeister/clasp), and I would like to get it working in slime. I am wondering if there is a general purpose document for adding support for slime to a new implementation out there some where? If not, where is a good place to begin?
I'm not aware of such a document, but this recent commit adds support for the MKCL implementation (a fork of ECL): https://github.com/slime/slime/commit/102942bb6f9e60e07961a1844a762dcf7b336a77. It shows, albeit with some whitespace noise, what places need to be aware that a new implementation exists.
Other than that, it should a matter of adding the various defimplementation definitions for each of SWANK's interfaces which are declared and documented in swank/backend.lisp. Looking at the other Lisp implementation backends (e.g. swank/sbcl.lisp should also be enlightening).
Cheers,
On Mon, Oct 06 2014, Charlie Andrews wrote:
I am working on the recently released lisp implementation clasp (https://github.com/drmeister/clasp), and I would like to get it working in slime. I am wondering if there is a general purpose document for adding support for slime to a new implementation out there some where? If not, where is a good place to begin?
Basically you need to implement the functions that are described in swank/backend.lisp. Not all are needed. To begin, create a file like swank/clasp.lisp and add it to swank-loader.lisp. Start it with "make run-swank" or something similar in an a shell outside of Emacs. Then use M-x slime-connect from Emacs. You will then run into undefined functions that you need to implement.
(Set swank::*log-events* to T for debugging. It's probably sensible NOT to bind *debugger-hook* in swank/backend:call-with-debugger-hook at the beginning, so that you can use the normal debugger. It might save some compilation time if you set *contribs* in swank-loader.lisp to nil.)
Look at existing backends for inspiration, I believe swank/allegro.lisp is the shortest and relatively clean. You need to decide what "communication style" you want to use; that's basically threads or no threads. I think less code is needed if you don't use threads, but then you need to implement swank/backend:wait-for-input, which can be tricky.
Helmut
Helmut Eller eller.helmut@gmail.com writes:
On Mon, Oct 06 2014, Charlie Andrews wrote:
I am working on the recently released lisp implementation clasp (https://github.com/drmeister/clasp), and I would like to get it working in slime. I am wondering if there is a general purpose document for adding support for slime to a new implementation out there some where? If not, where is a good place to begin?
Basically you need to implement the functions that are described in swank/backend.lisp. Not all are needed. To begin, create a file like swank/clasp.lisp and add it to swank-loader.lisp. Start it with "make run-swank" or something similar in an a shell outside of Emacs. Then use M-x slime-connect from Emacs. You will then run into undefined functions that you need to implement.
Just to add to this: the moment that you can use it to develop itself is a rather nice moment -- so getting the bare minimum up and running as quickly as possible is a nice way to go. If I remember rightly, getting slime-eval-region working made a big difference when I was developing a backend for R, and so did getting sldb (not least because R's native debugger is horrible...).
Best wishes,
Christophe