Difference between revisions of "Common Language Runtime"

From HaskellWiki
Jump to navigation Jump to search
Line 18: Line 18:
 
'''Future directions?'''
 
'''Future directions?'''
   
[https://www.reddit.com/r/haskell/comments/37d5xh/286_microsoft_users_windows_and_net_express_their/ Surveys have show] that many people consider CLR support important or crucial for Haskell, but as far as I know few people are working on this.
+
[https://www.reddit.com/r/haskell/comments/37d5xh/286_microsoft_users_windows_and_net_express_their/ Surveys have shown] that many people consider CLR support important or crucial for Haskell, but as far as I know few people are working on this.
   
 
I for one, am actually making a CLR <-> Haskell bridge the primary project of my free time, but my free time is rather limited. It would be great if others could help out in this space, by either contributing to Salsa, or my new 'clr' project (very early work in progress):
 
I for one, am actually making a CLR <-> Haskell bridge the primary project of my free time, but my free time is rather limited. It would be great if others could help out in this space, by either contributing to Salsa, or my new 'clr' project (very early work in progress):

Revision as of 01:16, 21 August 2016

Question:

Can I use Haskell with the CLR (common language runtime). In other words .Net / Mono / CoreCLR?

Answer:

If you're looking for a way to run Haskell on (aka target) the CLR, then the short answer is you can't. A resonable approach to hacking this up you're selves might be to work on GHC backend that outputs common intermediate language (aka MSIL), and perhaps via the LLVM backend? The GCH JS crew have made some good progress on creating a new target for GHC so it's doable at least.

If you're instead looking for a way to bridge between the Haskell & CLR eco systems, then reality for you isn't quite as grim.

There was the pragmatic hs-dotnet package. This might be considered dead by now, though experiment as you please and update the wiki with your results.

Another, not so dead alternative is Salsa. A common misconception is that: "Haskell's type system has no way to represent inheritance, overloading or method calls". This is false (if for practical reasons we consider GHC = Haskell), and Salsa is library that has proven that these can indeed be encoded with the current state of GHC's type features.

While Salsa is not quite dead, it also doesn't have an automated build system, and the copy on Hackage doesn't get updated. To give this spin, head over to github page, and follow the READMEs carefully. It it also the only Mono compatible solution (but again, may require manual steps - you'll likely need to pass in an "--extra-include-dirs=" param)

Future directions?

Surveys have shown that many people consider CLR support important or crucial for Haskell, but as far as I know few people are working on this.

I for one, am actually making a CLR <-> Haskell bridge the primary project of my free time, but my free time is rather limited. It would be great if others could help out in this space, by either contributing to Salsa, or my new 'clr' project (very early work in progress):