7
$\begingroup$

I noticed that the documentation for LinkSnooper says that it is "obsolete". I don't have any experience with this tool, but I thought it looked interesting after seeing results it was able to provide in some of the answers here on Mathematica SE.

Are there better facilities for this kind of analysis present in Mathematica or available as add-ons or external software?

$\endgroup$

1 Answer 1

12
$\begingroup$

The online documentation may indicate that the online documentation is obsolete; the LinkSnooper itself is still alive and kicking! Just go to the Documentation Center and look at the guide page of JLink:

JLink/guide/CallingTheWolframLanguageFromJava

scroll down to "LinkSnooper" and there you have it.

I use LinkSnooper quite often, because it is one of the rare tools that helps you investigating in

  • how dynamic stuff is working
  • how the internal debugger works
  • how autocompletion of your functions is achieved

In fact, I use it so regularly, that I even started to write a better version of it that supports basic highlighting and better copy&paste support of the packets, because I find myself often enough in the situation where I want to test expressions in a notebook. I gave it the name Pink Roselon which is an anagram of LinkSnooper:

Pink Roselon

I haven't worked on it for some time since it seems incredibly hard creating a list-view of highlighted text that works super-smoothly even for a large amount of data.

Another way of inspecting front-end to kernel communication is to write your own traffic logger directly inside Mathematica. If you want to know how this can be done, I strongly recommend reading the article MathLink Mode by David Wagner and the reference therein.

Although not everything from this article is still working nowadays (the article is from 1996!), a packet snooper can easily be set up with the information there.

Finally, if you already know that Kernel and Front End are talking over a MathLink (today it's called WSTP Link) and you wonder how and when the Service- and the Preemptive-Link is set up, then a good read is the source LinkSnooper:

FileNames["LinkSnooper.java", {$InstallationDirectory}, Infinity]

Especially the comments (e.g. line 337) are very enlightening. It specifically explains how the other two links are created.

$\endgroup$
2
  • $\begingroup$ Do you have it up on github, yet? $\endgroup$
    – rcollyer
    Commented Feb 9, 2015 at 20:12
  • $\begingroup$ @rcollyer Nope, this is currently my little secret project on a private cvs. $\endgroup$
    – halirutan
    Commented Feb 10, 2015 at 4:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.