[Slime-devel] SLY, a fork of SLY

João Távora joaotavora at gmail.com
Mon Sep 8 15:20:46 UTC 2014


Zach Beane <xach at xach.com> writes:

> I'd like to try out sly. I'd like sly not to make it impossible to load
> swank and slime afterwards. A conflicting system file and conflicting
> emacs symbol names are an impediment to that.
>
> I think slynk is a fine name for the CL-side of sly.

Zach, 

OK, so in SLY's "renames-v2" branch available at

    https://github.com/capitaomorte/sly/tree/renames-v2

there is support for loading both SLYNK and SWANK at the same time in
the same Lisp image and loading both SLIME and SLY in the same Emacs.

This is the test I used, for reference

    $ emacs -Q

    (setq inferior-lisp-program "sbcl")
     
    (add-to-list 'load-path "~/Source/Emacs/sly")
    (require 'sly-autoloads)
    (delete 'sly-retro sly-contribs)
     
    (add-to-list 'load-path "~/Source/Emacs/slime")
    (require 'slime-autoloads)
    (setq slime-contribs '(slime-fancy))

Then you can "M-x sly". In the ensuing repl, you should be able to

   > (ql:quickload :swank)
   > (swank:create-server :port 4010)

And then you can `M-x slime-connect RET 4010 RET`.

You should getboth the SLIME and SLY's REPLs to the same Lisp image.

I tried this particular combination (1 Emacs to 1 Lisp) but other
"n-to-n" combinations should work as well.

Users wanting to do these kinds of stunts have to explicitly disable
`sly-retro` in their emacs configurations, otherwise they will get an
error when loading whichever is the second server.

Zach, if you wish to distribute SLY with quicklisp you can
probably add

    (setq sly-contribs (delete 'sly-retro sly-contribs))

to the elisp blessing that quicklisp installs.

If I get positive feedback I will merge "renames-v2" to the mainline.

João

PS: Helmut: I still use SLYNK-RPC::SIMPLE-READ for the bootstrapping, so
thanks again for that trick. By the way, a comment nearby states that
"no one ever tested this and will probably not work". Which is correct,
but is easy to fix: when a symbol is found, INTERN needs to parse the
package first or be replaced by READ-FROM-STRING entirely.

PS2: Here is more information about the implementation that I will
describe in SLY's CONTRIBUTING.md file.

I went ahead with the package nickname technique for the reasons I gave
to Helmut (safer interworking, early abort if error) and because I also
want to provide interoperability for other Lisp-side extensions looking
for the :SWANK package.

Nicknames are setup if `sly-retro` is in `sly-contribs`. Either via ASDF
or the old loader (still supported), `slynk-retro.lisp` is eventually
loaded into the Lisp on demand. It will set up the nicknames.

The user might also decide to ASDF-load `slynk-retro` or
`slynk-retro.lisp` directly from Lisp.

If sly-retro and slynk-retro are never loaded, SLY operates in a
completely isolated namespace AFAIK, both in Emacs and Lisp. Messages in
the RPC protocol are prefixed "slynk:"

The `sly-retro` contrib is in `sly-contribs` by default, meaning the
nicknames *are* setup by default and exchanged messages have "swank:""
as a prefix.







More information about the slime-devel mailing list