Haskell IDEs on Windows

Haskell IDEs on Windows

I’m a Windows user. I do dabble with a little Ubuntu now and then but most of the time since I am running around a lot: uni, work, flat, parent’s home, gf… I tend to stick to one platform. So I said to myself, I can’t work with Haskell the way I am, writing code in Notepad++ and compiling manually in command prompt. (Well I can but I wanted to make things easier). My next logical question was: Is there possibly no IDE for my most fav language? Of course there is… so I look things up and find out that the two most popular beta IDEs are Leksah and EclipseFP2. Both Leksah and Eclipse work on windows as well! Perfect. Anyone would do!

Leksah
Since, I have worked with gtk and I liked it I went to Leksah first (ahem… there is also the new installer which kinda made the choice in the end for me). I installed it but I couldn’t figure out why it wouldn’t parse my installation’s modules. (I am using the Haskell Platform with ghc 6.10.3 for the pure reason that I want to work with gtk2hs and it currently supports that version.) At first it was due to my system’s lack of the tar application which I tried to fix using GNU Tar. Unfortunately the latter seems to be missing some fork mode so it didn’t work out. Is there any way to remedy this somehow or are there any step by step installations somewhere on how to install Leksah (I have followed the given instructions to no avail)?
Disclaimer: I can’t neglect the fact that I might have not managed to make it work due to lack of knowledge from my part.

EclipseFP2
After some hours I said… well lets try EclipseFP2. Now I know it was/still is in development but I said, lets give it a shot. Unfortunately I met with problems again:
1. I couldn’t get GHC to work with it even thought I set the Haskell implementation and the scion correctly.
2. I couldn’t make it show what errors my code contained as my console was blank all the time. When I opened the Errors view i found out that my error was due to a problem with:
Could not write file: D:\Eclipse Workspace\.metadata\.plugins\org.eclipse.debug.core\.launches\L\My Project\src. The folders were there up to .launches, the rest was non-existant.

So, I am sorry to say that neither of them worked for me. For now I am going back to Notepad++ and old command prompt. I want to make it clear that I am not saying that the developers who have worked on these IDEs should be ashamed of themselves but the direct opposite. By my attempts I am showing how I applaud their time spent on giving us an IDE. I just wish I was good enough to make the IDEs work myself but sadly I was not able to. I just hope that someday Haskell will have its own IDE or that someday soon I might get time to work on one of the projects myself. I sincerely believe that given the publicity given to Haskell by the various publications and books such as Real World Haskell, the only real thing missing from making this language more mainstream is an IDE. And unfortunately not just on Linux-based systems but also on Windows. We all have to admit that most mainstream people come from Windows: especially first year uni students attending their functional programming course (that’s how I met Haskell) and Java/.Net professional programmers who want to dabble in functional programming.

Anyways, three things:
1. If anyone managed to make Leksah or EclipseFP2 work well on their machines please let me know where I went wrong in the comments. I can’t stop stressing the fact that it could be something I missed.
2. What do you guys think is the future of Haskell’s IDE development?
3. What is the most common platform and compilation method most Haskellers use?
Let me know! 🙂

Edit: Gotta love this community!

1. Just minutes after my post I got a reply from Hamish Mackenzie link with tips on how to fix my problem. I am currently working on it with his help! Thanks!

2. I also asked Thomas ten Cate about EclipseFP2 on his website here and he has replied here.

Thanks both of you guys. 🙂

Edit 2: Leksah works, now EclipseFP2

1. Leksah works for me on Vista. Here is a screenshot as proof!

Coincidentally there is also some of 4Blocks’ code which I hope to release shortly, as soon as I have some time to figure out how to work with Cabal.

2. Going attempt to make EclipseFP2 work next. Since I need to pull the source from the live sources via github and I have never used the latter, it might take me some time. Or I can wait a bit as JP Moresmau seems to be working upon updating EclipseFP2.

To both teams: Keep up the great work. 🙂

