[Haskell-cafe] Lazy language on JVM/CLR

John Meacham john at repetae.net
Mon Feb 8 20:16:59 EST 2010


On Tue, Feb 09, 2010 at 10:42:26AM +1000, Tony Morris wrote:
> I have hypothesised a pure, lazy language on the JVM and perhaps the
> .NET CLR with FFI to .NET/Java libraries. I foresee various problems but
> none that are catastrophic; just often requiring a compromises,
> sometimes very unattractive compromises. I have authored several
> libraries in the same vain as pure, lazy programming to run on the JVM
> in Java and Scala programming languages.

Yes, I have done some design work on a JVM back end for JHC, which seems
quite doable and has been on my todo list for a while.

> I expect others have forethought and perhaps even experimented with such
> a language. Are there any dangers to be wary of that undo the entire
> endeavour?

There have been a couple papers published on it, the main sticking point
seems to be tail call elimination. When targeting real hardware you
always had the option of dropping to assembly to do a direct jump, but
there isn't an equivalent in the JVM. If you look up tail call + jvm you
will probably get a few hits. I believe there are even a couple haskell
specific papers on the issue.


If you just want something that works and isn't necessarily the most
efficient, you can do something like implement the G-machine in java,
you would then have a VM on a VM though.. but it would work and be
straightforward.

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the Haskell-Cafe mailing list