Posts tagged: eclipse

Haskell IDEs, Part 2: EclipseFP

In the previous post I wrote about using Emacs as a Haskell development environment. Today we’ll take a look at EclipseFP, a plugin that enhances Eclipse with Haskell support. Let’s begin with a brief overview of Eclipse.

If you ever programmed in Java than you almost certainly know Eclipse. This is one of the most popular IDEs for that language and in my personal opinion it’s the best one, much better then crappy NetBeans. Originally it was a project started by IBM, but it’s currently managed by the Eclipse Foundation. Eclipse is written in Java, uses native OS look-and-feel thanks to SWT (Standard Widget Toolkit) and has modular architecture that allows it to be extended with plugins. There are a lot of plugins for Eclipse, just as there are many extensions for Emacs, e.g. they allow to extend basic installation with support for version control systems or integrate with bug tracking and team collaboration software. Most importantly however plugins allow to use Eclipse as an IDE for languages other than Java (among them Haskell1). When I learnt Eclipse years ago it greatly boosted my efficiency as a programmer. Great keyboard shortcuts, good Test Driven Development support, refactoring and code generation capabilities allowed me to focus on important things relieving me of many repeatable tasks. There are also some downsides, one of them being the plugins: install too many and Eclipse will get cluttered with tens of additional options and menus. This is not a major problem though and when I start with a new programming language I usually begin by searching for Eclipse plugin (I admit that recently I also check Emacs extensions). Since I’m very used to Eclipse, with the learning curve already far behind me, I’m biased towards it.

Let’s see what EclipseFP has to offer. Installation turned out to be tedious, since the plugin requires many additional libraries from Hackage. If you already have them – and chances are that you have Hoogle, HLint or QuickCheck – this will be easier, but I had none, so it took some time (nothing complicated though). First problem appeared right after installation. Each time I started Eclipse, Hoogle reported that it has no database and asked if it should be built. Telling Hoogle that it should do it gave no result and the message reappeared each time Eclipse was started. It turned out that the database couldn’t be built because of permissions. Hoogle was installed system-wide and required root privileges to write the database somewhere in /usr directory, while Eclipse was run as normal user. Building the database as root from the command line solved the problem.

List of EclipseFP features is long: syntax highlighting, autocompletion (could be better though), HLint and Hoogle integration, GHCi integration, cabal file editor, profiling support, exporting Haddock documentation – to name some of them.  You can of course benefit from standard features of Eclipse as well as other plugins, e.g. using SVN or GIT integration in your Haskell project. Here’s a glimpse at EclipseFP in action:

No much surprise here: editor with multiple tabs, overview of project structure on the left, GHCi at the bottom. The only thing you may find odd is lack of menus and toolbars. These were disabled by a plugin that allows Eclipse to run in fullscreen mode to use as much screen space as possible. Even with this plugin enabled and editor window maximized (panes at bottom and left can be closed) there’s still less code on the screen comparing to Emacs. Emacs has 37 lines, EclipseFP and Leksah have 32 lines, but that of course depends strongly on your settings. Syntax highlighting could be better in EclipseFP. Both Emacs and Leksah offer more. An important thing to note is very good cabal build system integration. First of all, cabal file editor is non intrusive, so if you edit your files by hand, then use a graphical frontend, and then go back to hand editing you won’t notice anything2. EclipseFP also notices missing build dependencies in the cabal file and can automatically add them for you.

Concluding, EclipseFP nicely integrates Haskell development within Eclipse framework. If you ever developed Java and enjoyed Eclipse, then you must try out EclipseFP. I found EclipseFP much easier to use than Emacs for developing a larger project, most likely because I have many years of Eclipse experience vs. couple of weeks of Emacs experience. I still prefer Emacs to code some simple stuff that fits in one file, but I’m not giving up on Emacs as a project development environment3. Some things in EclipseFP could be improved – syntax highlighting is certainly one of them – but I haven’t found anything that I would consider a serious drawback. One thing that concerns me is the fact that EclipseFP is at the moment a single-person project (it is developed by JP Moresmau). Currently the development cycle seems to be quite stable, but I learnt that such projects can die instantly when the sole developer abandons them. It’s a pity there is no community around this project. I think this can be caused by the fact that it’s aimed at Haskell programmers, but you actually have to be a decent Java developer with solid knowledge of Eclipse RCP to contribute. I hope that I am wrong and no such thing will happen, since EclipseFP seems to be the most reasonable choice for people who want to develop Haskell but don’t fancy learning Emacs.

  1. In case you’re wondering, there are plugins for other functional languages: Scala (it’s a mature plugin and works decently), Erlang (this plugin on the other hand was quite buggy and I had to remove it), Clojure and Scheme (I use Emacs for LISP so I don’t know about these two).


  2. As you’ll see in the future post this is not the case with Leksah []
  3. I installed some more plugins (thanks to people who commented on my previous post), so expect a follow-up []

Haskell Communities and Activities Report, 21st edition. An overview

Haskell Communities and Activities Report is a status report on Haskell community as a whole. It’s released twice a year and contains a whole bunch of interesting stuff. I’ve just read the most recent (November 2011) report. Here’s an overview of things I’ve found the most interesting:

  • There’s a Haskell plugin for Eclipse. So far I’ve been using Emacs with Haskell mode but I’d be happy to see a decent plugin for Eclipse. I’ll be testing it to see how it works.
  • At the same time I’m planning to enhance my Haskell experience in Emacs by using ghc-mod
  • The Monad Reader is a web magazine about Haskell.
  • There is a Debian Haskell Group. I’ve been considering switching to Debian for some time now and it’s good to know there is a good Haskell support for Debian (although I’d probably still stick to the precompiled binaries available from GHC site).
  • HEAT is The Haskell Educational Advancement Tool. I’ll have to look into it and see if it has a good educational potential (for teaching others, not myself).
  • There is a Haskell Natural Language Processing community.
  • Ericsson together with two universities (one in Sweden, one in Hungary) develops Feldspar: Functional Embedded Language for Digital Signal Processing and Parallelism. Find out more.
  • If you want to do bioinformatics stuff in Haskell then Biohaskell might be of interest to you.

There’s a lot more of in the report: games, web applications, compilers, practical applications of Haskell, research and user groups. You can read the whole report here.

Staypressed theme by Themocracy