<p>Years ago I created a programming collaboratory in Diversity University MOO -- a room written in MOOcode that used TCP/IP to communicate with a perl server back at my campus to compile and execute C, Perl, Bash and other programs and return results to the MOO collaboratory -- all for demonstrating programming languages in a MOO teaching environment.  The application is usually a romp in five or six languages and fun to play with.  Now I'd like to do the same thing in SecondLife using LSL. The only suggestion I've gotten so far from that crowd is to use a WWW request, presumeably constructing an http POST message to a CGI process.  I never cared much for html forms so I'd rather use TCP/IP or some other communications protocol.  Has anyone tried this who'd care to provide a few hints?  There are several good LSL demo sites in SecondLife but I'd like to demo other compiler and script languages, maybe even PowerShell.
Dick S.</p>

REST
is now in fashion for web services. There is no real reason to get down to TCP/IP layer for something which from your description does not require super performance or response times. LSL HTTP support is quite good so you should not have any problems.
Of course it is not ideal to get the output of your programs back in real-time - for that you would need to open http connection on the server and constantly write to the body of the page (while the client would read that). But even with going back and forth between the server and the client you should get moderately good experience.