It is not clear to me what you really want. In particular, for
about 18 years Sage interface was using InputForm. What trouble
you want to avoid by using different representation?
Note that design like InputForm or OutputForm work by cooperation
of "all" FriCAS domains. Each involved domain must implement its
part. Normal FriCAS policy is to hide internal details and
implementing things like InputForm or OutputForm usually is
easier with access to internals (otherwise extracting needed
information can be tricky). So, doing another form in similar
spirit, but from "outside" looks like a lot of work if you
want wide coverage. If you want to cover just some special
domains, then I would look first at improving InputForm.
AFAICS one issue during interfacing is to transmit raw values. That
could be done recursing over Lisp representation of data, similar
to what recently added FileSerialization (or old Boot code) is
doing. FriCAS uses limited number of Lisp types, basicaly integers,
symbols, cons cells, and various arrays (beside general 1D and 2D
arrays we also use specialized ones). Kernels use special
Lisp structure. One can use Lisp printer to get textual form
of such data or possibly use some binary form for easier
parsing and better efficiency (but at the cost of debugging
trouble).
Once you got raw data you need to make some sense of it. This
requires knowledge of FriCAS types. One potentially nice
approach is to build collection of proxy Python objects which
simply pass data that they own to FriCAS so that FriCAS can do
required computation. In principle creating such proxy object
could be done with process similar to build of Aldor interface,
that is by iterating over FriCAS constructors, retriving
information about constructors and using it to create a
proxy. I do not know how much effort is needed to create
usable interface of this sort.
BTW: In the past among other I looked at OpenMath standard.
AFAICS it resolves issue to transpoting raw values by specifying
appropriate protocol. But beyond that there is trouble: basically
for each kind of thing to transmit one need agreement between
both ends. For this OpenMath have so called "dictionaries".
There are some standard dictionaries. What I saw was
essentially trivial, that is number and a bunch of classic
functions on them. My impression was that each dictionary
was essentially build in ad hoc way by enumeration of
coverd constructs. For me that looked extremaly laborious
and unscalable. For that reason currenly OpenMath code in
FriCAS is non-functional. But if there are some useful dictionaries,
then adding support for them do not look hard assuming
reasonable scale (dictionary defining 1000 things would
require some work due to bulk, 10000 things would be
challenging due to needed manpower).
--
Waldek Hebisch