The right thing IMHO would be to use pipes & stdin/stdout/stderr, but with a well-defined machine interface.