Corman Lisp Discussion Groups Forum Index Corman Lisp Discussion Groups
For discussing Corman Lisp topics, and other programming topics
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Slime and Corman 3.0

 
Post new topic   Reply to topic    Corman Lisp Discussion Groups Forum Index -> Technical Issues
View previous topic :: View next topic  
Author Message
ungil



Joined: 10 Mar 2004
Posts: 15
Location: Geneva, Switzerland

PostPosted: Tue Sep 19, 2006 2:41 pm    Post subject: Slime and Corman 3.0 Reply with quote

Evaluating the following code in Corman Lisp 3.0 and then doing M-x slime-connect in Emacs I'm able to get a slime session working.

Code:
(load "c:/winsock.lisp")
(load "c:/sockets.lisp")
(load "c:/slime/swank-loader.lisp")
(swank:create-server)


winsock.lisp and sockets.lisp are copies of the files in the CCL distribution with only two modifications: in winsock.lisp I shadow cl:listen and in sockets.lisp I call explicitely winsock::listen

Code:
$ diff -b sockets.lisp Program\ Files/Corman\ Technologies/Corman\ Lisp\ 3.0/Sys/
469c469
<                       (winsock::listen (socket-descriptor s) SOMAXCONN))))
---
>                       (listen (socket-descriptor s) SOMAXCONN))))

