Project description

In this post, I will describe what my project is all about. What is it that I intend to do, why do I intend to do it, and how?

Haskell is a pure functional programming language. Pure functional means that the entire program is treated as the evaluation of an expression; the word pure indicates that such an expression can have no side effects. Hence, no modification of variables, no reading from disk, no drawing to the screen. Of course Haskell wouldn’t be very useful if it couldn’t do all those things, but indeed it can. The language is now growing out from its origins in computer science research, as more and more people begin to realize that purity and strict typing are good things. Although the initial effort that goes into a program may be a bit more than with more mainstream languages, these language features guarantee a certain degree of correctness that impure, dynamically typed, or imperative languages can never achieve.

However, I believe that the further acceptance of Haskell is held back by a lack of tooling. There is an great compiler, great libraries and a great package management system, but there is no really great IDE (Integrated Development Environment). A good IDE would not only be a great time saver for seasoned Haskell developers; it would also be of much assistance to newbies who want to learn the language.

There is Leksah (Haskell spelled backwards, missing an L), but it is still under heavy development and not yet in a really usable state. Yi is an editor written in Haskell, but it does not qualify as a full IDE. Either way, there is no reason to build yet another IDE from scratch when a perfectly good option is readily available.

Eclipse is one of the most popular IDEs  for the imperative programming language Java, and it is also written in Java. I worked with it years ago and hated it. It was unwieldy, incomprehensible and terribly slow to boot. But recently I was forced to work with it again, and I was pleasantly surprised. Because it is a very powerful IDE there are still many knobs and dials, but they are generally in sensible places and can be understood without a manual. The speed has also improved greatly. But the best thing about Eclipse is its feature set. It has clever code completion. It has a powerful build system. It has refactoring features that outdo even the latest Visual Studio releases from Microsoft. And it is not just about Java: rumour has it that Eclipse can also be used for C++ development, PHP… and Haskell.

Indeed it can. EclipseFP (which stands for Eclipse Functional Programming) is a plugin for Eclipse that allows for Haskell development. (It also contains discontinued support for OCaml.) Unfortunately, EclipseFP is only marginally usable, does not offer half as many useful features as it could, and has been standing still for almost a year. I figured that’s a shame, so I decided to try and see if I could improve this situation. Thomas Schilling a.k.a. nominolo has graciously offered to be my mentor, for which I am vary grateful. Leif Frenzel, the original author of EclipseFP, has also offered his help, so I am in good hands.

I will start by fixing small bugs and making little improvements here and there. This way, I will familiarize myself with the source code of EclipseFP and with the Eclipse plugin system.

Next, the real work will start. The current EclipseFP does its own parsing of Haskell, which is a duplication of work: there is already a perfectly good Haskell parser and typechecker available in the form of the compiler, GHC. The Scion library was developed (by the aforementioned nominolo) specifically for interfacing with GHC. Thus, my next course of action will be to hook EclipseFP up to Scion.

This opens up many exciting possibilities. The type of an identifier could be shown in a tooltip when you hover the mouse cursor over it. Inferred type signatures could be automatically added to functions. Type errors and other compile errors could be highlighted with red squiggly lines. It could be possible to Ctrl+click on an identifier to jump to its definition.

Near the end of the project, I will add support for the Haskell package manager and build system Cabal. EclipseFP currently uses its own build files, but using a Cabal file would greatly simplify the transition to Eclipse + EclipseFP and also allow for easier integration with existing libraries. Some IDE support in writing the Cabal file would also be great.

So, that’s the plan for the next months. It will be a bumpy ride. It will be difficult at times. But I’m definitely going to learn a lot, and will hopefully even turn out a useful product!

11 Responses to “Project description”

  1. Hamish Mackenzie Says:

    I can see the obvious benefits EclipseFP has to developers already using eclipse or using Java and Haskell. Though I wish you were going to spend your summer integrating Scion or Yi with Leksah, I understand that EclipseFP is a valuable asset to Haskell and should be kept up to date.

    When I started helping out on Leksah I found a few features that I personally wanted and helped to add them first. Now I am quite happy with it and I use it for all my Haskell stuff (well the head version which has grep integration now). My fear is that now I am probably blinkered to the issues it has for new users (or users who are not me for that matter). I would love to know which features you think it needs most to make it “really usable”.

  2. Rinaldo Sequitos Says:

    Is it just me or are a lot of people ignorant of Emacs? As a former lisp hacker, I find that Emacs is also very good for working with Haskell. Much more flexible than anything I can envisage Eclipse doing.

  3. Andrew Calleja Says:

    I am looking forward at attempting to use EclipseFP again after trying it out some months ago. It was good but not quite what I hoped for. Good luck with your project!

  4. Mark Wassell Says:

    We need to think of an IDE as being more than an editor. I use Emacs a lot but find it clunky to use when I want to jump to a definition or view a summary of the definitions in the module. Eclipse is a mature, modern and established IDE platform; it could be viewed as the sucessor to Emacs or the next generation Emacs. Eclipse is not just for plain old Java – it can support C/C++, Java web application development and has integrations to source code control systems. In the Realworld, Haskell is going to be used alongside all those things. I too have thought that an IDE in Haskell would be great and am disappointed by current progress, so taking a pragmatic view, I think that EclipseFP is the going to be the best approach.

    Good Luck Thomas!

  5. Patai Gergely Says:

    Just to repeat here what I said on my blog: Emacs is great, but it’s not a newbie-friendly environment. When you’re trying to teach Haskell to students, it helps a lot if they don’t need to relearn the basics of text editing. Eclipse is familiar to many, so there’s one less obstacle even if it provides only the basics. Tight integration with GHC can make life even easier.

    By the way, it would also be great if the plugin included a Helium-like hint system that can help beginners interpret error messages at least in some simple cases.

  6. Thomas ten Cate Says:

    Hamish: Leksah is promising, and I think it will go a long way. But I also think that it requires much, very much work to bring it to the level of usability that Eclipse currently offers for Java. Even Visual Studio, which is a very good IDE in its own right, cannot compete with that.

    Rinaldo: Emacs may be very powerful, but really quite horrible when it comes to usability. If you have worked with it for years, it probably works for you; but try to think back to the first day that you used it, and you might see what I mean. And see also what Mark and Patai said.

    Patai: I don’t know Helium, but I think I get the idea. What error messages in particular do you think need elaboration? Because maybe that functionality should be integrated into GHC directly.

  7. Patai Gergely Says:

    I can only point you to features the page of the Helium project. You could contact them and ask what they think about such an integration.

    Gergely

  8. Lomono Says:

    Will we get monthly updates? :8

  9. Michael Dever Says:

    Sounds like it’s going to be good. I’m using eclipseFP atm, (0.10.0) and it is very, very broken. But it works ok with a bit of coercion! :D

    Good luck, and keep us updated!

    Mick

  10. Thomas Says:

    Lomono: Err, no. I forgot to mention that I’m starting a bit behind schedule due to other obligations. The real work starts tomorrow!

  11. Raoul Duke Says:

    as a long time Emacs and Eclipse user, and a long time lover of FP, i’m desperately looking forward to EclipseFP being something i can really use to really get work done in Haskell. many thanks for your efforts.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: