This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-10
Channels
- # adventofcode (99)
- # architecture (10)
- # bangalore-clj (1)
- # beginners (65)
- # boot (9)
- # cider (78)
- # clojure (87)
- # clojure-austin (1)
- # clojure-brasil (13)
- # clojure-dev (14)
- # clojure-gamedev (3)
- # clojure-greece (2)
- # clojure-italy (2)
- # clojure-russia (18)
- # clojure-spec (26)
- # clojure-uk (15)
- # clojurescript (62)
- # core-logic (1)
- # cursive (1)
- # datomic (27)
- # emacs (17)
- # fulcro (2)
- # off-topic (44)
- # onyx (25)
- # perun (139)
- # re-frame (40)
- # reitit (2)
- # ring (4)
- # rum (2)
- # shadow-cljs (1)
- # slack-help (14)
- # unrepl (18)
@dominicm Fair enough. It’s good to know things like these. Often my perspective is shaped primarily by my own usage of certain things.
I see that it's a goal, but I'm looking for details as to what would be required to do so, where to get started. The FAQ is (understandably) pretty brief.
http://cider.readthedocs.io/en/latest/faq/#will-cider-eventually-support-the-clojure-18-socket-repl
@grzm There’s just a plan at this point, as I have almost no time to work on CIDER these days and we really need someone else to tackle this if it’s to happen any time soon. The steps are relatively clear:
* implement some elisp client library for the socket repl
* abstract away the nREPL specifics from CIDER’s main API
* extract from cider-nrepl
the core functionality as some standalone library that can be used directly via evaluation (as that’s the approach the socket repl takes for tooling stuff)
None of this is particularly complex, but it’s certainly a lot of work, especially the second point.
I can go into more details regarding this if needed. I guess the most simple way to explain things would be the following - we need an equivalent of nrepl-client.el
for the socket repl and all commands in CIDER should take the connection type into account (nREPL or socket repl) when they determine what exactly to invoke - some nREPL middleware op or just eval something over the socket repl connection.
thanks for taking the time for typing this out. Would it make sense to start a wiki page or something on this?
@grzm I think the best way to do this is with unrepl. Classes can be hotloaded, and unrepl injects a structured api on top of socket repl. The missing part is cider as a client library rather than as nrepl middleware. But I don't think it would be impossible to use without right now anyway.
@grzm fwiw, I have interest in using cider with unrepl, so would be interested in helping with a cider nrepl standalone client.
Obviously after things are decoupled from nREPL adding support for new clients would become significantly easier. Whether the first is the socket repl or unrepl doesn’t make much of a difference.
> thanks for taking the time for typing this out. Would it make sense to start a wiki page or something on this? @grzm I’d start a GitHub issue. 🙂
> The missing part is cider as a client library rather than as nrepl middleware. But I don’t think it would be impossible to use without right now anyway. Yep, eventually there should a be a CIDER library that’s completely independent from any communication protocol. It’d be wrapped by middleware for nREPL, and by whatever’s appropriate by other “adapters”.
@bozhidar just to be clear, unrepl is quite unlike nrepl in that it's not expected that you will be running any more than a socket repl. Unrepl bootstraps itself into a socket repl, using a "blob" that would be provided by CIDER.el. So if CIDER wants to support socket repl, using unrepl would be a convenient route.
I was mostly alluding to the fact that supporting socket REPL connections by itself doesn’t solve the problem of how to leverage them directly. In particular: * You can just do eval on one socket connection for all “tooling” operations (e.g. completion, var resolution whatever) or two can have two connections (one for user eval, the other for tooling eval) * How do you do session management - in nREPL this is built-in and you can have many sessions per one connection. Do you even what to do session management for socket repl connections? * How do you determine the repl’s tooling capabilities? In nREPL you can query the connection for the ops that it supports, what do they return etc. For the socket repl I guess you can check whether certain namespaces are present and eval stuff or we can add some simple abstraction on top of this.
hi! I used to be able to connect to my servers with ssh fallback using cider-known-endpoints. I’ve recently completely updated everything and I’m now getting this error for my remote machines Bad local forwarding specification 'nil:localhost:nil'
emacs version 27.0.50
cider version 0.16.0snapshot
You might want to check out this http://cider.readthedocs.io/en/latest/troubleshooting/
@bozhidar apologies i have no experience with elisp, so not too sure what to provide. I did attempt to evaluate format-spec independently using the commands passed in when I use cider-connect and I get this backtrace
Debugger entered--Lisp error: (void-variable host)
(cons 104 host)
(list (cons 115 ssh) (cons 112 port) (cons 104 host) (cons 117 (if user (format "-l '%s' " user) "")))
(format-spec "%s -v -N -L %p:localhost:%p %u'%h'" (list (cons 115 ssh) (cons 112 port) (cons 104 host) (cons 117 (if user (format "-l '%s' " user) ""))))
nrepl--ssh-tunnel-command("/usr/bin/ssh" "/ssh:[email protected]:" "7888")
eval((nrepl--ssh-tunnel-command "/usr/bin/ssh" "/ssh:[email protected]:" "7888") nil)
elisp--eval-last-sexp(nil)
#f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d3665>)(nil)
ad-Advice-eval-last-sexp(#f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d3665>) nil)
apply(ad-Advice-eval-last-sexp #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. With a prefix argument of zero,\nhowever, there is no such truncation. Such a prefix argument\nalso causes integers to be printed in several additional formats\n(octal, hexadecimal, and character when the prefix argument is\n-1 or the integer is `eval-expression-print-maximum-character' or\nless).\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x400d3665>) nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
removing the undefined variables, (nrepl--ssh-tunnel-command "/usr/bin/ssh" "/ssh:[email protected]:" "7888")
evaluates to this "/usr/bin/ssh -v -N -L nil:localhost:nil''"
and so that’s the error i’m getting in the nrepl-tunnel buffer — Bad local forwarding specification 'nil:localhost:nil'
ignore what i said about format-spec… the function (nrepl--ssh-tunnel-command)
as it appears on master evaluates to this "/usr/bin/ssh -v -N -L nil:localhost:nil -l 'root' '
i reckon because of format-spec though 🙂 i’ll open up my other laptop and test what it evaluates to in awhile
it seems right now you evaluated some piece of code with a missing variable in in - Debugger entered--Lisp error: (void-variable host)
"it can’t find namespaces whenever I evaluate some piece of code"
@dominicm I’ve noticed that someone recently started a project similar to CIDER in nature, but targeting unrepl - https://github.com/Unrepl/unrepl.el While I would have loved it if this person worked instead on adding this support to CIDER directly, it seems that now the client library for the socket repl is a solved problem. 😉
I'm hoping that it will lay a good groundwork, the following step is entirely to get CIDER into a good shape for use as a library
Time will tell. I’m cautiously optimistic about the future of Clojure dev tools. As usual. 🙂
Hi everyone. I’m having trouble getting cider to work with cljs app (re-frame template app specifically) to work properly.
I do a fresh lein new re-frame someapp
and then I do jack-in-clojurescript
. Then, in any cljs file I type (+ 1 2)
and hit C-c C-c
to evaluate the line. It usually takes about 10 seconds to ‘think’ and then comes back with a time out message.
After a few retries, it works but then as soon as it evaluates, cljs loses ‘connection’ to nREPL it seems. Because next time I try to evaluate something, even though cider buffer is till open, it says that I need to connect to nREPL for it to work..
I personally am interested in using unrepl with cider-nrepl. So I will likely solve that part, even if someone else doesn't.
@bozhidar i looked up the docs on tramp filename and fixed it by adding a #(port-num)
after the domain, so my cider-known-endpoints has an entry that looks like this: ("staging" "
@naomarikInteresting. I guess they changed this recently, as this is the first time I hear of this.
> I do a fresh lein new re-frame someapp
and then I do jack-in-clojurescript
. Then, in any cljs file I type (+ 1 2)
and hit C-c C-c
to evaluate the line. It usually takes about 10 seconds to ‘think’ and then comes back with a time out message.
@bravilogy http://cider.readthedocs.io/en/latest/troubleshooting/ take a look here at the part about nREPL message logging and see what happens there.
> @bozhidar understandable. I often find myself nodding along to your rants talks.
😄 That remark made my laugh. I guess I’m a pretty negative person when it comes to this. 😄
> I personally am interested in using unrepl with cider-nrepl. So I will likely solve that part, even if someone else doesn’t. (edited)
Happy to hear this.
Today was the first day in a long time I actually sat down to do some CIDER work. ClojureX put me in the right frame of mind for this. 🙂
@bozhidar As you're about today, I'm working on the new resources list op, and I'm considering what to call it. I've called it "resources-list2" for now. I see 2 options:
resources-list-XXX where someone has a good idea for XXX
resources-list gains an option flag like more
which sends you back a dictionary.
Although, appealing to authority. Halloway has mentioned that sometimes the best name is foo2 😄
@bozhidar I appreciate having you around more today 🙂 It would be nice to see you more often!
hi all! I’m looking into a gofmt in go-mode and refmt in reason-mode like cider-format experience. go-mode suggests to reformat the buffer in the on-before-save
hook. the problem I have with cider-format-buffer is that the point position is lost after reformatting, which make it not really fitting to use in that hook, which is kinda annoying. wondering how gofmt solved this, was a bit surprising but also interesting: they make a diff between the orig and the reformatted buffer, then apply the diff line by line, making emacs not loose the cursor position: https://github.com/dominikh/go-mode.el/blob/7eb5b3dd0ac31d176e9d56da4172f66aef8fae47/go-mode.el#L1064
any thoughts on this? is this the way to go to make cider-format-buffer not lose the point position?
@kommen Just file a ticket and I’ll fixed this. All it needs is one save-excursion
call to the current command which anyone can basically add.
@dominicm Why not simply replace the existing op? I doubt anyone would complain if they got something better. 🙂
> @bozhidar I appreciate having you around more today 🙂 It would be nice to see you more often!
@bozhidar ok, will file an issue. I tried wrapping cider-format-buffer in a save-excursion though and had no luck though
@bozhidar are there any other nrepl clients to be aware of? I just scanned fireplace & saw no use of this particular op (it looks like fireplace scans based on the path returned from the classpath op, ew)
Not to my knowledge. It’s definitely not some fundamental feature, so I’m fine with breaking it. There’s a reason why I’m avoiding that magic version 1.0. 😉
Okay, great. Hopefully this will let you reduce the resource list down to a single op as well.
Unrepl is cool, still a long road ahead for it to be adopted though. For example it is Clojure only for now. Including unrepl.el in cider would also mean change the way the middleware add-ons + nRepl protocol, adopting the new unrepl protocol...for sure doable, which is a good thing...
@bozhidar I've left a steaming pile of PR on your doorstep. Enjoy 😄 I think things are nominally better after the changes than they were before.
thanks for improving the class path splitting, by the way. I picked that up from code in refactor-nrepl without looking up the appropriate way to do it.
@grzm that's okay. It was mostly the test that was broken, it was expecting two items in the path, but only adding one.
I only realised the path separator is defined somewhere when I started reading the documentation.