Slime: Windows SBCL with Cygwin Emacs
-
- Posts: 99
- Joined: Sat Jul 26, 2008 2:30 pm
- Location: Germany
- Contact:
Slime: Windows SBCL with Cygwin Emacs
Hello.
I currently changed to windows, and I am currently using the Emacs from Cygwin (and actually I want to keep it that way if possible). I installed slime and it works well with clisp.
Unfortunately there is no SBCL which is compatible with Cygwin it seems, so I installed the Windows-Version of SBCL and tried to run it in slime. I get the error message that SIGPIPE was sent to the application. SIGPIPE means - as far as I read - that some pipe which was opened wasnt opened by the other side.
I tried with directly opening a tcp-swank-server and connecting emacs, and seems like emacs is able to connect to it, but doesnt start a repl.
Any suggestions?
I currently changed to windows, and I am currently using the Emacs from Cygwin (and actually I want to keep it that way if possible). I installed slime and it works well with clisp.
Unfortunately there is no SBCL which is compatible with Cygwin it seems, so I installed the Windows-Version of SBCL and tried to run it in slime. I get the error message that SIGPIPE was sent to the application. SIGPIPE means - as far as I read - that some pipe which was opened wasnt opened by the other side.
I tried with directly opening a tcp-swank-server and connecting emacs, and seems like emacs is able to connect to it, but doesnt start a repl.
Any suggestions?
Sorry for my bad english.
Visit my blog http://blog.uxul.de/
Visit my blog http://blog.uxul.de/
Re: Slime: Windows SBCL with Cygwin Emacs
SBCL-windows isn't that well-supported, as I recall.
Kinda what comes with a legacy OS.
Kinda what comes with a legacy OS.
-
- Posts: 99
- Joined: Sat Jul 26, 2008 2:30 pm
- Location: Germany
- Contact:
Re: Slime: Windows SBCL with Cygwin Emacs
Whats a good alternative then? CLISP works but is too slow for graphics output with lispbuilder-sdl. I could try ECL but it will certainly also be comparably slow (and isnt yet supported afaik).
Maybe Clozure? I read it has x86_64 support also for Windows, but not yet tried it.
Maybe Clozure? I read it has x86_64 support also for Windows, but not yet tried it.
Sorry for my bad english.
Visit my blog http://blog.uxul.de/
Visit my blog http://blog.uxul.de/
-
- Posts: 99
- Joined: Sat Jul 26, 2008 2:30 pm
- Location: Germany
- Contact:
Re: Slime: Windows SBCL with Cygwin Emacs
Ok, I tried clozure. Directly connecting via TCP works (would be a solution if nothing else works). But when starting through emacs, it complains that it cannot find the given lisp-file swank-loader.lisp, since it has a cygwin-path, not a windows-path.
I had similar problems with petite scheme. I just overloaded the load-function there. But maybe there is a default way of handling cygwin-filenames with clozure?
I had similar problems with petite scheme. I just overloaded the load-function there. But maybe there is a default way of handling cygwin-filenames with clozure?
Sorry for my bad english.
Visit my blog http://blog.uxul.de/
Visit my blog http://blog.uxul.de/
-
- Posts: 406
- Joined: Sat Mar 07, 2009 6:17 pm
- Location: Brazil
- Contact:
Re: Slime: Windows SBCL with Cygwin Emacs
Are you sure Clisp is not fast enough, did you test it? Some people tested it and it worked well enough. And ECL is supported in Windows, but you will have to compile it using Cygwin or Microsoft Visual C++ Toolkit (the later is recommended).schoppenhauer wrote:Whats a good alternative then? CLISP works but is too slow for graphics output with lispbuilder-sdl. I could try ECL but it will certainly also be comparably slow (and isnt yet supported afaik).
AFAIK, ECL is faster than Clisp, since it compiles to C, not to bytecode, but it is not as stable. ECL might get even faster with the new compiler being developed now, but the new compiler is not stable yet.
Then change the reference in the file .emacs to the correct windows path.schoppenhauer wrote:Ok, I tried clozure. Directly connecting via TCP works (would be a solution if nothing else works). But when starting through emacs, it complains that it cannot find the given lisp-file swank-loader.lisp, since it has a cygwin-path, not a windows-path.
-
- Posts: 99
- Joined: Sat Jul 26, 2008 2:30 pm
- Location: Germany
- Contact:
Re: Slime: Windows SBCL with Cygwin Emacs
Clisp wasnt fast enough one year ago. Its the ffi-calls. And the dffi-calls of ECL were also slow (and I couldnt find out how to turn their bytecode-interpreter off).gugamilare wrote:Are you sure Clisp is not fast enough, did you test it? Some people tested it and it worked well enough. And ECL is supported in Windows, but you will have to compile it using Cygwin or Microsoft Visual C++ Toolkit (the later is recommended).
There is no reference to swank-loader.lisp in the .emacs, seems hardcoded in slime.gugamilare wrote:Then change the reference in the file .emacs to the correct windows path.
Sorry for my bad english.
Visit my blog http://blog.uxul.de/
Visit my blog http://blog.uxul.de/
-
- Posts: 406
- Joined: Sat Mar 07, 2009 6:17 pm
- Location: Brazil
- Contact:
Re: Slime: Windows SBCL with Cygwin Emacs
Just compile the files or the functions you need and you are doneschoppenhauer wrote:(and I couldnt find out how to turn their bytecode-interpreter off).

