Arc Forumnew | comments | leaders | submitlogin
Writing a debugger for arc (help)
1 point by utx00 5324 days ago | 3 comments
could anyone point me to any documentation (code, book, article, ...) that would teach me how to go about writing a step debugger for arc? mostly doing it for my own amusement, but i don't know where to start. thanks.


3 points by aw 5324 days ago | link

Before getting into modifying the Arc compiler you may want to try an easier step first: write an Arc interpreter in Arc, which you can then easily make step through the program to be debugged.

To learn how to write an Arc interpreter, see the classic Structure and Interpretation of Computer Programs: http://mitpress.mit.edu/sicp/full-text/book/book.html

By the end of section 4.1 you'll know how to write the interpreter.

-----

3 points by conanite 5324 days ago | link

ac.scm is the scheme code that compiles arc into scheme. This would be an appropriate place to plug in a debugger, by adding hooks in, for example, ar-funcall0 and ar-apply. Otherwise, there are debuggers for scheme, but using one of those wouldn't be as much fun as writing one ...

you might find inspiration in the debuggers that come with rainbow or jarc.

-----

1 point by utx00 5324 days ago | link

thanks. will take a look.

-----