
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

Hi, The only thing I can think of is GCJNI: http://www.haskell.org/gcjni/ This makes use of the FFI and a Greencarded Java JNI interface. It does allow you to call Java programs from Haskell. However, I'm not sure if it is still supported. hth, Chris. On Tue, 9 Sep 2008, [ISO-8859-1] Maurício 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 http://www.haskell.org/mailman/listinfo/haskell-cafe

It's not haskell to java compiler but you might find cohatoe and
eclipsefp interesting:
http://cohatoe.blogspot.com/
http://eclipsefp.sourceforge.net/
Donnchadh
2008/9/9 Maurício
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 http://www.haskell.org/mailman/listinfo/haskell-cafe

Hello Mauricio, Tuesday, September 9, 2008, 1:36:09 PM, you wrote:
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?
http://haskell.org/haskellwiki/Applications_and_libraries/Interfacing_other_... in particular, GreenCard doesn't work with ghc >= 6.2
Is there a a Haskell to Java compiler that's already ready to use?
CAL -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Bulat Ziganshin wrote:
Is there a a Haskell to Java compiler that's already ready to use?
CAL
Just in case this answer was a bit cryptic for the original poster... What Bulat means is the following: http://labs.businessobjects.com/cal/ -- Dr. Janis Voigtlaender http://wwwtcs.inf.tu-dresden.de/~voigt/ mailto:voigt@tcs.inf.tu-dresden.de

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
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 http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Daryoush Weblog: http://perlustration.blogspot.com/

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
mailto:briqueabraque@yahoo.com> 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

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
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
> 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/

Maurício 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?
Generally speaking, not really. There was a lot of work around the turn of the century, but all of it seems to have dried up and been replaced by Scala. I can give you some links on various projects, but so far as I know there's nothing that's still being maintained/developed so I wouldn't suggest any of them for work. I don't know much about Scala, though there are a few folks on Planet Haskell who do. If you're looking for a Haskell-like functional language for the JVM, it may be for you. -- Live well, ~wren

2008/9/9 Maurício
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?
Besides the other approaches people have suggested, maybe you could use a combination of the Haskell FFI and JNI (Java Native Interface) or JNA (Java Native Access). I have no idea how practical this would be, and it would only work on platforms where you can compile Haskell to native code rather than on any JVM, but if that's OK it might be worth exploring. If you want to call Haskell functions from Java, it seems to me it should be possible to write FFI export declarations for the Haskell functions you want to use from Java, and write a C wrapper to package the exported functions for JNI as if they were native C functions. With JNA you might be able to avoid writing a C wrapper, although I know even less about JNA than I do about JNI. It should also be possible to go the other way if you want to call Java code from Haskell, at least with JNI but possibly not with JNA. Andy

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

On Wed, Sep 10, 2008 at 02:12:00PM +0200, Marc Weber wrote:
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
* 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. -Brian

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
* 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

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

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_... We could add something like "if you want something working regarding the interaction between Haskell and Java, please nag Brian Alliet at brian@..." Best, Maurício

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

On Wed, Sep 10, 2008 at 05:35:20PM -0400, Brian Alliet wrote:
On Wed, Sep 10, 2008 at 02:12:00PM +0200, Marc Weber wrote:
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
* 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.
I for one would welcome the ability to compile Haskell programs into Java bytecode. One issue I have right now is the ability to get my code into the hands of a wide audience, since the Haskell toolchain is not widely installed by default. That and I tend to use a ton of Haskell modules, and there isn't a "just install all the deps" in ghc yet ;-) -- John

+1
Due to the commercial environment I work in, there's really no chance
of me using Haskell at work unless it runs under JVM or CLR. Brian,
consider yourself nagged! And if there's anywhere you need some help,
please yell.
Neil
On Fri, Sep 12, 2008 at 8:44 AM, John Goerzen
On Wed, Sep 10, 2008 at 05:35:20PM -0400, Brian Alliet wrote:
On Wed, Sep 10, 2008 at 02:12:00PM +0200, Marc Weber wrote:
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
* 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.
I for one would welcome the ability to compile Haskell programs into Java bytecode. One issue I have right now is the ability to get my code into the hands of a wide audience, since the Haskell toolchain is not widely installed by default. That and I tend to use a ton of Haskell modules, and there isn't a "just install all the deps" in ghc yet ;-)
-- John _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Marc Weber wrote:
There used to be. http://www.cs.rit.edu/~bja8464/lambdavm/
My God... so it exists already? Heh, and to think I was going to try to implement this... ;-)
participants (14)
-
Andrew Coppin
-
Andy Smith
-
Brian Alliet
-
Bulat Ziganshin
-
C.M.Brown
-
Daryoush Mehrtash
-
Donnchadh Ó Donnabháin
-
Janis Voigtlaender
-
John Goerzen
-
Marc Weber
-
Mauricio
-
Maurício
-
Neil Bartlett
-
wren ng thornton