# How to use Wolfram language  in an external program with low latency?

**URL:** <https://community.wolfram.com/t/how-to-use-wolfram-language-in-an-external-program-with-low-latency/6056>\
**Category:** Questions\
**Tags:** compilation, external-interfaces, raspberry-pi\
**Created:** [June 29, 2015, 2:45pm UTC](https://community.wolfram.com/t/how-to-use-wolfram-language-in-an-external-program-with-low-latency/6056 "2015-06-29T14:45:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![babakakb](https://avatars.discourse-cdn.com/v4/letter/b/59ef9b/32.png) [@babakakb](https://community.wolfram.com/u/babakakb)\
**Post date:** [June 29, 2015, 2:45pm UTC](https://community.wolfram.com/t/how-to-use-wolfram-language-in-an-external-program-with-low-latency/6056/1 "2015-06-29T14:45:18Z")

</div>

Hi

Im using Wolfram language on Pi B,and I want to compile a ‘.m’ file (like “test.m” that contains Wolfram functions), in an external program like a C/C++ and then Export the output in an image file type.

I have made these efforts:

1-I used “wolfram -script test.m” to compile test.m and it worked but it was too slow for me.

2-I used Wolfram headers like (libML32i3.a ,libML32i3.so ,libML32i4.a ,libML32i4.so ,mathlink.h) and copied them in “/usr/include” directory then  
as what [here](https://reference.wolfram.com/language/tutorial/WSTPDeveloperGuide-Unix.html#4756) said (WSTP Development in C) I compiled one of the C codes in MathLink for examples by “make”, the problem was when I wanted to run any of those codes like “./factor” then I was asked for “Create link:” and then I typed something for example ‘a’ after that the program asked me “Integer to factor:” and when I typed the number the program couldn’t display the output.(for example it takes 5 minutes but the program still doesn’t have output).

3-I also used “mkfifo mmpipe”,“tail -f mmpipe | wolfram”,and then “echo Export[“test.gif”, Plot[Sin[x], {x, 0, 10}]] \> mmpipe” and wolfram displayed an  
error “Export::chtype: First argument test . gif is not a valid file specification.”

so what should I do now.

Thanks.
