Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Which distribution of Scheme has the best debugger?

16 views
Skip to first unread message

Jonathan Mark

unread,
Mar 16, 2008, 11:59:32 PM3/16/08
to
It is getting time for me to move beyond my Pocket Scheme on my
cellphone. I would like to program in Scheme on Ubuntu and I would
like to use the distribution of Scheme which has the easiest-to-use
debugger.

Hopefully the Scheme debugger would be so easy that even someone like
me who hasn't used a debugger in years could figure out its basic
features without a manual.

It could be either R5RS or R6RS, and wouldn't even need to be a 100
percent implementation of either.

Any suggestions?

Pascal J. Bourguignon

unread,
Mar 17, 2008, 5:18:34 AM3/17/08
to
Jonathan Mark <jonatha...@yahoo.com> writes:

You'd have to define best.

I believe DrScheme debugger is the most newbie-friendly one.
I don't know if it would be the best professionnal debugger...

--
__Pascal Bourguignon__

Aaron Hsu

unread,
Mar 17, 2008, 6:05:09 AM3/17/08
to
Jonathan Mark <jonatha...@yahoo.com> writes:

>It is getting time for me to move beyond my Pocket Scheme on my
>cellphone. I would like to program in Scheme on Ubuntu and I would
>like to use the distribution of Scheme which has the easiest-to-use
>debugger.

>Hopefully the Scheme debugger would be so easy that even someone like
>me who hasn't used a debugger in years could figure out its basic
>features without a manual.

This really depends on what you mean by a good debugger that is easy to
use. If you are familar with Emacs then MIT Scheme and Edwin provides a
very nice debuggin environment, but it's interface still runs by you
hitting command keys. Chez (Petite and full version) also has a good
general purpose debugger in the same vein. PLT (as others will assuredly
mention) also has something of a debugger with a bit more graphical
guiness to it, but you need to use DrScheme to get the GUI. There are
some others which also have some kind of debugging facilities on them,
though these are the ones I know of. I have a demo of using MIT Scheme
through Edwin if you are interested. It's very simplistic, and only goes
over the basics. It's also a little old, but the concepts still hold.

http://www.sacrideo.us/Sacrificum_Deo/Stuff_files/MIT-Scheme-Session_Encoded.mov
--
Aaron Hsu <arc...@sacrideo.us> | Jabber: arc...@jabber.org
``Government is the great fiction through which everybody endeavors to
live at the expense of everybody else.'' - Frederic Bastiat

Ludovic Courtès

unread,
Mar 17, 2008, 6:44:21 AM3/17/08
to
GNU Guile has a good debugger and a great Emacs interface, which allows
you to add breakpoints from within source file buffers, step through
source code, traverse backtraces, etc. [0].

Thanks,
Ludovic.

[0] http://www.ossau.uklinux.net/guile-debugging/

Jens Axel Soegaard

unread,
Mar 17, 2008, 7:15:54 AM3/17/08
to
Jonathan Mark wrote:
> It is getting time for me to move beyond my Pocket Scheme on my
> cellphone. I would like to program in Scheme on Ubuntu and I would
> like to use the distribution of Scheme which has the easiest-to-use
> debugger.

Are you sure you a debugger?

> Hopefully the Scheme debugger would be so easy that even someone like
> me who hasn't used a debugger in years could figure out its basic
> features without a manual.

Maybe not?


The importance of a debugger is to me less than the
importance of source location tracking.

Consider the following program:

(define (foo x)
(bar x 2)) ; <=

(define (bar n)
(+ n 1))

(foo "3")

If I run this program in DrScheme, then the form (bar x 2)
in the editor window is colored red. The error message
is
[bug icon] procedure bar: expects 1 argument, given 2: "3" 2

The red form actually contains the error, so I change it
to (bar x 2) and run the program again.

(define (foo x)
(bar x))

(define (bar n)
(+ n 1))

(foo "3")

Now I get the error:

[bug icon] +: expects type <number> as 1st argument, given: "3";
other arguments were: 1

and (+ n 1) is colored red. This time the problem is
not that in the red form (+ n 1), but that n is bound
to a value of the wrong type. Where did
the value come from?

The first thing to do is to click the bug icon to see a
stack trace. In this example the stack trace isn't
helpful since the computation got to (+ n 1) via
a series of tail calls.

The second thing to do is to make the interaction window
(editor window) active and click the "Check Syntax" button.
Moving the mouse arrow over n now reveals where n is bound,
namely as the argument of bar. Where is bar called? I move
the arrow over bar and see that bar is called from foo.
Moving the arrow over foo, I see that foo was called from
(foo "3" 1) which is where the error was.


The example is of course very simple, but the techniques
are very helpful while debugging larger programs.


--
Jens Axel Søgaard


Jonathan Mark

unread,
Mar 17, 2008, 6:51:39 PM3/17/08
to
Thanks to everyone who answered! I decided to go with DrScheme for two
reasons:

(1) Someday I might want to use the PLT continuation server, which
uses DR Scheme

(2) I don't know Emacs.

I installed DrScheme on my Mac OS X (I'll try it in Ubuntu later) and
worked through Jens' helpful tutorial.

I haven't looked at a debugger in 10 years. I really liked the way if
you put your cursor on a variable it shows where the variable is
called.

Later on I'll figure out breakpoints and how to view variable values
in an executing program.

0 new messages