The attached patch currently exposes the ghciCompleteWord function and uses Read/Show quoted strings for input/output. The first two lines returned are the number of completion candidates and the unused line part (as returned by ghciCompleteWord). The remaining lines are all completions found (up to the given limit).
I've attached a patch providing a more refined :complete command:
This one takes an optional range (1-based indexing, syntax [n-][m] where n denotes first index, and m the last index shown), allowing to slice the result list; moreover the first line emitted now contains:
hvr says he knows of no standard. He'll add some docs for the user guide, and is also working on an implementation of the emacs side.
hvr: I wonder if it would be better to use your own String-showing function rather than using Show, so as to make it possible to correctly use simpler parsing on the emacs side.
I've got a nicely working proof of concept implementation for Emacs (see http://youtu.be/06q-sCoqwEY for a short screencast demonstration).
Implementing complete Read/Show serialization for strings wasn't that hard in Elisp, and the standard case, when no escaping is needed has a cheap code path.