When exchanging expressions with external programs, the Mathematica
kernel uses the convention of wrapping the expressions inside packets which identify what role the expressions have, or how they should be processed.
an expression sent purely for evaluation
a string to be entered like keyboard input
an expression to be entered like keyboard input
TextPacket — Print
and other incidental output
data for calling functions in an installable MathLink