Some explanations on how LT works needed

261 views
Skip to first unread message

Igor Baryshnikov

unread,
Apr 27, 2015, 4:19:45 PM4/27/15
to light-table...@googlegroups.com
Hi all !

A short time ago I dove into Clojure development and I am trying to understand what’s under its and LightTable’s hood. I have three questions for now.
Q1. What is the meaning of “Connecting”? This phase sometimes takes a while.
Q2. What is called a Connection? What do “disconnect” and “unset” buttons on the Connections tabs do?
Q3. What is the meaning of “Retrieving deps”? I guess, it may be related to dependencies set in project.clj (generated with lein).
I would be very pleased to read some clarifications on the questions. Or to get a relevant link, if my questions are newbie enough to be answered already somewhere. Though, I could’t find one.

Thanks in advance,
Igor.

Magnus Rundberget

unread,
Apr 29, 2015, 12:37:30 PM4/29/15
to light-table...@googlegroups.com
For lighttable to be able to evaluate clojure code etc it needs to connect to a repl (nrepl). You can do this explicitly using the connect bar functionality, or if if you try to eval a file without connecting Lt will try to find a lein project.clj file.

The connecting message is shown when the clojjure lt plugin initiates the process of connecting to a nrepl. Starting an nrepl takes some time (using lein which starts a jvm, loads all clojure core stuff etc). If all deps aren't cached locally then those needs to be retrieved as well increasing the time to connect.

As soon as lt receives something from std out it will check if that contains a string that indicates that the repl is fully started then it will print a message telling you the project is connected, if not it will print "retrieving deps". The message retrieving deps is not necessarily what happens though it might be (because lein will print to out when retrieving deps), but it could be any message printed to out from lein.

In the connect bar you have an overview of all clojure projects you have connected to (a repl). If you disconnect, you disconnect from the repl process (and that is duely terminated).

Since you may have multiple clojure projects in you workspace Lt needs to know which editor is related to which editor. When you have a clojure file open and show the connect bar, the unset button indicates that the editor is connected to that particular project connection. Clicking unset will remove the link. If you then eval something in that file Lt will either automatically make the connection link for you or prompt you (typically when you have multiple clojure repls connected)

Hope this helps a little !


Cheers
Magnus

Magnus Rundberget

unread,
Apr 29, 2015, 12:46:25 PM4/29/15
to light-table...@googlegroups.com

Zubair Quraishi

unread,
Apr 30, 2015, 3:28:52 AM4/30/15
to light-table...@googlegroups.com
Please be warned though, that Light Table does not work with the latest version of Clojurescript


On Monday, 27 April 2015 22:19:45 UTC+2, Igor Baryshnikov wrote:

Igor Baryshnikov

unread,
May 4, 2015, 1:13:17 PM5/4/15
to light-table...@googlegroups.com
Many thanks! I’ve learnt much new digging into nrepl and LT. The link was useful, too, though the sources look a little complicated to me (mostly because of that bunch of requires).
I have another question. Sometimes I run a code that hangs. And the square in the bottom left corner of the screen starts running its animation (endlessly). And doesn’t stop when I hit ‘disconnect’ button. That seems to be considered a bug, doesn’t it? (as of LT v0.7.2)
Reply all
Reply to author
Forward
0 new messages