Re: Accessing PowerLoom from Haskell
Hans Chalupsky <[email protected]> Thu, 20 Aug 2015 14:41:28 -0700
| Newsgroups | gmane.comp.ai.powerloom |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============1631330050== Content-Type: multipart/alternative; boundary="------------020002020803030102050601" This is a multi-part message in MIME format. --------------020002020803030102050601 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by gamma.isi.edu id t7KLh35V018334 Anders, what you found in the archive is basically correct. Unfortunately, I=20 don't know much about Haskell besides that it is a functional language,=20 but here are some pointers: 1. If Haskell has a foreign function interface that allows you to call=20 either C, C++ or Java functions, then you can use that to call functions=20 in the PowerLoom API (PLI). The Wikipedia page says that Haskell 2010=20 added a foreign function interface, so that might be a way to go. 1b. If you are working in Linux/Unix, and Haskell has a way to easily=20 spawn Unix subprocesses that can be communicated with via their IO=20 streams, you can spawn a Unix process that runs the PowerLoom=20 read/eval/print loop, and you can then send input expressions and read=20 results from your Haskell parent process. 2. There is a simple TCP-based PowerLoom socket server in=20 powerloom-x.y.z/sources/logic/PowerLoomServer.java that you can play=20 with. This code is a bit old but should still work or should be easily=20 fixable to make it work. 3. The directory powerloom-x.y.z/sources/powerloom-server/plsoap/=20 contains some documentation on how to setup and use the PowerLoom SOAP=20 server 4. Writing a STELLA to Haskell translator is probably the most involved=20 option and only advisable if you have a use case that absolutely=20 requires a pure-Haskell production system. Unless Haskell has similar=20 object-oriented features such as C++ and Java, this would be a difficult=20 way to go. Some time ago, Mark Watson has written a JRuby wrapper for PowerLoom=20 that you could look at for inspiration=20 (http://blog.markwatson.com/2007/10/more-fun-with-jruby-using-powerloom.h= tml).=20 He also mentions Haskell on his web page, so he might have some more=20 suggestions on how to go about this. Simply search for PowerLoom on his=20 blog for some more PowerLoom-related info. Hope that helps. You can send me mail privately if you run into any=20 roadblocks with whatever approach you choose. Hans On 08/20/2015 12:59 AM, Anders N=E5sell wrote: > I am looking for ways to access PowerLoom from Haskell > and found a mail in the list: > > On Jun 17, 2008, at 7:55 PM, Rich Morin wrote: > 1. Just create a combined application. ... > 2. Use a tcp-stream based server. ... > 3. You could use the PowerLoom SOAP server > > Is there a documentation of the tcp-stream based server protocol? > > I there a documentation of PowerLooms XML-SOAP API or > is the Java source code the place to look? > > And finally, since STELLA is transcompiled, would it > be possible to compile it to Haskell or are there any > conceptual differences between STELLA and Haskell that > would make it impossible or hard? If possible how many lines > of codes are the existing transcompilers? What was approximately > the effort in man hours for the existing transcompilers? > > > > _______________________________________________ > powerloom-forum mailing list > [email protected] > http://mailman.isi.edu/mailman/listinfo/powerloom-forum --------------020002020803030102050601 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div class="moz-cite-prefix">Anders,<br> <br> what you found in the archive is basically correct. Unfortunately, I don't know much about Haskell besides that it is a functional language, but here are some pointers: <br> <br> 1. If Haskell has a foreign function interface that allows you to call either C, C++ or Java functions, then you can use that to call functions in the PowerLoom API (PLI). The Wikipedia page says that Haskell 2010 added a foreign function interface, so that might be a way to go.<br> <br> 1b. If you are working in Linux/Unix, and Haskell has a way to easily spawn Unix subprocesses that can be communicated with via their IO streams, you can spawn a Unix process that runs the PowerLoom read/eval/print loop, and you can then send input expressions and read results from your Haskell parent process.<br> <br> 2. There is a simple TCP-based PowerLoom socket server in powerloom-x.y.z/sources/logic/PowerLoomServer.java that you can play with. This code is a bit old but should still work or should be easily fixable to make it work.<br> <br> 3. The directory powerloom-x.y.z/sources/powerloom-server/plsoap/ contains some documentation on how to setup and use the PowerLoom SOAP server<br> <br> 4. Writing a STELLA to Haskell translator is probably the most involved option and only advisable if you have a use case that absolutely requires a pure-Haskell production system. Unless Haskell has similar object-oriented features such as C++ and Java, this would be a difficult way to go.<br> <br> Some time ago, Mark Watson has written a JRuby wrapper for PowerLoom that you could look at for inspiration (<a class="moz-txt-link-freetext" href="http://blog.markwatson.com/2007/10/more-fun-with-jruby-using-powerloom.html">http://blog.markwatson.com/2007/10/more-fun-with-jruby-using-powerloom.html</a>). He also mentions Haskell on his web page, so he might have some more suggestions on how to go about this. Simply search for PowerLoom on his blog for some more PowerLoom-related info.<br> <br> Hope that helps. You can send me mail privately if you run into any roadblocks with whatever approach you choose.<br> <br> Hans<br> <br> On 08/20/2015 12:59 AM, Anders Nåsell wrote:<br> </div> <blockquote cite="mid:[email protected]" type="cite"> <pre wrap="">I am looking for ways to access PowerLoom from Haskell and found a mail in the list: On Jun 17, 2008, at 7:55 PM, Rich Morin wrote: 1. Just create a combined application. ... 2. Use a tcp-stream based server. ... 3. You could use the PowerLoom SOAP server Is there a documentation of the tcp-stream based server protocol? I there a documentation of PowerLooms XML-SOAP API or is the Java source code the place to look? And finally, since STELLA is transcompiled, would it be possible to compile it to Haskell or are there any conceptual differences between STELLA and Haskell that would make it impossible or hard? If possible how many lines of codes are the existing transcompilers? What was approximately the effort in man hours for the existing transcompilers? </pre> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ powerloom-forum mailing list <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a> <a class="moz-txt-link-freetext" href="http://mailman.isi.edu/mailman/listinfo/powerloom-forum">http://mailman.isi.edu/mailman/listinfo/powerloom-forum</a> </pre> </blockquote> <br> </body> </html> --------------020002020803030102050601-- --===============1631330050== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 7bit _______________________________________________ powerloom-forum mailing list [email protected] http://mailman.isi.edu/mailman/listinfo/powerloom-forum --===============1631330050==--