David Leimbach | 11 Oct 18:06

Haskell on the JVM

Are there, or have there been Haskell ports to the JVM?  Are any of them alive and well?

Is there an interest in hosting GHC on the JVM (besides my own).

I know I don't have time to tackle such a project but I'd be extremely interested in using such a thing.  Especially in my day to day work.  I currently do a lot of Java <-> Erlang via JInterface, and have been for months, yet there's many tasks I could do better in a language like Haskell.


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
John A. De Goes | 11 Oct 18:45

Re: Haskell on the JVM


LamdaVM was the only full-fledged effort to port Haskell to the JVM,  
and like most graduate school projects, the project is now dead.

I have strong interest in hosting GHC on the JVM. And I suspect it  
would be good for the Haskell community, as the JVM already runs on  
nearly every machine known to man, has a wealth of cross-platform  
libraries, and is getting improved support for dynamic and functional  
languages (method handles, tail call).

Regards,

John A. De Goes
N-BRAIN, Inc.
http://www.n-brain.net
[n minds are better than n-1]

On Oct 11, 2008, at 10:07 AM, David Leimbach wrote:

> Are there, or have there been Haskell ports to the JVM?  Are any of  
> them alive and well?
>
> Is there an interest in hosting GHC on the JVM (besides my own).
>
> I know I don't have time to tackle such a project but I'd be  
> extremely interested in using such a thing.  Especially in my day to  
> day work.  I currently do a lot of Java <-> Erlang via JInterface,  
> and have been for months, yet there's many tasks I could do better  
> in a language like Haskell.
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
Jon Harrop | 12 Oct 12:19

Re: Haskell on the JVM

On Saturday 11 October 2008 17:45:39 John A. De Goes wrote:
> I have strong interest in hosting GHC on the JVM. And I suspect it
> would be good for the Haskell community, as the JVM already runs on
> nearly every machine known to man, has a wealth of cross-platform
> libraries, and is getting improved support for dynamic and functional
> languages (method handles, tail call).

The JVM has been about to get basic features like tail calls for several years 
now.

--

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e
Jan-Willem Maessen | 12 Oct 15:19
Favicon

Re: Haskell on the JVM


On Oct 12, 2008, at 6:19 AM, Jon Harrop wrote:

> On Saturday 11 October 2008 17:45:39 John A. De Goes wrote:
>> I have strong interest in hosting GHC on the JVM. And I suspect it
>> would be good for the Haskell community, as the JVM already runs on
>> nearly every machine known to man, has a wealth of cross-platform
>> libraries, and is getting improved support for dynamic and functional
>> languages (method handles, tail call).
>
> The JVM has been about to get basic features like tail calls for  
> several years
> now.

As a gentle correction of fact, while folks have been *asking* for  
tail calls in the JVM for over 10 years, it's only in the last year or  
two that there's actually been support from VM implementors for their  
inclusion.  I've had specific discussions with JVM folks on this very  
topic on numerous occasions over the last 5 years.  [I can't speak to  
what other "basic features" might have been slated for inclusion  
"several years ago"; I'll note that invokedynamic has been slated for  
inclusion for much longer, but required some wrangling between  
competing VM implementors and language designers to actually settle on  
an implementable spec.  The result looks nothing at all like my memory  
of the original proposal.]

Back to your regularly scheduled Haskell discussion.

-Jan

> -- 
> Dr Jon Harrop, Flying Frog Consultancy Ltd.
> http://www.ffconsultancy.com/?e
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
frantisek kocun | 12 Oct 17:32

Re: Haskell on the JVM

There is CAL language (purely functional, very Haskell like, the most I have seen). CAL Eclipse plugin (IDE for CAL for non java-ers) is incredible, with support for code comletition, documentation, refactor, code navigation.. They have graphical editor GemCutter for it as well. You can use java libraries within it with unsafe imports or call cal function from java or there is even embedded CAL in Java:)

Check out: http://openquark.org
Embeded CAL: http://groups.google.com/group/cal_language/web/embedded-cal


This is from CAL for Haskell Programmers:
CAL implements essentially all the non-syntactic sugar features of Haskell 98 (with its standard
addendums) including:
• algebraic functions with parametric polymorphism and inferred types
o type declarations can specialize or assert types
• data declarations for algebraic types
o strictness flags for data constructor arguments
• a module system supporting separate compilation
• expression syntax supporting if-then-else, case, let (for both local variable and function definitions)
and lambda expressions
o support for most of Haskell's expression operators
• special syntax for tuples, strings, characters, numbers and lists
• an extensive collection of standard libraries
• single parameter type classes
o superclasses
o derived instances, such as the instance declaration for Eq List
o deriving clauses for common classes
o default class method definitions
o higher-kinded type variables, such as with the Functor type class
• dynamics support via the Typeable type class and Dynamic type
• user documentation generated from source code (similar to Haddock)
• foreign function support
• hierarchical module names

