Seems like you are assuming a model that
is at least as hard as foreign functions, namely
unix style pipes.
Pipes are way too fragile. Do you mean
that you would compute the value of a gamma function
by writing a character string to a pipe, and
then read the answer?
Not only would this be extraordinarily slow,
but you would have to deal with out-of-pipe
communications like "floating point overflow".
Foreign function interface would, in my
opinion, require less effort and be much
more effective. And yes, it too would have
to be done on a platform by platform basis.
(Though I suspect all versions of GCL would
have the same FFI.)