Sorry, my mistake. Slime gets the path of swank-loader.lisp from Emacs. So you can try to change Slime's code or download the windows version of Emacs. You can also try finding some option from Slime's manual as well if you want to keep Cygwin's Emacs.schoppenhauer wrote:There is no reference to swank-loader.lisp in the .emacs, seems hardcoded in slime.gugamilare wrote:Then change the reference in the file .emacs to the correct windows path.
-
- Posts: 99
- Joined: Sat Jul 26, 2008 2:30 pm
- Location: Germany
- Contact:
Re: Slime: Windows SBCL with Cygwin Emacs
The reason why I want to keep Cygwin's Emacs is that I want one emacs for all things I do, I dont want to maintain multiple .emacs-files.
In Scheme, I wrote a little script
I will probably port it to ccl and overwrite its load-function (hopefully it will work then).
In Scheme, I wrote a little script
Code: Select all
;; hack for mzscheme substrings in petite
(define old-substring substring)
(define (substring str x . y)
(if (pair? y)
(old-substring str x (car y))
(old-substring str x (string-length str))))
(define (backslash-replace x . y)
(if (equal? "" x) (list->string (reverse y))
(apply backslash-replace
(substring x 1)
(cons
(let ((a (string-ref x 0)))
(if (equal? a #\/) #\\ a)) y))))
(define (translate-pathname x username)
"Translate a given cygwin-pathname to a windows-pathname"
(cond
((equal? (substring x 0 10) "/cygdrive/")
;; if pathname starts with /cygdrive/, then we need to add a drive
;; letter and leave out the C:\cygwin\ at the beginning
(string-append
(string (string-ref x 11) #\:)
(backslash-replace (substring x 12))))
((equal? (string-ref x 0) #\/)
;; pathname begins with / - is absolute
(string-append "C:\\cygwin" (backslash-replace x)))
((and (equal? (string-ref x 0) #\~)
(equal? (string-ref x 1) #\/))
;; pathname is own homedir
(translate-pathname
(string-append "/home/" username (substring x 1)) username))
((equal? (string-ref x 0) #\~)
;; pathname is other homedir
(translate-pathname
(string-append "/home/" (substring x 1)) username))
(#t ;; pathname is not absolute
(backslash-replace x))))
(define (maybe-translate-pathname x username)
"Implement a simple heuristic what type a pathname is and convert it
into a windows-pathname."
(let ((x-list (string->list x)))
(cond
((member #\/ x-list)
;; path contains slash - which is forbidden under windows
(translate-pathname x username))
((member #\\ x-list)
;; path contains backslash - is likely to be windows-pathname
x)
((equal? (cadr x-list) #\:)
;; is second sign a colon? - then its likely to be a windows-path
x)
((equal? (car x-list) #\~)
;; begins with tilde - more likely to be unix-pathname
(translate-pathname x username))
(#t
;; no backslash or slash - shouldnt matter
x))))
(define old-load load)
(set! load (lambda (path)
(old-load (maybe-translate-pathname path "schoppenhauer"))))
Sorry for my bad english.
Visit my blog http://blog.uxul.de/
Visit my blog http://blog.uxul.de/