To my

> > Maybe, you can describe a String interface of C to Axiom via a file?
> > Imagine the following.
> > (1) A  C function        char*  axi(char* p)
> >    takes a string starting from the place  p  and ending at a certain
> >    `end' symbol
> >    (I am trying to recall C, fix this, please, if necessary).
> > (2) It puts this string  str  to the file  interf.input  for Axiom.
> > (3) Axiom  inputs  str  from this file,
> >    parses it as a program call for the interpreter,
> >    runs the interpreter, writes the result to  str'
> >    outputs  str'  to this file,
> > (4) axi  inputs  str'  from this file and returns the pointer to the
> >     head of str'.

Waldek Hebisch wrote on Dec 03, 2011

> I am not sure why you keep talking about files.  To know _when_
> to read file you need some "side chanell" of comunication.  Once
> you have such chanell, you can simply use it for all comunitations.


This side channel can be a file, cannot it?
For example, before the  session, the files  "readinessForAxiom.txt" 
and  "a.input"  are created.
axi  puts the argument string to  "a.input";
then, puts  1  to  "readinessForAxiom.txt".
"readinessForAxiom.txt" keeps   a single (int) character.
Axiom waits (by repeating input from "readinessForAxiom.txt") for  1
to appear there. And then, reads from  "a.input".

And  axi  works similarly with its input files  resReadiness.txt   and
res.txt  to which Axiom outputs.
It is easy to program both at the C end, and Axiom end.
I wonder, what is wrong here?

Anyway files are slow.
And if the socket interface is considerably faster, then it is desirable.



> Below outine of versy naive interface:
> 
> 1) Create process conected via pipes:
> [..]
> 
> 4) That outline will need about 100-200 lines of C code to implement
>    which will take few hours.  Unfortunatly, today I am in a hurry,
>    so I can not give you detailed code.
> 

I can wait.

With files, I can try myself and see whether I am mistaking.
With sockets, I probably cannot try, because, probably, this needs a 
knowledge about the Axiom internals, something which is not in the Axiom 
book.

Regargs,

------
Sergei
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to