Another interesting project is COHATOE (contributing Haskell to Eclipse) by which one can write Haskell plugins to Eclipse, but I have no clue how it works.
http://eclipsefp.sourceforge.net/cohatoe/

Fero
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
frantisek kocun | 13 Oct 21:04

Re: Haskell on the JVM

Sorry,
as Chris Eidhof replied to me CAL is not pure. I was only playing with GemCutter, I don't use CAL so I didn't know.

Fero

On Sun, Oct 12, 2008 at 5:32 PM, frantisek kocun <frantisek.kocun <at> gmail.com> wrote:
There is CAL language (purely functional, very Haskell like, the most I have seen). CAL Eclipse plugin (IDE for CAL for non java-ers) is incredible, with support for code comletition, documentation, refactor, code navigation.. They have graphical editor GemCutter for it as well. You can use java libraries within it with unsafe imports or call cal function from java or there is even embedded CAL in Java:)

Check out: http://openquark.org
Embeded CAL: http://groups.google.com/group/cal_language/web/embedded-cal


This is from CAL for Haskell Programmers:
CAL implements essentially all the non-syntactic sugar features of Haskell 98 (with its standard
addendums) including:
• algebraic functions with parametric polymorphism and inferred types
o type declarations can specialize or assert types
• data declarations for algebraic types
o strictness flags for data constructor arguments
• a module system supporting separate compilation
• expression syntax supporting if-then-else, case, let (for both local variable and function definitions)
and lambda expressions
o support for most of Haskell's expression operators
• special syntax for tuples, strings, characters, numbers and lists
• an extensive collection of standard libraries
• single parameter type classes
o superclasses
o derived instances, such as the instance declaration for Eq List
o deriving clauses for common classes
o default class method definitions
o higher-kinded type variables, such as with the Functor type class
• dynamics support via the Typeable type class and Dynamic type
• user documentation generated from source code (similar to Haddock)
• foreign function support
• hierarchical module names

Another interesting project is COHATOE (contributing Haskell to Eclipse) by which one can write Haskell plugins to Eclipse, but I have no clue how it works.
http://eclipsefp.sourceforge.net/cohatoe/

Fero

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Favicon

Re: Haskell on the JVM

On 2008 Oct 11, at 12:07, David Leimbach wrote:
Are there, or have there been Haskell ports to the JVM?  Are any of them alive and well?

YHC, last I heard, was alive and well and there's a YHC Core backend for the JVM.

Is there an interest in hosting GHC on the JVM (besides my own).

There's interest but my understanding is that the GHC backend architecture is not at all friendly to work with.  That said, I hear in the next release (I think 6.12, not the 6.10 that's in beta) will have a redesigned backend architecture that is supposed to be much easier to work with, which will make it easier to provide native code generators for many currently poorly-served platforms --- including the JVM if anyone is so inclined.

You might want to ask on glasgow-haskell-users to get the people who really know.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery <at> kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery <at> ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
John A. De Goes | 11 Oct 19:30

Re: Haskell on the JVM


There's a YHC that can compile to JavaScript, and JavaScript can be run on Java...

Which means, practically speaking, there is no YHC backend for the JVM.

Regards,

John A. De Goes
N-BRAIN, Inc.
[n minds are better than n-1]

On Oct 11, 2008, at 11:08 AM, Brandon S. Allbery KF8NH wrote:

On 2008 Oct 11, at 12:07, David Leimbach wrote:
Are there, or have there been Haskell ports to the JVM?  Are any of them alive and well?

YHC, last I heard, was alive and well and there's a YHC Core backend for the JVM.

Is there an interest in hosting GHC on the JVM (besides my own).

There's interest but my understanding is that the GHC backend architecture is not at all friendly to work with.  That said, I hear in the next release (I think 6.12, not the 6.10 that's in beta) will have a redesigned backend architecture that is supposed to be much easier to work with, which will make it easier to provide native code generators for many currently poorly-served platforms --- including the JVM if anyone is so inclined.

You might want to ask on glasgow-haskell-users to get the people who really know.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery <at> kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery <at> ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Simon Peyton-Jones | 27 Oct 11:58

RE: Haskell on the JVM

 

Is there an interest in hosting GHC on the JVM (besides my own).

 

