Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-06-03 Thread Phillip Lord
That looks really very nice. The reader macros are particularly nice because it saves messing around with the structure of your code. Phil dgrnbrg writes: > I'd like to point out a similar library I wrote for Clojure called > spyscope: https://github.com/dgrnbrg/spyscope > > With spyscope, yo

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-31 Thread David Jacobs
Very cool, will have to try it out! That said, I think we should start talking about how to make the traditional debugging cycle accessible in Clojure. On Friday, May 31, 2013 at 8:27 AM, dgrnbrg wrote: > I'd like to point out a similar library I wrote for Clojure called spyscope: > https:/

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-31 Thread dgrnbrg
I'd like to point out a similar library I wrote for Clojure called spyscope: https://github.com/dgrnbrg/spyscope With spyscope, you can write a handful of characters and get the stack frame, form, and its value pretty-printed and logged to a queue for future querying. On Thursday, May 30, 2013

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-30 Thread David Jacobs
That's true -- that's why I wrote up the Letters debugging mini-library for Ruby (lettersrb.com). However, there's friction there, too, and a surprising number of people don't think to do this. On Thursday, May 30, 2013 at 5:25 PM, Timothy Baldridge wrote: > Not really true, most of my progr

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-30 Thread Timothy Baldridge
Not really true, most of my programs contain this function: (defn debug [x] (pprint x) x) Now I can do this: (comp foo debug bar) Also, with some reader literal magic, I could write something to let me do this: (myfunc foo #dbg bar) On Thu, May 30, 2013 at 6:12 PM, David Jacobs wrote:

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-30 Thread David Jacobs
Two more things: 1) printing is often not a viable option for lazily eval-ed sequences or async processes -- the output gets jumbled! And believe me, when a new Clojure dev sees that for the first time, he/she wants to quit. 2) printing is terrible for elegant clojure code -- thing (comp f g h

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-30 Thread Raoul Duke
for a long time haskell did not have a debugger. that sucked, imho. -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient wi

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-30 Thread David Jacobs
I'm just catching up on this discussion. I think that, regardless of whether any one coder uses them, debuggers are useful to a large subset of people. Even though Clojure likes us to be immutable, there are often times where we would like to debug the mutable parts of our code with something b

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-29 Thread Ben Mabey
On Wed May 29 09:18:10 2013, Softaddicts wrote: The REPL is a better alternative than a debugger. No REPL available = increase need for a debugger. If you write creepy code in the REPL, you would do the same in a text editor and then end up debugging it in the debugger... with the old fail/edi

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-29 Thread Softaddicts
The REPL is a better alternative than a debugger. No REPL available = increase need for a debugger. If you write creepy code in the REPL, you would do the same in a text editor and then end up debugging it in the debugger... with the old fail/edit/build/break to point of failure cycle. It's

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-29 Thread Warren Lynn
I did not say that a debugger was not useful at all, I said that the > importance of having a > debugger is *overestimated* especially in an immutable world. > > Relying on a debugger as an important tool to support coding is like > admitting > the failure of your code before it runs. It's l

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-29 Thread xumingmingv
+1 On 2013-5-29, at 上午2:23, Warren Lynn wrote: > > Still miss the Elisp debugger, which is great. It's right there, in your > editing environment. It's good for debugging my own code. It's really > good for working out someone elses code. I wish I debug clojure in the > same way. It's not ess

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-29 Thread Phillip Lord
Warren Lynn writes: >> Still miss the Elisp debugger, which is great. It's right there, in your >> editing environment. It's good for debugging my own code. It's really >> good for working out someone elses code. I wish I debug clojure in the >> same way. It's not essential, of course. But nic

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread u1204
One technique I've used in the past for debugging is to open a UDP port as a log stream and print messages to that stream. These messages can be read at any time by a telnet connection to that port. Since UDP packets that are not read just get dropped this is equivalent to writing to /dev/null exc

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
A couple more replies to comments on this thread: On May 28, 2013, at 5:50 PM, Cedric Greevey wrote: > > Clojure just doesn't make what he asked for easy, by its nature. Designing to > minimize difficulty with reproducing any observed behavior seems to be > indicated (and desirable for other r

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 5:10 PM, Alan Malloy wrote: > > The principal problem of disabling locals-clearing is not "slowing things > down", but rather causing perfectly reasonable code to consume unbounded > memory. For example, consider: ((fn [xs] (nth xs 1e8)) (range)). With locals > clearing, th

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Sean Corfield
On Tue, May 28, 2013 at 1:35 PM, Softaddicts wrote: > I came to the same conclusion as Stuart after 30+ years of coding in various > languages/assemblers and architectures. Interesting thread and I find myself in agreement with Luc here. I've been programming commercially for about 30 years and I

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Cedric Greevey
And, of course, Engelberg's objection then applies again: you have to have the bug, disable locals clearing, and then try to reproduce the bug again in order to have the otherwise-cleared locals available in the debug session. Clojure just doesn't make what he asked for easy, by its nature. Design

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Alan Malloy
On Tuesday, May 28, 2013 1:01:46 PM UTC-7, Ben Mabey wrote: > On 5/28/13 1:05 PM, Lee Spector wrote: > > On May 28, 2013, at 2:40 PM, Ben Mabey wrote: > > The flag is a system property: > "-Dclojure.compiler.disable-locals-clearing=true". So you can add that > string to your project.clj's :

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 4:01 PM, Ben Mabey wrote: > > To do this I have been using nrepl-ritz's 'M-x > nrepl-ritz-break-on-exception'. If you are using emacs and haven't looked > into ritz I would highly encourage taking the time to do so. It is painless > to install these days and you can watch

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Softaddicts
I maintain the strategies summarized by Stuart are a better alternative than repetitive debugging sessions because they change the core of how you are thinking about design and coding, forcing you to have a broader view about how you are doing things and preventing problems before they appear. I

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 1:05 PM, Lee Spector wrote: On May 28, 2013, at 2:40 PM, Ben Mabey wrote: The flag is a system property: "-Dclojure.compiler.disable-locals-clearing=true". So you can add that string to your project.clj's :jvm-opts if you are using lein. This will, of course, slow down your progra

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 2:40 PM, Ben Mabey wrote: > > The flag is a system property: > "-Dclojure.compiler.disable-locals-clearing=true". So you can add that > string to your project.clj's :jvm-opts if you are using lein. This will, of > course, slow down your program but when I've used it in the

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 2:38 PM, Cedric Greevey wrote: > What about logging aggressively but also aggressively dumping older log > entries? Keep only, say, the last 100 or 1000 entries. Something like: [etc.] Thanks Cedric. That does indeed seem feasible. In my applications, for example, I might a

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 12:19 PM, Lee Spector wrote: On May 28, 2013, at 2:16 PM, Ben Mabey wrote: You can disable locals clearing with a compiler flag. nrepl-ritz even has helper function that will compile the given form using that flag. If you want to disable locals clearing on a project wide basis you

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Cedric Greevey
What about logging aggressively but also aggressively dumping older log entries? Keep only, say, the last 100 or 1000 entries. Something like: (def logger (atom nil)) (def max-log-entries 1000) (def log-file whatever) (defn log [msg] (swap! logger (fn [oldlog] (let [newlog (doall (t

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Warren Lynn
> Still miss the Elisp debugger, which is great. It's right there, in your > editing environment. It's good for debugging my own code. It's really > good for working out someone elses code. I wish I debug clojure in the > same way. It's not essential, of course. But nice. > > Phil > I miss

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 2:16 PM, Ben Mabey wrote: > > You can disable locals clearing with a compiler flag. nrepl-ritz even has > helper function that will compile the given form using that flag. If you > want to disable locals clearing on a project wide basis you can do so with > lein's JVM opt

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Timothy Baldridge
I did a fair amount of programming in C# before switching to Clojure. I noticed an interesting fact: the more lazy (as in using lazy-seqs) and functional my code became, the more erratic the was the flow of execution. It's my personal opinion, that as these features are used more and more in a prog

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 12:37 PM, Cedric Greevey wrote: > > I think locals clearing is simply incompatible with ever having full debug > info at an error site without anticipation of an error at that site, and with > anticipation you can put debug prints, logging, watchers, and suchlike at the > s

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 10:37 AM, Cedric Greevey wrote: Huh. I just solved it. The debug exception handler has to do something a bit fancier, that's all: 1. Dig up the bytecode of the method executing the throw and copy it somewhere. 2. Unwind by one call. 3. Take the bytecode in 1, alter it to wrap the t

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Warren Lynn
May I suggest that as useful as your strategies are, they cannot replace a debugger? Let's be clear about our logic before claiming "it is not much needed". Maybe YOU really don't need it, but that is different from claiming it is not needed. A debugger as good as it is cannot replace the 4 fi

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Cedric Greevey
Huh. I just solved it. The debug exception handler has to do something a bit fancier, that's all: 1. Dig up the bytecode of the method executing the throw and copy it somewhere. 2. Unwind by one call. 3. Take the bytecode in 1, alter it to wrap the throw site in redl.core/break's macro expansion t

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Cedric Greevey
On Tue, May 28, 2013 at 9:36 AM, Lee Spector wrote: > > On May 28, 2013, at 8:43 AM, dgrnbrg wrote: > > There's not much you can do to retrieve the locals around an exception > with adding a Java Agent. REDL is able to get the locals around uses of > redl.core/break, since it's a macro and that's

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 10:32 AM, Rostislav Svoboda wrote: > This might not be the proper example: If (/ 2 n) throws "Divide by > zero" then "n == zero" Well yes of course it's obvious what the problem is in this case! The point is that if the "bad" function was more complicated then might help to

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Rostislav Svoboda
This might not be the proper example: If (/ 2 n) throws "Divide by zero" then "n == zero" On 28 May 2013 15:40, Lee Spector wrote: > > On May 27, 2013, at 8:31 PM, Charles Harvey III wrote: >> If you haven't tried out Light Table, it shows you the values of local >> variables. It is a pretty nic

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 27, 2013, at 8:31 PM, Charles Harvey III wrote: > If you haven't tried out Light Table, it shows you the values of local > variables. It is a pretty nice feature. > I love the ideas behind LightTable and I check it out from time to time. Checking it out now, though, regarding this issu

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Lee Spector
On May 28, 2013, at 8:43 AM, dgrnbrg wrote: > There's not much you can do to retrieve the locals around an exception with > adding a Java Agent. REDL is able to get the locals around uses of > redl.core/break, since it's a macro and that's an ability of macros. In Common Lisp exceptions are han

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread dgrnbrg
There's not much you can do to retrieve the locals around an exception with adding a Java Agent. REDL is able to get the locals around uses of redl.core/break, since it's a macro and that's an ability of macros. On Monday, May 27, 2013 10:10:39 PM UTC-4, Lee wrote: > > > On May 27, 2013, at 9:54

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Phillip Lord
Oskar Kvist writes: > Stuart Halloway said in his video Clojure in the Field ( > http://www.infoq.com/presentations/Clojure-tips) from March 1, 2013 (I > think): "I don't feel the absence of a debugger because I've learnt enough > that I don't ever need a debugg

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Mark Engelberg
I'm not sure what your point is. I rely quite a bit on randomly generated tests, and of course, any multithreaded app has nondeterministic elements that can be hard to replicate. For that matter, if you are simply experimenting with new code at the REPL, it might not always be clear what sequence

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Cedric Greevey
You have production code going *boom* that doesn't have any failing tests? Or you have nondeterministic tests? :) On Tue, May 28, 2013 at 1:49 AM, Mark Engelberg wrote: > On Mon, May 27, 2013 at 10:25 PM, Cedric Greevey wrote: > >> What about add-watch? Can be used with any of Clojure's mutable-

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Mark Engelberg
On Mon, May 27, 2013 at 10:25 PM, Cedric Greevey wrote: > What about add-watch? Can be used with any of Clojure's mutable-value > containers -- atoms, refs, agents, vars. If one is getting set to an > inappropriate value, or you suspect it is, you can attach a watcher to it > that will emit a log

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Cedric Greevey
On Mon, May 27, 2013 at 5:39 PM, u1204 wrote: > The REPL is your best friend. You can "hand execute" small pieces of > code to test your assumptions. > > Common Lisp systems have wonderfully powerful trace functions allowing > arbitrary conditions and actions. > > I haven't seen anything like tha

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Charles Harvey III
If you haven't tried out Light Table, it shows you the values of local variables. It is a pretty nice feature. On Monday, May 27, 2013 5:53:16 PM UTC-4, puzzler wrote: > > I would be a lot happier with the state of Clojure debugging if, in > addition to a stacktrace, I could easily explore the

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Lee Spector
On May 27, 2013, at 9:54 PM, Softaddicts wrote: > Lets take a real life example, [etc.] > > Debugging was not a viable option. [etc.] > > This project was extreme in this regard but it prove to me that reviewing > code offline > and thinking about how to improve it gives much more payback than

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Softaddicts
Lets take a real life example, I had to design a backup system to take over when a master quote feed made of several individual feeds failed. My backup system had access to same raw feeds as the master system using serial lines but there were no guarantee that both systems would receive the raw f

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread dgrnbrg
k): "I don't feel the absence of a debugger because I've learnt enough > that I don't ever need a debugger." I am very intrigued by that statement. > What does he (or you, if you are reading, Stuart) mean? For me, debugging > is the biggest thing that I don'

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Lee Spector
On May 27, 2013, at 5:53 PM, Mark Engelberg wrote: > I would be a lot happier with the state of Clojure debugging if, in addition > to a stacktrace, I could easily explore the local variables in play when an > error was triggered. It was possible to do this in earlier Clojure > environments,

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Brandon Bloom
Monday, May 27, 2013 2:34:23 PM UTC-4, Oskar Kvist wrote: > > Stuart Halloway said in his video Clojure in the Field ( > http://www.infoq.com/presentations/Clojure-tips) from March 1, 2013 (I > think): "I don't feel the absence of a debugger because I've learnt enough

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Softaddicts
e clojure, a live repl can fill the role (and > then some) of a debugger. > > I personally can't speak to vim integration, don't use it with clojure. > > > > > > > > > > > On Mon, May 27, 2013 at 2:34 PM, Oskar Kvist wrote: > > > Stuart Hall

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Mark Engelberg
Yes and no. nrepl ritz lags behind slime, especially in areas such as breakpoints and inspection. On Mon, May 27, 2013 at 3:22 PM, David Nolen wrote: > Doesn't ritz support nrepl? http://github.com/pallet/ritz > > > On Mon, May 27, 2013 at 5:53 PM, Mark Engelberg > wrote: > >> I would be a lot

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread David Nolen
Doesn't ritz support nrepl? http://github.com/pallet/ritz On Mon, May 27, 2013 at 5:53 PM, Mark Engelberg wrote: > I would be a lot happier with the state of Clojure debugging if, in > addition to a stacktrace, I could easily explore the local variables in > play when an error was triggered. It

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Mark Engelberg
I would be a lot happier with the state of Clojure debugging if, in addition to a stacktrace, I could easily explore the local variables in play when an error was triggered. It was possible to do this in earlier Clojure environments, but the capability seems to have been lost in the transition to

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread u1204
>Stuart Halloway said in his video Clojure in the Field ( >http://www.infoq.com/presentations/Clojure-tips) from March 1, 2013 (I >think): "I don't feel the absence of a debugger because I've learnt enough >that I don't ever need a debugger." I am very intrig

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Jonah Benton
n the Field ( > http://www.infoq.com/presentations/Clojure-tips) from March 1, 2013 (I > think): "I don't feel the absence of a debugger because I've learnt enough > that I don't ever need a debugger." I am very intrigued by that statement. > What does he (or yo

"I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Oskar Kvist
Stuart Halloway said in his video Clojure in the Field ( http://www.infoq.com/presentations/Clojure-tips) from March 1, 2013 (I think): "I don't feel the absence of a debugger because I've learnt enough that I don't ever need a debugger." I am very intrigued by that sta