getting shen + slime working

198 views
Skip to first unread message

Ensio

unread,
Nov 12, 2011, 6:17:16 AM11/12/11
to Qilang
I am following the instructions here:

http://groups.google.com/group/qilang/msg/88f4f087945ea40a

Upon running M-x qi, I get

READ from #<INPUT STRING-INPUT-STREAM>: there is no package with name
"SWANK"

This is with Shen 2.0 compiled with darwin/clisp-2.49. I double-
checked that .clisprc is loading swank and that regular (non-shenned)
clisp works with slime. Yes to both.

Having no other ideas, I decided to delete .clisprc and generate a new
shen image that includes swank via adding code to install.lsp. This
fixes the missing swank problem, and as before I have a working
*inferior-lisp* buffer with the shen prompt. So far so good.

However evaling (+ 1 1) with (slime-eval-last-expression) produces
minibuffer output that looks like

; pipelined request... (swank:interactive-eval "(+ 1 1)")

There appears to be no error. *slime-events* shows

(:emacs-rex
(swank:interactive-eval "(+ 1 1)")
"COMMON-LISP-USER" t 7)

I compiled shen myself because the shen executable in Shen.dmg (MD5 =
fe03e704ced039c35b59961eb9ee2e62) fails with "dyld: unknown required
load command 0x80000022 Trace/BPT trap". This is OS X 10.5.8.

How do people even use shen without slime? I can't imagine pasting
into the repl, even when the repl an emacs buffer. Giving a .shen file
at the command line does not work, nor does --load or -l or -i work
with a shen file.

I also don't see how to exit shen.

(0-) (quit)
EVAL: undefined function quit

(1-) (bye)
EVAL: undefined function bye

(2-) (exit)
EVAL: undefined function exit

(3-) ^D
(3-) READ: input stream #<IO SYNONYM-STREAM *TERMINAL-IO*> has reached
its end
(3-) READ: input stream #<IO SYNONYM-STREAM *TERMINAL-IO*> has reached
its end
(3-) READ: input stream #<IO SYNONYM-STREAM *TERMINAL-IO*> has reached
its end
(3-) READ: input stream #<IO SYNONYM-STREAM *TERMINAL-IO*> has reached
its end
[... etc ... to infinity and beyond]

deech

unread,
Nov 12, 2011, 9:44:14 AM11/12/11
to qil...@googlegroups.com
Try (QUIT).
-deech

Bruno Deferrari

unread,
Nov 12, 2011, 9:56:21 AM11/12/11
to qil...@googlegroups.com

To exit the REPL use (BYE) or (QUIT), in uppercase.

> --
> You received this message because you are subscribed to the Google Groups "Qilang" group.
> To post to this group, send email to qil...@googlegroups.com.
> To unsubscribe from this group, send email to qilang+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/qilang?hl=en.
>
>

--
BD

Ensio

unread,
Nov 13, 2011, 11:47:59 AM11/13/11
to Qilang
Despite other random attempts at fixing this, I still get

; pipelined request... (swank:interactive-eval "(+ 1 1)")

instead of "2" when evaluating (+ 1 1) with (slime-eval-last-
expression).

On a whim I decided to try SBCL, even though I am on a Mac. This
almost works. I can evaluate (+ 1 1) to obtain 2. And I can evaluate

(DEFUN hello ()
"hello world")

after which (hello) evaluates to "hello world". Almost there.

The problem is in evaluating Shen code. Using (slime-eval-last-
expression) with

(define total
[] -> 0
[X | Y] -> (+ X (total Y)))

produces the error

end of file on #<SB-IMPL::STRING-INPUT-STREAM {10035F0B23}>
[Condition of type END-OF-FILE]

It seems "define" itself is a problem since I can evaluate (@p 1 2) to
get "#(shen-tuple 1 2)".

My guess is that there is some emacs scanning problem with the
"define" syntax. Regular emacs lisp-mode thinks the above "define"
form has unbalanced parens.

