Re:Why Java exceptions are slow (and Common Lisp conditions ...
by dhimes on Saturday January 17, 2009 @11:35AM
(#438216)
And I find this to be a complete pain in the ass. Seriously, you can't even print out variables to see what went wrong when you are building/debugging. They're no longer in scope.
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by gruseom on Saturday January 17, 2009 @12:19PM
(#438267)
What do you mean by "this" - Java's unwinding of the stack? Because in Lisp you just visit whatever stack frame you want and see everything that's in scope.
The real problem with Lisp environments (at least the open-source ones) is the lack of acceptable modern debuggers.
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by dhimes on Saturday January 17, 2009 @04:39PM
(#438607)
The fact that my "catch" block is in a different scope than the "try" block. If I really needed to do it, I could subclass "exception" and dump my variables there. But usually I'm just debugging something stupid so it's easier to put in "print" statements.
I've even put in a "macro" that gives me a "print" statement with a long string of "+" afterword so I can quickly spot them in my code and delete them (but don't tell anybody, 'cuz that's just plain wrong...).
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by gnaritas on Saturday January 17, 2009 @12:43PM
(#438293)
Try Smalltalk, it has both a modern IDE/Debugger with automatic refactoring support and resumable/restartable exceptions/notifications.
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by gruseom on Saturday January 17, 2009 @01:01PM
(#438316)
Smalltalk does have some advantages over Lisp, including the ones you mention. But lack of a good debugger isn't enough to make me switch. I like Lisp a lot. Besides, switching to Smalltalk would be more work than writing (modernizing, really) a Lisp debugger.
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by stcredzero on Sunday January 18, 2009 @08:28AM
(#439308)
Just steal ideas from the Smalltalk debuggers. You can see their source. If you make a copy of the debugger, you can probably even debug and step through the copy debugger in the debugger.
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by catch23 on Saturday January 17, 2009 @08:07PM
(#438839)
I think people who use lisp, use it because it's lisp and not smalltalk :-).
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by gnaritas on Monday January 19, 2009 @10:06AM
(#440485)
I think people who use Smalltalk, use it because it's Smalltalk and not Lisp :-).
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by Prrometheus on Saturday January 17, 2009 @04:16PM
(#438578)
What features does a "modern" debugger have, as opposed to non-modern ones.
Re:Why Java exceptions are slow (and Common Lisp conditions ...
by gruseom on Saturday January 17, 2009 @06:35PM
(#438747)
Single-stepping, inspection of variables, view source code of current instruction. That's about it. I'm only calling it "modern" to distinguish it from what I'm using, which seems neanderthal.
I know that Slime is supposed to do these things if you use SCBL and various planets align, but (a) I've never gotten it to work, (b) it's obviously no one's priority, and (c) I don't use SBCL much anymore.
Lisp, basically, keeps track of exception handlers in a table seperate from the runtime stack. Hence, it doesn't need to unwind the stack to find an exception handler - it can just look it up without destroying the existing stack.