Deprecation of Swank Clojure, long live nrepl.el

2,050 views
Skip to first unread message

Phil Hagelberg

unread,
Aug 22, 2012, 1:40:52 AM8/22/12
to swank-...@googlegroups.com, clo...@googlegroups.com

As I mentioned in an earlier thread, I'm bringing my maintainership of
swank-clojure to an end. I'm putting my efforts into nrepl.el, and there
is also ritz for people who need advanced debugging:

https://github.com/kingtim/nrepl.el

https://github.com/pallet/ritz

I've blogged about some of the background behind this decision here:

http://technomancy.us/163

I've pushed a deprecation notice to the swank-clojure repository now
that the latest release of nrepl.el has become quite usable. I'll be
following up by updating various pieces of documentation around the web;
if you have a blog post or tutorial that mentions swank-clojure, please
add an addendum pointing people to nrepl.el or ritz.

Thanks for being loyal users, and please do give nrepl.el a try.

-Phil

Warren Lynn

unread,
Aug 22, 2012, 10:56:29 AM8/22/12
to clo...@googlegroups.com, swank-...@googlegroups.com

I just gave a quick try on nrepl. It works right out of the box (at least the basics I tried) with jack-in. Thank you.

Now I have two questions:

1. I did not not "ritz" before this post. Its debugging capabilities is attractive to me (I have not tried it yet). Is there any plan to have those capabilities in nREPL too?
2. Right now I use "slime-completions" function with auto-complete.el so I have automatic completion working. I am very attached to auto-complete as that is a big helper on my coding efficiency. I know there is "nrepl-complete" command, but is there a function that will return all the completions for a prefix so I can use that with auto-complete? I could not find it.

Great to see the tool chain is moving forward. Thank you.


Tim King

unread,
Aug 22, 2012, 12:46:48 PM8/22/12
to swank-...@googlegroups.com, clo...@googlegroups.com

On Wed, Aug 22, 2012 at 7:56 AM, Warren Lynn <wrn....@gmail.com> wrote:

2. Right now I use "slime-completions" function with auto-complete.el so I have automatic completion working. I am very attached to auto-complete as that is a big helper on my coding efficiency. I know there is "nrepl-complete" command, but is there a function that will return all the completions for a prefix so I can use that with auto-complete? I could not find it.
 
Hi Warren,

You may want to check out  https://github.com/purcell/ac-nrepl.

Cheers,
Tim

Baishampayan Ghose

unread,
Aug 22, 2012, 12:56:57 PM8/22/12
to clo...@googlegroups.com
> Thanks for being loyal users, and please do give nrepl.el a try.

I gave nrepl.el a shot today and I was quite impressed to say the least.

There were a couple of minor annoyances though -

