On 5/22/06, <b class="gmail_sendername">Jeff Crane</b> <<a href="mailto:jefcrane@yahoo.com">jefcrane@yahoo.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am looking to build my client GUI. I would like to<br>use, in order of preference:<br><br>HGE (C++ library)<br>Python<br>ESDL<br>HGE through EPI?<br>(<a href="http://epi.sourceforge.net/docs-0.0.2/index.html">http://epi.sourceforge.net/docs-0.0.2/index.html
</a>)<br>EPI (Erlang Plus Interface) is in the Erlang FAQ.<br><br>Is there a way to inline C++ or Python calls in<br>Erlang? It makes it trivial to have 1 process that's<br>waiting and acting on server messages locally instead
<br>of having to worry about message sending to ANOTHER<br>(GUI) process, complicating synchronization<br>unnecessarily.<br><br></blockquote></div><br>I find that inline drivers are too complex to bother with when<br>there is the simpler alternative of having a separate process
<br>running the foreign code. Especially when prototyping something,<br>something that doesnt desperatly need to run in the same process.<br><br>I dont see how synchronization is a problem, as you can easily make<br>calls to HGC sequential using an erlang gen_server the interface for
<br>your erlang code. And group several operations inside a anonymous<br>function, similar to mnesia:transaction/1.<br><br>So the approach I would use is to write a C++ program that reads<br>easily parsed instructions on stdin and writes events from input and
<br>other things to stdout. From erlang you can then create a port that <br>starts this program, and you can communicate with it through the port.<br>Make a gen_server own the port and turn erlang terms into the "wire"
<br>protocol.<br><br><br>If this all seems too laborous to you, perhaps you could look at wings3d<br>which is a successful application that use foreign code libs.<br><br>