17 comments

  1. Thanks for trying Leksah. A few quick things to check…

    Is ghc in your system PATH?

    Is it installed in a directory with spaces in it (for instance somewhere under Program Files)?

    Am I right in guessing the modules you were having trouble with are in the package you were working on and that they are not showing up in the modules pane for some reason? (as apposed packages installed on your system)

    Are the modules listed in “other-modules:” in your .cabal file?

    Do you reference the modules (directly or indirectly) from your main module?

    Did you build successfully the package (Ctrl+b)? (metadata collection does not happen after background builds or when using GHCi)

    A couple of things that may be relevant…
    Does your .cabal file contain more than one library or executable?
    Does your .cabal file include conditional expressions?

    Please open an issue describing the problem so we can track it properly
    http://code.google.com/p/leksah/issues/list

    1. Hi again,

      I checked whether the problem is due to an installation in a directory with spaces. To do this I re-installed ghc under “C:\Haskell\ghc\6.10.”3 and Leksah under “C:\Haskell\Leksah”. During the first run of Leksah when I am asked to give the place where my ghc sources are installed I added the “C:\Haskell\ghc\6.10.3”. Since removing the spaces, it seems the problems with tarring have gone. However, I am still unsure whether the metadata collection is working correctly though as on the console I am getting messages such as:
      Metadata collector has nothing to do
      Now updating metadata …
      Now collecting sources for haddock-2.4.2
      No source for package haddock-2.4.2
      Now collecting sources for rts-1.0
      No source for package rts-1.0

      CollectStatistics {packagesTotal = 61, packagesWithSource = 0, modulesTotal = 0,
      modulesWithSource = 0, parseFailures = 0}
      Now loading metadata …
      Finished loading …

      The Leksah window itself shows up but when I click the System tab I do not get any information about the modules installed on my system. I think the problem is due to something wrong on my side. Is the directory required: “C:\Haskell\ghc\6.10.3”?

      1. Even if the source is not found you should still see metadata for the packages registered with the version of ghc in the path (you just won’t get the comments from the source or be able to jump to the definition).

        I built and tested the Leksah windows installer using the Haskell platform 2009.2 (which uses 6.10.4), could you please try installing that and see if it works better (though I didn’t think the metadata system required the same version of ghc).

        If that does fix it I have some scripts that might help you build Gtk2Hs for 6.10.4.

    2. Good news. Yes, Haskell Platform 2009.2.0.2 with ghc 6.10.4 works 🙂

      Thanks for your support and keep up the awesome work!

      P.S. I would highly appreciate the scripts to install Gtk2Hs with 6.10.4!

      1. P.S. I would highly appreciate the scripts to install Gtk2Hs with 6.10.4!

        send me, please! eger[dog]hotmail.ru

  2. Hi Hamish Mackenzie, thanks for your prompt reply. I added some information about installing Leksah. My problem was with the metadata collection of the modules in my system. In the background window I saw that Leksah was trying to untar my system’s modules but was failing due to my system’s lack of the “tar” application. I tried to mitigate that by installing GNU Tar http://www.gnu.org/software/tar/tar.html but it seems to be missing a fork module and so it didn’t finish the collection correctly. The problem COULD be because of spaces but I cannot investigate right now. I will tomorrow ASAP and get back to you here.

    Thanks again for your reply once more. 🙂

  3. Haskell’s ‘IDE’ is ghci for me. Use commands like :l (load) and :r (reload) and integrate tools like hoogle. Building with Cabal is useful when you have a lot of modules that are mostly finished.

    If you want a true IDE then F# with Visual Studio is nice.

  4. I use Notepad++ at work and home, and Emacs at work. I would use Leksah, except:
    1) My projects are so small that an IDE just gets in the way;
    2) Leksah looks fantastic, given its roots, but it looks distinctly “Linux-y” – not necessarily a bad thing, but there it is;
    3) I have recently started trying out the Haskell Platform, which installs in the “Program Files” directory on Windows, for two (!) space-bearing directory names.
    Frankly, I’d likely work on Emacs at home, except I have Vista on an Intel x86_64, and system tools are still lacking on that setup. I could just use the 32-bit stuff – in fact, the binaries I use are 32-bit – but, I figure, what’s the point of having a 64-bit processor, that I can’t develop 64-bit programs on?

  5. I love using VIM, but syntax highlighting is all I get. I’d love some more features, such as inclusion of symbols (like Leksah). I’d love some language-specific features such as, perhaps, intellisense (yeah I’m dreaming) or some built-in features to compile without having to set up scripts and whatnot.

    Thanks for the post.

  6. I discovered Leksah only a few days ago, and must saw that I have been very impressed so far. I expect it will probably become the Haskell IDE of choice as it matures. (I’m afraid that I can’t offer any advice for the question in the post, as I’m working under Linux)

    For those chiming in on their preferred Haskell environment, I’ll highlight the reasons why Leksah may be worth trying.

    Pros
    * It uses the cabal package format and incorporates a cabal file editor.
    * It contains a module browser that allows you to find type information about all the functions/symbols available through the libraries/packages installed on your system.
    * Integrated ghci debugging (including continuous recompilation) that allows you to type check and evaluate highlighted code snippets from within the editor itself. Includes a scratch buffer for playing around.
    * Many standard features of IDEs (Syntax highlighting, auto completion, jump to errors, build packages)

    Cons, from my perspective
    * Integrated editor is not as capable as vim (also applies to every other IDE I have ever used).
    * In its current incarnation, Leksah can effectively run only one instance with one open package. I doubt this will be a problem for long.

    As an environment I’ve found it to be very impressive.

    1. Hi Matthew,
      great that you like Leksah so far.
      Just wanted to inform you, that we are currently working on the following:
      * Hamish works on integrating Yi as editor component.
      * I work on having the ability to work on multiple cabal projects at once, I call this the Workspace feature.
      So I’m happy I can say, we are just on the track of the Cons you mention.

  7. Hello!
    I’ve started to learn Haskell by my self a few days ago.
    And looked for an ide…found Leksah (duuh:) but failed to run it properly…
    From what i’ve read here …I need to reinstall haskell platform (preferably in directory C or it doesnt matter) as long as the directory doesnt have spaces between its name & after that install Leksah and it should work great…have i got it right so far? Please reply as soon as possible.Thanks

    1. Hi there,

      I’m afraid that Leksah has quite evolved since my last attempt to make use of it. Lately I had been making use of EclipseFP. When the new version of Leksah (0.8) was released I was tempted to try it but had different priorities (namely finishing my thesis documentation) so I had to postpone.

      There are some instrunctions here:
      http://leksah.org/docu.html
      and on the manual here:
      http://leksah.org/leksah_manual.pdf (Section 2.2)

      That said if i find a couple of minutes I will give it a shot and let you know here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.