The EXPECT extension to TCL is made for controlling and communicating with other user specific programs. Pascal user specific programs would be perfect.
TCL was developed at UCBerkeley and Sun. Expect was developed at the US NIST. Nice, stable, well documented, public domain software.
Pascal is the weak link. You are very talented people with GPC. I really appreciate CBFalconer's concerns.