[development] Bridging PHP to Java or C++?

Chris Johnson chris at tinpixel.com
Thu Dec 29 00:05:17 UTC 2005


>>On Wed, 2005-12-28 at 10:40 -0600, Mark Fredrickson wrote:
>>
>>>Hi all,
>>>
>>>For my Machine Learning toolkit, I'm looking to draw on the work of either
>>>the Java Weka ML system or the MLC++ library.

Trying to integrate either Java or a C++ library into PHP just so that one can 
run a Java or C++ machine learning system sounds really painful.  Unless the 
performance needs to be high and the transaction latency extremely low, this 
sounds like a perfect case for NOT integrating the code, but calling it via 
some sort of remote procedure call (RPC) or remote method instantiation (RMI 
-- Javaspeak for a previously existing concept -- grrrr >:-( ).

How about writing a Java server that does the machine language stuff that can 
accept an XML-RPC socket connection from Drupal instead?  That's got to be a 
thousand times easier to do, and the performance won't be that bad.

I've already done this kind of thing twice.  In one instance I open a socket 
to a Java server to do "real time" transactions with it from a Drupal module, 
and in another, I make a SOAP connection to a C++ server from a Drupal module, 
likewise to do "real time" transactions.  I would not even have a prototype 
working if I tried to write a PHP extension that tried to run the Java or C++ 
application natively.


..chrisxj



More information about the development mailing list