There's interest but my understanding is that the GHC backend architecture is not at all friendly to work with.  That said, I hear in the next release (I think 6.12, not the 6.10 that's in beta) will have a redesigned backend architecture that is supposed to be much easier to work with, which will make it easier to provide native code generators for many currently poorly-served platforms --- including the JVM if anyone is so inclined.



 

I don’t think it’s so hard to translate GHC’s Core language to the JVM.  Apart from the treatment of tail recursion, for which various hacks are available.  Eg Scala manages it.  I don’t think you want the C-- level (which is what the “redesigned back end” is about).

 

However, there’s more to it than generating bytecode:

 

http://haskell.org/haskellwiki/GHC:FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F

 

It’d be a good project though!

 

Simon

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Brian Alliet | 27 Oct 20:02

Re: Haskell on the JVM

On Mon, Oct 27, 2008 at 10:58:11AM +0000, Simon Peyton-Jones wrote:
> Is there an interest in hosting GHC on the JVM (besides my own).

Yep. I wrote a JVM backend for GHC (LambdaVM). It is suffering from
bit-rot though. I think this thread has re-spaked my interest in it
though.

> I don't think it's so hard to translate GHC's Core language to the
> JVM.  

Definitely not. That is more or less the route I took (I actually
transform STG it into yet another simple intermediate laguage that is
more JVM friendly, this was more for optimization purposes though).
While C-- looks fantastic for generating native code, it just didn't
seem worth the effort to shoehorn it into the JVM. Although I haven't
looked at any of the new backend stuff, I suspect it still won't be
suitable for the JVM.

-Brian
David Leimbach | 27 Oct 21:57

Re: Haskell on the JVM



On Mon, Oct 27, 2008 at 12:02 PM, Brian Alliet <brian <at> brianweb.net> wrote:
On Mon, Oct 27, 2008 at 10:58:11AM +0000, Simon Peyton-Jones wrote:
> Is there an interest in hosting GHC on the JVM (besides my own).

Yep. I wrote a JVM backend for GHC (LambdaVM). It is suffering from
bit-rot though. I think this thread has re-spaked my interest in it
though.

> I don't think it's so hard to translate GHC's Core language to the
> JVM.

Definitely not. That is more or less the route I took (I actually
transform STG it into yet another simple intermediate laguage that is
more JVM friendly, this was more for optimization purposes though).
While C-- looks fantastic for generating native code, it just didn't
seem worth the effort to shoehorn it into the JVM. Although I haven't
looked at any of the new backend stuff, I suspect it still won't be
suitable for the JVM.

-Brian
_____

Being able to integrate Haskell into a rather large Java codebase might have made me not choose Erlang.  Luckily, the OTP Erlang distribution had a lot of other really desirable features for the project I was working, yet I feel the lack of strong type checking hurt my productivity a bit, especially when trying to come up with a way to specify the real INs and OUTs between the Java and the Erlang code in terms of types.  

The right way to solve that problem is with a stronger specification between the Java team, and the Erlang team (aka me), however, it was still a really positive experience in the ways of functional programming, and I suppose I could have used Haskell to generate the glue between Java and Erlang had I been a better Haskeller :-).

 
__________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
John A. De Goes | 27 Oct 22:54

Re: Haskell on the JVM


Please, oh please, get it into GHC Head! You'll be my hero.

Regards,

John A. De Goes
N-BRAIN, Inc.
http://www.n-brain.net
[n minds are better than n-1]

On Oct 27, 2008, at 3:02 PM, Brian Alliet wrote:

> On Mon, Oct 27, 2008 at 10:58:11AM +0000, Simon Peyton-Jones wrote:
>> Is there an interest in hosting GHC on the JVM (besides my own).
>
> Yep. I wrote a JVM backend for GHC (LambdaVM). It is suffering from
> bit-rot though. I think this thread has re-spaked my interest in it
> though.
>
>> I don't think it's so hard to translate GHC's Core language to the
>> JVM.
>
> Definitely not. That is more or less the route I took (I actually
> transform STG it into yet another simple intermediate laguage that is
> more JVM friendly, this was more for optimization purposes though).
> While C-- looks fantastic for generating native code, it just didn't
> seem worth the effort to shoehorn it into the JVM. Although I haven't
> looked at any of the new backend stuff, I suspect it still won't be
> suitable for the JVM.
>
> -Brian
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
Sean Leather | 11 Oct 20:21

Re: Haskell on the JVM

Are there, or have there been Haskell ports to the JVM?  Are any of them alive and well?

See the thread started 9 September on "Haskell and Java":

http://thread.gmane.org/gmane.comp.lang.haskell.cafe/44252

Sean
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane