Lambada and connecting Haskell to a Weblogic server

Folks, Where can I find Lambada these days and would it be of any use to me in trying to connect to a Weblogic server? To make the long story short, my broker's Java software connects to a remote Weblogic server and I would like to do the same. I suppose this would require me to implement Java RMI in Haskell which is non- trivial. I wonder if it would be easier for me to implement a Java server that talks to Weblogic and then connect to that server. What do you think? Thanks, Joel -- http://wagerlabs.com/

Joel, Implementing Java RMI in Haskell sounds like a nightmare. Why not use HTTP? You could easily write a wrapper Servlet that speaks XML or JSON over HTTP, and deploy that to the Weblogic server. Unless you don't have permission to deploy anything to that server for whatever reason. Alternatively, how about AMQP ;-) Regards Neil On 11 Feb 2007, at 01:50, Joel Reymont wrote:
Folks,
Where can I find Lambada these days and would it be of any use to me in trying to connect to a Weblogic server?
To make the long story short, my broker's Java software connects to a remote Weblogic server and I would like to do the same. I suppose this would require me to implement Java RMI in Haskell which is non- trivial.
I wonder if it would be easier for me to implement a Java server that talks to Weblogic and then connect to that server. What do you think?
Thanks, Joel
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

You should check out Brian Alliet's LambdaVM:
http://www.cs.rit.edu/~bja8464/lambdavm/
- a
Joel Reymont
Folks,
Where can I find Lambada these days and would it be of any use to me in trying to connect to a Weblogic server?
To make the long story short, my broker's Java software connects to a remote Weblogic server and I would like to do the same. I suppose this would require me to implement Java RMI in Haskell which is non- trivial.
I wonder if it would be easier for me to implement a Java server that talks to Weblogic and then connect to that server. What do you think?
Thanks, Joel
-- PGP/GPG: 5C9F F366 C9CF 2145 E770 B1B8 EFB1 462D A146 C380

Adam Megacz
You should check out Brian Alliet's LambdaVM:
That looks very interesting. We'd been wondering if there was some route from GHC core to Scheme through Bigloo or Kawa to the JVM, but something more direct is nicer. Is it easy to create Haskell stubs (in the IO monad, presumably) for standard Java libraries so that your compiled-to-JVM Haskell code can easily use the usual Java APIs like Swing? One source of vexation for us is mapping between Java types and Haskell types. -- Mark

mark@ixod.org (Mark T.B. Carroll) writes:
Is it easy to create Haskell stubs (in the IO monad, presumably) for standard Java libraries so that your compiled-to-JVM Haskell code can easily use the usual Java APIs like Swing? One source of vexation for us is mapping between Java types and Haskell types.
Unbelievably easy -- check out his source code. It works just like the C FFI. ... foreign import jvm safe "getHead" getHead :: JTree -> IO (Object a) foreign import jvm safe "child" getChild :: JTree -> Int32 -> IO JTree foreign import jvm safe "size" size :: JTree -> IO Int32 foreign import jvm safe "toString" jtoString :: (Object a) -> IO JString ... - a -- PGP/GPG: 5C9F F366 C9CF 2145 E770 B1B8 EFB1 462D A146 C380

On Thu, Feb 15, 2007 at 02:53:47PM -0500, Mark T.B. Carroll wrote:
Is it easy to create Haskell stubs (in the IO monad, presumably) for standard Java libraries so that your compiled-to-JVM Haskell code can easily use the usual Java APIs like Swing? One source of vexation for us is mapping between Java types and Haskell types.
Yep. Normal FFI style foreign imports work. foreign import jvm unsafe "java.lang.Character.isDigit" isDigit :: Int -> Bool -Brian

Hello Brian
I wrote you on this just some hours ago, before I had looked through
haskell-cafe! That's an interesting coincidence!
Anyway, moving my questions here.
1.
How easy is it to interoperate with Java code (call methods, pass Java
objects) for Haskell code run by LambdaVM rts? And vice versa, can
Haskell code be called in a more flexible way than calling Main.main
with String[] ?
Looking at the discussion, I see that foreign import works great. What
about foreign export?
1a.
What about types? It seems like Bool in your example is automatically
mapped to java type boolean. And in the Adam Megacz's example, where
and how are JTree and JString defined?
2.
As far as I understand, currently, GHC doesn't allow to catch
out-of-memory exception in any way, it simpy exits. This prevents from
gracefully catching this error in Java code (JVM terminates), unlike
many other errors, like paterrn match failure, undefined, etc.
Is this error reported like a Java exception in LambdaVM rts?
2007/2/15, Brian Alliet
On Thu, Feb 15, 2007 at 02:53:47PM -0500, Mark T.B. Carroll wrote:
Is it easy to create Haskell stubs (in the IO monad, presumably) for standard Java libraries so that your compiled-to-JVM Haskell code can easily use the usual Java APIs like Swing? One source of vexation for us is mapping between Java types and Haskell types.
Yep. Normal FFI style foreign imports work.
foreign import jvm unsafe "java.lang.Character.isDigit" isDigit :: Int -> Bool

On Thu, Feb 15, 2007 at 11:24:31AM -0800, Adam Megacz wrote:
You should check out Brian Alliet's LambdaVM:
I think what is in darcs is actually broken right now (the base repo is out of sync with the ghc repo), but thanks for giving me a big incentive to fix it. If anyone is interested in playing with it drop me an email and I'll let you know when it works again. -Brian
participants (6)
-
Adam Megacz
-
Brian Alliet
-
Daniil Elovkov
-
Joel Reymont
-
mark@ixod.org
-
Neil Bartlett