Any ideas? Anyone using shen + slime?

Eric Schulte

unread,
Nov 13, 2011, 2:33:38 PM11/13/11
to qil...@googlegroups.com
Maybe inf-shen is an acceptable alternative to slime?
(see https://github.com/eschulte/shen-mode)

Soon this functionality will be available in the GNU ELPA.

Best -- Eric

Ensio <ensio...@yahoo.com> writes:

--
Eric Schulte
http://cs.unm.edu/~eschulte/

Ensio

unread,
Nov 15, 2011, 2:33:47 AM11/15/11
to Qilang, Eric Schulte
On Nov 13, 2:33 pm, Eric Schulte <schult...@gmail.com> wrote:
> Maybe inf-shen is an acceptable alternative to slime?

Not in my case. I was looking into using Shen to implement a
specialized part of my Hunchentoot server.

I am left wondering to what degree Lisp interoperability is intended
in Shen, if at all. The fact that Shen is being ported to Javascript
shouldn't stop Lisp-based Shen from being useful to lispers (or should
it?).

Shen still depends on Lisp for QUIT/BYE (and possibly other things, I
don't know). If Lisp is being thrown out, shouldn't Shen have an
idiomatic way to exit?

BTW, it's weird that I continue to be moderated on this list after my
first post.

vasil

unread,
Nov 15, 2011, 4:57:49 AM11/15/11
to qil...@googlegroups.com
> I am left wondering to what degree Lisp interoperability is intended
> in Shen, if at all. The fact that Shen is being ported to Javascript
> shouldn't stop Lisp-based Shen from being useful to lispers (or should
> it?).

The first aim of core Shen developers is to support various platforms in
breadth, and the second aim to support them in depth (platform-specific
optimizations, support for platform-dependent development tools, like
SLIME+SWANK).

You may contribute to project by writing code for support SLIME in Shen/CL.

> Shen still depends on Lisp for QUIT/BYE (and possibly other things, I
> don't know). If Lisp is being thrown out, shouldn't Shen have an
> idiomatic way to exit?

Good question. I think that command for exiting from Shen should be
similar for all platforms, this may be added via libraries.


Eric Schulte

unread,
Nov 15, 2011, 9:43:25 AM11/15/11
to qil...@googlegroups.com
>> Shen still depends on Lisp for QUIT/BYE (and possibly other things, I
>> don't know). If Lisp is being thrown out, shouldn't Shen have an
>> idiomatic way to exit?
>
> Good question. I think that command for exiting from Shen should be
> similar for all platforms, this may be added via libraries.

Is a REPL part of the Shen spec and similarly will Shen have a REPL on
all platforms? It is not clear to me how Shen over Javascript or say
LLVM could support a REPL.

Mark Tarver

unread,
Nov 15, 2011, 11:52:46 AM11/15/11
to Qilang
Shendoc 2.0 states (as have all versions since release in September
2011)

This standard .... is described in the latest Shen doc document.
Essentially the standard is exactly that of Qi in 'Functional
Programming in Qi' (second edition) modulo the changes described in
that document [currently 2.0].

So the answer is 'yes', working from 2.0, Shen should have a REPL
since the REPL is introduced at the beginning of the second chapter of
FPQi.

http://www.lambdassociates.org/Book/page038.htm

Regarding Javascript, I am not privileged to comment because I am not
working on it. However I have seen REPL in Javascript and used one;
here is an example

http://einaregilsson.com/repl.html

Mark

SteveN

unread,
Mar 4, 2012, 10:37:19 PM3/4/12
to qil...@googlegroups.com
Dragging up an old thread, I'd like to 'request' (since, at the moment, implementation is beyond me) this. Although I can understand the desire for a breadth first implementation, there is some merit into having at least one branch lead in depth, especially if a set of useful shen libraries are to be developed, since a good development environment will be needed for this, and SLIME is probably be best of those (for the people that will likely be contributing).

    - SteveN
Reply all
Reply to author
Forward
0 new messages