The Lone TeXnician ================== This is a Mars Rover controller written in (La)TeX. It also includes a bit of Perl because TeX has no socket libraries. --- 1. Wrapper interface There is a 100-line Perl wrapper (called texsocket) that deals with the networking. It basically operates by opening up the TCP/IP socket along with a two- way pipe to a TeX process. The wrapper keeps the incoming messages from the server buffered until TeX asks for them by printing "WANT" and then blocking until it gets a line of text from STDIN. Likewise, to send a message to the server, TeX prints "HERE:" followed by the message, and the Perl wrapper simply passes that along. The other major responsibility of the Perl wrapper is to keep time for TeX. Since TeX does not have its own internal clock (indeed, there is a "\time" macro that gives the time up to the minute, but it is fixed at the beginning of the job, so even if it were well-enough resolved, it wouldn't help). We do this by adding an extra signal "t