Half-baked idea: Standard machine readable output for command line programs
rwmj.wordpress.com
rwmj.wordpress.com
I think another approach is to use robust, good tools to parse human readable output (assuming it is reasonably consistent as many unix commands are, for instance).
There is a great tool for TCL environments called "Expect". You can use that to send/parse commmands in the shell or ssh, ftp, even over serial ports, etc. There are sophisticated capabilities for regex-based matching, and the syntax is nicely compact. There are also ways to fork tasks so that multiple command/response sessions can be done in parallel.
I really wish that something like "Expect" existed in .NET or Java. It was nice to have it as a tool.
It's a cool idea. Though with vanilla text you can work with partial output (imagine having to buffer something huge and useless until some marshaling layer coughs up the whole object -- with text, you don't always need to wait for everything to come across to start processing).
https://github.com/benbernard/RecordStream
It solves this problem by providing adapters that transform the output of a program into JSON, and then tools that can be chained together to manipulate the JSON. It is quite powerful.
Of course this only solves the parsing problem, not the semantic one.