On 25/11/13 20:12, kilon alios wrote:OK, let's make an experiment and we'll see :-)
I don't see a problem. Sockets provide a way to communicate, sockets
nowadays are used almost everywhere. They have their limitations but its
a viable , very fast and simple solution.
Here's the code that parses XML using Xerces on VM that
runs both Smalltalk and Java:
=======================
factory := JAVA javax xml parsers SAXParserFactory newInstance.
parser := factory newSAXParser getXMLReader.
parser setContentHandler: JavaExamples::CDDatabaseHandler2 new.
[
� � parser parse: build_xml.
] on: JAVA java io IOException do:[:ioe|
� � Transcript showCR: 'I/O error: ', ioe getMessage.
� � ioe printStackTrace
] on: UserNotification do:[:un|
� � Transcript showCR: un messageText.
� � un proceed.
]
=======================
The handler:
https://bitbucket.org/janvrany/stx-libjava/src/e5fc3aaad7a2a9f06ba1f28e2144eb0acfb1ec13/examples/CDDatabaseHandler2.st?at=development
Now, you implement solution using sockets or any other kind
of RPC.
Then lets write a benchmark and check what's simpler and what's
faster. I would be very interested in results.
Anyway, we're getting bit offtopic I guess. If you want to do proposed
experiment, drop me a private message (unless the list shows
interest :-)
Best, Jan
P.S.: If you like the challenge, then consider small modification
of the code above **without** `un proceed` at the end of handler
of UserNotification.