* M-. on a JVM inter-op call throws an exception. This should be
handled gracefully.
* When using M-x nrepl, I can't specify a host, so it always picks localhost
* M-x repl should show me the default host/port automatically (does
nREPL have a default port at all?)
* There is no way to disconnect (or at least I couldn't find one)
* Backspace with paredit is broken

I am quite liking the way nREPL & nrepl.el are progressing, I think I
will be able to switch quite soon.

Kudos to Tim, Phil, Chas and everyone involved!

Regards,
BG

--
Baishampayan Ghose
b.ghose at gmail.com

Chas Emerick

unread,
Aug 22, 2012, 2:26:43 PM8/22/12
to clo...@googlegroups.com
On Aug 22, 2012, at 12:56 PM, Baishampayan Ghose wrote:

> * M-x repl should show me the default host/port automatically (does
> nREPL have a default port at all?)

No, nREPL does not yet have a default port, but it's a known TODO item:

http://dev.clojure.org/jira/browse/NREPL-3

I suppose I should put the application into IANA sooner rather than later...

- Chas

Baishampayan Ghose

unread,
Aug 22, 2012, 2:30:54 PM8/22/12
to clo...@googlegroups.com
On Wed, Aug 22, 2012 at 11:56 PM, Chas Emerick <ch...@cemerick.com> wrote:
>> * M-x repl should show me the default host/port automatically (does
>> nREPL have a default port at all?)
>
> No, nREPL does not yet have a default port, but it's a known TODO item:
>
> http://dev.clojure.org/jira/browse/NREPL-3
>
> I suppose I should put the application into IANA sooner rather than later...

Pick 7888 right-away and standardize later...

Chas Emerick

unread,
Aug 22, 2012, 3:09:42 PM8/22/12
to clo...@googlegroups.com
On Aug 22, 2012, at 2:30 PM, Baishampayan Ghose wrote:

>>> * M-x repl should show me the default host/port automatically (does
>>> nREPL have a default port at all?)
>>
>> No, nREPL does not yet have a default port, but it's a known TODO item:
>>
>> http://dev.clojure.org/jira/browse/NREPL-3
>>
>> I suppose I should put the application into IANA sooner rather than later...
>
> Pick 7888 right-away and standardize later...

Maybe this is a case where I should ask for forgiveness later, but I was trying to stay on the good side of the last bullet here:

http://www.iana.org/form/ports-services

Anyone with experience with IANA, standardization of ports, etc., please feel free to contact me off list with any pointers on smoothing the way in this area.

- Chas

Tassilo Horn

unread,
Aug 22, 2012, 3:19:12 PM8/22/12
to clo...@googlegroups.com
Baishampayan Ghose <b.g...@gmail.com> writes:

> * Backspace with paredit is broken

That's fixed in a pull request of mine which also implements a major
overhaul of the completion mechanism.

Bye,
Tassilo

Warren Lynn

unread,
Aug 22, 2012, 5:52:47 PM8/22/12
to clo...@googlegroups.com, swank-...@googlegroups.com


Hi Warren,

You may want to check out  https://github.com/purcell/ac-nrepl.

Cheers,
Tim


Thank you. I tried it out. It basically works but has glitches:

1. If I type "(clojure.repl/", right after the forward slash, I got a exception "java.lang.ClassNotFoundException: clojure.repl" (followed by a long stack trace). This is close to a deal breaker for me.

2. The pop-up documentation does not work right. Lines are missing (but those lines will show up again if I resize my Emacs window to force a redraw). I am on Windows so that could be a factor, but my auto-complete pop-up documentation for my Elisp code has no problem.



Leonardo Borges

unread,
Aug 22, 2012, 10:03:07 PM8/22/12
to clo...@googlegroups.com, swank-...@googlegroups.com
I must be missing something here. I followed the steps on the
leiningen upgrade wiki page and everything seemed fine.

However, even thought my project has an explicit dependency on Clojure
1.4.0, lein repl is starting a session with Clojure 1.2.1

Can't really see where I've gone wrong. Does this ring a bell to anyone?

Cheers,
Leonardo Borges
www.leonardoborges.com
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

Leonardo Borges

unread,
Aug 22, 2012, 11:06:00 PM8/22/12
to clo...@googlegroups.com
Moreover, not only it starts an old version of Clojure, but it
randomly picks a clojure version each time I start the repl (?!) from
within the same project directory

$ lein repl
nREPL server started on port 7888
REPL-y 0.1.0-beta10
Clojure 1.3.0


$ lein repl
nREPL server started on port 7888
REPL-y 0.1.0-beta10
Clojure 1.2.1

$ lein repl
nREPL server started on port 7888
REPL-y 0.1.0-beta10
Clojure 1.3.0

Absolutely no clue. I even removed all Clojure versions from ~/.m2
just in case that was messing up something but no help.

And I do have Clojure 1.4.0 listed in my project.clj:

(defproject blah/blah "1.0.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.4.0"]
...

Cheers,
Leonardo Borges
www.leonardoborges.com

Leonardo Borges

unread,
Aug 23, 2012, 12:53:18 AM8/23/12
to clo...@googlegroups.com
Nevermind. I used lein deps :tree to analyze my current dependency
tree an realized korma depended on Clojure 1.3.0 - why lein was
loading 1.2.1 sometimes is still beyond me.

I upgraded Korma and lein repl now respects my preference for clojure 1.4.0

All is well in the world. Sorry for the noise.

Cheers,
Leonardo Borges
www.leonardoborges.com


On Thu, Aug 23, 2012 at 1:06 PM, Leonardo Borges

Warren Lynn

unread,
Aug 23, 2012, 10:59:21 AM8/23/12
to clo...@googlegroups.com, swank-...@googlegroups.com

Does anyone know how to let lein2 to use the latest nrepl server (beta9 for now). It seems right now (preview8) it is using beta8. I am eager to find out if beta9 fixed the ac-nrepl exception on namespace completion (according to ac-nrepl issue tracking, that is caused by the server). Thank you.

Chas Emerick

unread,
Aug 23, 2012, 11:19:32 AM8/23/12
to clo...@googlegroups.com, swank-...@googlegroups.com
Just adding [org.clojure/tools.nrepl "0.2.0-beta9"] to your project dependencies should do it.

Can you point me to this ac-nrepl issue that may be server-related?

- Chas

On Aug 23, 2012, at 10:59 AM, Warren Lynn wrote:


Does anyone know how to let lein2 to use the latest nrepl server (beta9 for now). It seems right now (preview8) it is using beta8. I am eager to find out if beta9 fixed the ac-nrepl exception on namespace completion (according to ac-nrepl issue tracking, that is caused by the server). Thank you.

Tim King

unread,
Aug 23, 2012, 11:38:16 AM8/23/12
to clo...@googlegroups.com, swank-...@googlegroups.com
On Thu, Aug 23, 2012 at 8:19 AM, Chas Emerick <ch...@cemerick.com> wrote:
Just adding [org.clojure/tools.nrepl "0.2.0-beta9"] to your project dependencies should do it.

Can you point me to this ac-nrepl issue that may be server-related?

- Chas

I don't think it is nREPL server related.  It has to do with with clojure.complete and lein repl. 


-Tim

Warren Lynn

unread,
Aug 23, 2012, 3:34:50 PM8/23/12
to clo...@googlegroups.com, swank-...@googlegroups.com

I don't think it is nREPL server related.  It has to do with with clojure.complete and lein repl. 

Thanks. I did not understand it correctly. I will wait for lein to be updated.


 

Warren Lynn

unread,
Aug 27, 2012, 2:23:49 PM8/27/12
to clo...@googlegroups.com, swank-...@googlegroups.com

With lein2 preview 10, the ac-nrepl namespace completion issue is still there.  I am talking about this one:
https://github.com/purcell/ac-nrepl/issues/1

But if I do this in a regular "lein repl" shell:
(complete.core/completions "clojure.set/")
everything works fine. I can see all the completions.

But if I do the same in an Emacs nrepl buffer, I got the exception as described in the ac-nrepl issue. So it does seems nrepl related. Can someone explain why? Thank you.

I am using lein2 preview 10, and nrepl.el 0.1.4 preview


Tim King

unread,
Aug 27, 2012, 2:56:44 PM8/27/12
to clo...@googlegroups.com, swank-...@googlegroups.com


But if I do the same in an Emacs nrepl buffer, I got the exception as described in the ac-nrepl issue. So it does seems nrepl related. Can someone explain why? Thank you.

I am using lein2 preview 10, and nrepl.el 0.1.4 preview

Hi Warren,
I added an explanation to the issue you referenced above.

Cheers,
Tim

Warren Lynn

unread,
Aug 28, 2012, 11:48:26 AM8/28/12
to clo...@googlegroups.com, swank-...@googlegroups.com


With Tim's pointer, I worked around the completion exception on namespace by redefining the resolve-class. However, there is still another problem:

If my cursor stops at the end of a namespace without any slash, like this "(clojure.set", I got an exception again. This time, the exception is thrown because
(doc clojure.set)
will throw an exception (auto complete is trying to pull out its documentation in a pop up window).

(doc clojure.set) won't even work in a regular "lein repl" shell. If we don't yet have the concept namespace doc string in Clojure, I thought it should return nil instead of throwing an exception. Is that a known issue/bug? If yes, will it be fixed in the next release of Clojure? Any workaround (except for totally disable the auto-complete popup documentation)? Thank you.


Andy Fingerhut

unread,
Aug 28, 2012, 10:14:32 PM8/28/12
to clo...@googlegroups.com, swank-...@googlegroups.com
The issue with an exception when trying to find the doc of a namespace is a known issue, and should be fixed in Clojure 1.5 when it is released:

http://dev.clojure.org/jira/browse/CLJ-902

You could try out clojure-1.5.0-alpha4 to see if it fixes the problem for you, if that happens to be convenient for you to try.

Andy
Reply all
Reply to author
Forward
0 new messages