I have been using some basic MathLink programming in my work and wanted to create some more sophisticated MathLink programs. I came across the book "MathLink: Network Programming with Mathematica", which was written around the era of Mathematica version 4, which has some neat interactive gui examples using mathlink, based around a piece of mathlink code created by the author of that book called Serializer.exe. Its essentially a mathlink template program designed to sit in between the kernel and the front end as they communicate so you can modify how that communication works.
I can almost run it on my machine, using Mathematica 8, up to one little sticking point that maybe someone can help me with. To give you an idea of whats going on:
The starting point is a mathlink template program (compiled using c, as such things are) called Serializer.exe. This program is added as a custom evaluator in mathematica via the "Kernel Configuration Options", and the code is run with that kernel (i.e. it runs through serializer.exe before being sent to the actual kernel.)
Then this program spawns a raw mathlink program which is added to the list of evaluators (Options[$FrontEnd,EvaluatorNames]) and tries to set up a mathlink connection between it and the front end.
After going through the code step by step, the place where its stuck is a pair of lines of code that look like:
Now MessageLinkActivate is a custom function defined in the c code, but it seems that it should be similar to LinkActivate, the usual math link activation function. Users of mathlink will know that once LinkActivate is called on a kernel, it blocks evaluation until the other end of the program activates as well. The program hangs if the activate is never answered. However, EvaluatorStart is not defined anywhere, and it throws an error message that is does not recognize the packet "EvaluatorStart", and then waits forever for a return linkactivation that never happens. I'll give exact instructions for recreating the error in the comments below, but I should say that the exact same error comes up if EvaluatorStart is changed to a random string of letters- so I'm sure the program really has no definition for EvaluatorStart.
I am trying to deduce the right line of code to put here - after some googling, it seems that there is a FrontEnd Token called EvaluatorStart, which would be called something like this:
where nb is an argument that must refer to some notebook, which I'm not sure what to put (I tried EvaluationNotebook with no luck).
Any help would be appreciated on the following questions:
- In Mathematica 4, what did FrontEndExecute[EvaluatorStart[name]] do?
- How could I recreate that functionality in Mathematica 8 or 9?
- Does anyone use serializer.exe with a modern version of mathematica?
- Has anyone else created advanced interactive mathlink programs, like the interactive graphics system featured in "MathLink: Network Programming with Mathematica", with publically available code?
Edit: To recreate this would require adding serializer.exe to your mathematica $LaunchDirectory, and then running some very short code in Mathematica. I can provide this file and code if anyone actually wants to help try to solve this.