[Haskell-cafe] Re: Haskell and Java interaction
The bridging projects are all dead and unsupported. You can still do it, but you'll have to write Haskell wrappers that use C types, then write C code that calls the wrapped Haskell code, then write JNI code to call the C code from Java. http://www.haskell.org/haskellwiki/Calling_Haskell_from_C There was a promising thesis project called LambdaVM that allowed you to compile Haskell to JVM byte codes, but it suffered the same fate as all thesis projects. Regards, John A. De Goes N-BRAIN, Inc. The Evolution of Collaboration http://www.n-brain.net|877-376-2724 x 101 On Feb 9, 2009, at 8:56 AM, Silviu ANDRICA wrote: Hello, I was wondering if there is a way to call Haskell code from Java. I tried using jvm-bridge(http://sourceforge.net/projects/jvm-bridge/), but I'm stuck on building it. Thank you very much, Silviu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Haskell and Java
Sorry about this. I hit a critical mass of darcs conflicts (I look forward to giving git a try) around the same time I got really busy at work. I've been meaning to get back into it (and update it to GHC HEAD) but I haven't received sufficient nagging yet. Please yell if you're interested in LambdaVM. At the very least I should be able to help get whatever is in darcs compiling. Would it allow allow Haskell to also call Java code, besides running in JVM? I think I'm not enough to nag you alone. If you're looking for more people to nag you... I'm working on a compiler for a new declarative language. Right now we're using Haskell for a proof-of-concept interpreter, though one of the near-term goals for the compiler itself is a Java FFI/backend. Since much of the language is in the runtime engine, it'd be a shame to have to rewrite it all in Java or deal with the horror of JNI. We can use this page, already pointed on this thread: http://haskell.org/haskellwiki/Applications_and_libraries/Interfacing_other_languages#Java We could add something like if you want something working regarding the interaction between Haskell and Java, please nag Brian Alliet at [EMAIL PROTECTED] Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Haskell and Java
On Wed, Sep 10, 2008 at 09:50:36PM -0300, Mauricio wrote: Would it allow allow Haskell to also call Java code, besides running in JVM? Yep. LambdaVM can fully access existing Java code. The base library heavily uses FFI to access java.io.* to implement Handle, etc. 'foreign export' even works so you can call back into Haskell from Java. For more information see: http://wiki.brianweb.net/LambdaVM/FFI -Brian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Haskell and Java
At this time It's not really a question of better implementation, but cooperation. I know Haskell, they know Java, and it would be nice if we could share code and work. The idea of the api, or maybe dbus, seems OK. It just would be easier if we could join everything in a single piece, but it is no big deal. Maurício Daryoush Mehrtash a écrit : Why do you want to mix haskall and Java in one VM? If there are functionality within your code that is better implemented in haskell, then why not make that into a service (run it as haskell) with some api that Java code can use. Daryoush On Tue, Sep 9, 2008 at 2:36 AM, Maurício [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, I use Haskell, and my friends at work use Java. Do you think it could be a good idea to use Haskell with Java, so I could understand and cooperate with them? Is there a a Haskell to Java compiler that's already ready to use? Thanks, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Daryoush Weblog: http://perlustration.blogspot.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Haskell and Java
As people have suggested on this list, in order to write a haskell program you need to develop a mathematical model which requires some serious up front thinking. Writing java code on the other hand is more about coding and then re-factoring. 'Thinking is discouraged (agile), as the design is more about how you organize your objects for the illusive reuse and future requirements than anything else. The approach make sense if you consider design as an excersize in object organization as you would have better idea on the object organization (aka design) as you plow through the code. On the other hand if you have a mathematical idea, then a language like java doesn't give you the abstraction tools necessary to implement it as well as a language like Haskell. But if you don't have a model, then java's approach may be more natural (as is evenident by its popularity) It seems to me that the two can work side by side if you model your application in Service Oriented Architecture. I think the boundries of the services should be thought of as langauges rather than api (function calls). Two different examples that comes to mind are the SQL and Google Chart. A Java programmer doesn't care about the SQL Server implementation, but it depends on its query langauge to create the tables, populate them, and issue rather complicated queries on them. Google Chart is interesting in that it porvideds a language in a URL to implement a service that has been traditionally considered as library. I would think if you can defines such services in your application then you can define a langaugage and mathematical model around it to implement the service in Haskell. Daryoush On Wed, Sep 10, 2008 at 5:01 AM, Mauricio [EMAIL PROTECTED] wrote: At this time It's not really a question of better implementation, but cooperation. I know Haskell, they know Java, and it would be nice if we could share code and work. The idea of the api, or maybe dbus, seems OK. It just would be easier if we could join everything in a single piece, but it is no big deal. Maurício Daryoush Mehrtash a écrit : Why do you want to mix haskall and Java in one VM? If there are functionality within your code that is better implemented in haskell, then why not make that into a service (run it as haskell) with some api that Java code can use. Daryoush On Tue, Sep 9, 2008 at 2:36 AM, Maurício [EMAIL PROTECTED]mailto: [EMAIL PROTECTED] wrote: Hi, I use Haskell, and my friends at work use Java. Do you think it could be a good idea to use Haskell with Java, so I could understand and cooperate with them? Is there a a Haskell to Java compiler that's already ready to use? Thanks, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Daryoush Weblog: http://perlustration.blogspot.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Daryoush Weblog: http://perlustration.blogspot.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Haskell and Java
There used to be. http://www.cs.rit.edu/~bja8464/lambdavm/ (Last darcs change log entry: Sun Oct 21 03:05:20 CEST 2007 Brian Alliet [EMAIL PROTECTED] * fix build for hsjava change ) Sorry about this. I hit a critical mass of darcs conflicts (I look forward to giving git a try) around the same time I got really busy at work. I've been meaning to get back into it (and update it to GHC HEAD) but I haven't received sufficient nagging yet. Please yell if you're interested in LambdaVM. At the very least I should be able to help get whatever is in darcs compiling. Would it allow allow Haskell to also call Java code, besides running in JVM? I think I'm not enough to nag you alone. However, anybody who allows a Haskell programmer to avoid using other languages can be sure to have brought a lot of happiness to this sad world. If you can do it, I don't know how you can resist :) Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Haskell and Java
Mauricio wrote: Sorry about this. I hit a critical mass of darcs conflicts (I look forward to giving git a try) around the same time I got really busy at work. I've been meaning to get back into it (and update it to GHC HEAD) but I haven't received sufficient nagging yet. Please yell if you're interested in LambdaVM. At the very least I should be able to help get whatever is in darcs compiling. Would it allow allow Haskell to also call Java code, besides running in JVM? I think I'm not enough to nag you alone. If you're looking for more people to nag you... I'm working on a compiler for a new declarative language. Right now we're using Haskell for a proof-of-concept interpreter, though one of the near-term goals for the compiler itself is a Java FFI/backend. Since much of the language is in the runtime engine, it'd be a shame to have to rewrite it all in Java or deal with the horror of JNI. -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe