[Haskell-cafe] Haskell and JVM

Krasimir Angelov kr.angelov at gmail.com
Thu Feb 2 10:34:23 EST 2006

Questions about Haskell for JVM or .NET was asked quite often and it
is really interesting question. Since the JVM and .NET machines have a
lot of common if there was a compiler for one of them then it can
retargeted to the other quite easily. The major problem with such
compilers is the performance. Many attempts exists but no one has
managed to build a complete solution. There are several major

  - How to represent the G/STG machine stack in JVM/.NET? The naive
solution is to use an array but it is proven to be inefficient.
  - How to minimize the runtime typecasts? They are necessary because
the JVM/.NET type system is a lot weaker than the Haskell's one.
  - How to efficiently represent the IO monad and exceptions?
  - How to make the integration of Haskell with Java/C# easier?

Since usually the performance of all VM languages is worse than those
of the native compiled (C/C++), I think that it is acceptable for
Haskell for JVM/.NET to be slower than GHC for example. Even that if
the performance isn't so worse then it will be usable since it can be
used in existing Java/.NET projects.


2006/2/2, Arnaud Bailly <abailly at norsys.fr>:
> Hello,
> I stumbled upon your discussion on haskell-cafe and this theme seems to pop
> up one time or another. If someone is interested, I have some Java
> code for compiling Haskell98 to bytecode that I would be more than
> willing to share. It is not in the best shape and does not implement
> all of haskell but most low-level work to generate classes and
> bytecode from haskell code is implemented (patternmatching, data
> constructors, lazy functions, ...).
> This is a project I started some years ago and used for specification
> of simple functional behaviour (without complex type system) in Java.
> Regards,
> --
> Arnaud Bailly, Dr. - Ingénieur de Recherche
> 1, rue de la Cense des Raines
> ZAC du Moulin
> Tel : (33) 3 28 76 56 76
> Mob : (33) 6 17 12 19 78
> Fax : (33) 3 28 76 57 00
> Web : http://www.norsys.fr
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list