Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell for the .net platform?

Tags:

.net

clr

haskell

I'm a .NET developer by day, but have been playing with Haskell in my spare time for awhile now. I'm curious: any Haskell .net implemenations in the same vein as IronPython?

like image 290
Will Avatar asked Jul 16 '10 21:07

Will


3 Answers

There's no active work on porting the GHC runtime to .NET.

F# is the closest thing, though be aware it is based on OCaml, and as such, isn't based on referential transparency by-default, as Haskell is.

like image 113
Don Stewart Avatar answered Nov 14 '22 17:11

Don Stewart


See hs-dotnet: Pragmatic .NET interop for Haskell

hs-dotnet is a pragmatic .NET interop layer for Haskell. It exposes both .NET classes to Haskell (via GHC) and Haskell function values to .NET.

like image 23
Contango Avatar answered Nov 14 '22 16:11

Contango


Haskell wouldn't readily work very well on .NET without some big changes to the runtime or maybe a really clever compiler.

Maybe things will change when code contracts permeate more, but right now, even functions that actually are pure in behavior, like the string manipulation functions, would have to be accessed via IO -- so it just wouldn't be worth it at all.

That, and there are optimization issues -- .NET doesn't do any optimizations for immutable objects, for instance, so lists (sequences as they're called in F#, or IEnumerable as they're called in C#) wouldn't be as efficient.

A Haskell IL compiler might be doable, like something that spits out .NET assemblies instead of x86 .exes/.dlls.

like image 10
Rei Miyasaka Avatar answered Nov 14 '22 15:11

Rei Miyasaka