$ diff -b winsock.lisp Program\ Files/Corman\ Technologies/Corman\ Lisp\ 3.0/Sys/
14,15d13
< (shadow '(cl:listen))
<


As for slime, I only had to make one change to the current cvs snapshot: I commented out the following line in swank.lisp.
Code:
;;(test-print-arglist)


The slime session runs into problems as soon as it tries to (print) something, but I won't be able to investigate further until the weekend and I thought someone could find this interesting even if it's not really working yet.
Back to top
View user's profile Send private message
synchromesh
Site Admin


Joined: 08 Dec 2003
Posts: 38
Location: Wellington, New Zealand

PostPosted: Thu Sep 21, 2006 11:30 pm    Post subject: Reply with quote

Hi Carlos,

That's great news, especially with so few modifications to the 'stock' Corman Lisp and SLIME codebases.

Keep up the good work! I'll try to find some time to test this myself and see how far I get...

John :^P
_________________
John Pallister http://johnp.net
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pinterface



Joined: 22 Dec 2007
Posts: 1

PostPosted: Mon Dec 24, 2007 2:49 pm    Post subject: Reply with quote

Has anyone actually gotten slime/swank working with CCL 3.01 yet? I've been looking at Corman Lisp because it supports something I need (COM), but I much prefer emacs+slime to CCL's IDE.

Unfortunately, I've been running into all sorts of problems getting slime to work with CCL. I've gotten to being able to connect and run code, but things like dropping into the debugger or loading ASDF systems tend to fall over--which makes it pretty hard to do much.

For instance, right now, I'm trying to figure out why the pretty-printer (Sys/xp.lisp) enjoys death on slime-output-streams, and I'm running up against the limits of my debugging skills. But then I thought /somebody/ must have done this already, right? Maybe?

If not, I guess I'll stick what I've got so far somewhere for people to look at.
Back to top
View user's profile Send private message
rgcorman
Site Admin


Joined: 08 Dec 2003
Posts: 282
Location: Santa Rosa, CA, USA

PostPosted: Wed Jan 09, 2008 10:36 am    Post subject: Reply with quote

I would like someone who is working (or trying to work) with SLIME to try using the alternative corman lisp console which can be built from the module console.lisp.

This console can be created by loading the file modules/console.lisp.
Then execute:

Code:
(ccl:save-application "console-main" #'main)


(Note the comment in the header is slightly wrong--it shows the function name as console-main).

This creates a console application called console-main.lisp (or you can name it whatever you want) and it should duplicate the behavior of clconsole.exe. It creates a very simple, standard console which probably is more likely to interface correctly with other applications and IDEs, since it is single-threaded and pretty much just passes characters through to the OS. The clconsole application is a bit more complicated, using multiple threads, and is written in native C++. The console-main app is all common lisp.

If someone can try this and let me know if it is working better, perhaps we will start bundling it pre-built as a replacement or alternative console.

Roger
_________________
Roger Corman
www.cormanlisp.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
G Neil Haven



Joined: 28 Jan 2008
Posts: 6

PostPosted: Mon Mar 17, 2008 7:09 pm    Post subject: slime swank xemacs lisp and all that Reply with quote

Some background: XEmacs runs slime. Lisp runs swank. Slime communicates with swank via a dedicated socket. The xemacs/slime distribution software does not work with corman lisp 3.01. Nor does the software at http://www.grumblesmurf.org/lisp/corman-slime, which apparently worked for an earlier version of corman lisp.

Environment: I am running Corman Common Lisp 3.01 on Vista with XEmacs v.21.4.21 and Slime-2.0 dated 2006-04-20.

Roger suggested above using a trimmed version of the lisp console for slime service. No go. Don't bother. Even after making the changes outlined below, the standard CormanLisp.exe console functioned much more reliably with slime. The trimmed console that Roger described above only connected to the slime socket about 10% of the time -- randomly. After several frustrating hours of trying to diagnose the exceptions being thrown from the lisp socket interface I stopped using the trimmed console and started using the standard console.

The #’user-homedir-pathname function wrongly omits a trailing backslash. Note:

Code:
LISP> (user-homedir-pathname)
#P”C:\Users\Name”  ; should be #P”C:\Users\Name\”
LISP> (merge-pathnames “subdir\\file.ext” (user-homedir-pathname))
#P”C:\Users\dir\file.ext” ; should be #P”C:\Users\Name\dir\file.ext”

I redefined #’cl:user-homedir-pathname to fix the problem.

I followed the suggestions from ungil above and commented out all test cases for test-print-arglist in the swank.lisp source code.

I also made the changes to sockets.lisp and winsock.lisp ungil described above.

With these changes I was able to load the swank-loader.lisp file from the slime distribution and then create a server via (swank:create-server). By starting xemacs and then doing a Meta-X slime-connect, I was able to establish a connection almost 100% of the time.

Within xemacs, it seemed that the *slime-repl* functioned quite well – so long as I didn’t do anything to invoke the debugger. Invoking the debugger was often fatal, but since I was debugging slime and swank code, I can’t really count that as a fair test.

However, and unfortunately, I was unable to edit any lisp files in xemacs with slime running. The problem seems to be that corman lisp’s type system is broken with regard to generic functions. Try this:

Code:
LISP> (typep #’defun ‘GENERIC-FUNCTION)
LISP> (typep #’print-object (type-of #’print-object))

Corman lisp will throw exceptions because it doesn’t understand generic function types. This leads to broken swank code.

Hacking the corman lisp type system is a job I would rather leave to the people who understand it… Roger?

For details on all of this, including exact code changes, you can consult
http://brainrack.wordpress.com/2008/03/17/xemacs-slime-and-corman-common-lisp.
Back to top
View user's profile Send private message
rgcorman
Site Admin


Joined: 08 Dec 2003
Posts: 282
Location: Santa Rosa, CA, USA

PostPosted: Thu Mar 20, 2008 2:59 pm    Post subject: Reply with quote

I forwarded Neil a patch for the generic functions problem (it turns out both generic-functions and methods displayed the problem) and I plan to roll out the patch or (probably) release a new version 3.02 within the next few days. There have been many bug fixes and improvements since 3.01 and I want to get them all out there. Some involve the kernel and make it less practical to do via patches.

This particular problem is fixed by these lines:
Code:

(in-package :cl)
(declare-type-specifier standard-generic-function (s1 s2)
                      (and (cl::clos-instance-p s1)
                           (cl::subclassp (class-of s1) (find-class s2))))

(declare-type-specifier generic-function (s1 s2)
                      (and (cl::clos-instance-p s1)
                           (cl::subclassp (class-of s1) (find-class s2))))

(declare-type-specifier standard-method (s1 s2)
                      (and (cl::clos-instance-p s1)
                           (cl::subclassp (class-of s1) (find-class s2))))

(declare-type-specifier method (s1 s2)
                      (and (cl::clos-instance-p s1)
                           (cl::subclassp (class-of s1) (find-class s2))))

(declare-type-specifier method-combination (s1 s2)
                      (and (cl::clos-instance-p s1)
                           (cl::subclassp (class-of s1) (find-class s2))))



which may be added anywhere--I added them to clos.lisp along with the other declare-type-specifier calls.

Roger
_________________
Roger Corman
www.cormanlisp.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
G Neil Haven



Joined: 28 Jan 2008
Posts: 6

PostPosted: Thu Apr 03, 2008 8:38 pm    Post subject: How to run slime with ccl Reply with quote

After some work, and some help from Roger, I have got Corman Lisp v3.01 running with XEmacs slime. Not everything works; but enough.

Roger has indicated he is going to release a new version of ccl soon, and after he does I will post a cookbook here on how to get things running. In the meantime, I have decided not to clutter things up with a long series of instructions that will doubtless need extensive modification within a few weeks when the latest, greatest ccl is released. So I have published the instructions on the brainrack blog: http://brainrack.wordpress.com/2008/04/04/slime-swank-and-corman-lisp-v301/

You are welcome to post any problems you have, and if it is within my ambit I'll try to answer.
Back to top
View user's profile Send private message
pTymN



Joined: 16 Nov 2005
Posts: 42
Location: Chapel Hill, NC, USA, Earth...

PostPosted: Wed Apr 09, 2008 6:16 am    Post subject: Reply with quote

I'm guessing a minor release? The 2.5 -> 3.0 jump was a fairly large one. Smile
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
rgcorman
Site Admin


Joined: 08 Dec 2003
Posts: 282
Location: Santa Rosa, CA, USA

PostPosted: Wed Apr 09, 2008 8:28 am    Post subject: Reply with quote

We are just planning a minor release, 3.02, to roll in all the bug fixes and minor enhancements we currently have. Some changes affected the kernel and the IDE and it seemed like too much to try to put out as separate patches. I hope to have that complete within the next week.
_________________
Roger Corman
www.cormanlisp.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ungil



Joined: 10 Mar 2004
Posts: 15
Location: Geneva, Switzerland

PostPosted: Wed Sep 03, 2008 11:28 pm    Post subject: Reply with quote

Any news on 3.02? I'm starting to get impatient Smile
Back to top
View user's profile Send private message
rgcorman
Site Admin


Joined: 08 Dec 2003
Posts: 282
Location: Santa Rosa, CA, USA

PostPosted: Mon Sep 08, 2008 9:35 am    Post subject: Reply with quote

I apologize for the delay. The last few months were very hectic and we had to re-prioritize things. I'll try to get it out soon.
_________________
Roger Corman
www.cormanlisp.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jfripp



Joined: 16 May 2005
Posts: 16

PostPosted: Thu Jan 22, 2009 2:26 am    Post subject: Reply with quote

Nothing new ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Corman Lisp Discussion Groups Forum Index -> Technical Issues All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group