domingo, 20 de noviembre de 2011

Moving to Persistent

I haven't said much in a while, but of course, things are moving in the EclipseFP world. JPMoresmau announced the 2.20 release of EclipseFP, which in terms of interface gives you a way to manage your local installation of Cabal packages and a better outline of Cabal files. Internally, a lot has changed, as EclipseFP moved from using Scion as backend to BuildWrapper. This big change will hopefully solve most of the memory problems that EclipseFP was experiencing.

Also, I would like to announce that scion-browser is moving from a in-memory database to using SQLite to back up the data. In my tests performance is comparable to the old one (although for big tasks as browsing the entire list of local modules is a bit slower), but doesn't need a big pile of memory to hold the entire database, which I think it's a big win. If you're curious, you can browse the code, but be warned it doesn't work with the current version of EclipseFP.

The change has been possible thanks to the incredible Persistent package of Yesod fame. With that, I hadn't had to write a single line of code to create the database or to insert data. The only problem has been that Persistent doesn't have any way to encode queries with multiples joins. This lead me to write some of the queries by hand (and to refresh my ancient knowledge of SQL).

Hope you like it. As usual, every suggestion to improve EclipseFP or scion-browser is more than welcome :)

viernes, 2 de septiembre de 2011

EclipseFP 2.1.0 released!

As JP Moresmau points in this blog entry, a new release of EclipseFP is out! It includes bug fixes and new functionality, including my work during the Summer of Code.

These past days JP has been working very hard to fix some bugs my code had, and added support for Unicode characters in Scion Browser (which means that you can browse base-unicode-symbols, for example), so I'm really grateful to him.

Apart from that, the new EclipseFP website is out and contains information about how to install this plug-in your system. If you find any bug, don't forget to tell us so we can improve EclipseFP as much as possible!

As a final note, next Monday 5 of September I'll be speaking about EclipseFP in the beautiful city of A Coruña, in Spain, during the Taller de Programación Funcional.

lunes, 22 de agosto de 2011

End of the summer

The Summer of Code has come to its end. It has been three wonderful months, in which I've learnt and hacked a lot. I hope the improvements to EclipseFP will be used and have made it a useful tool for all the Haskell programmers out there :D

One of the tasks I've also done during the summer is building a new webpage for EclipseFP. You can find it in In the next days, a new release of EclipseFP with all the changes I've done though the summer will be made available.

I cannot end my summer whithout thanking my mentor, Thomas Schilling, who has been responsive and helped me a lot with the Haskell coding; and JP Moresmau, the current EclipseFP maintainer, who helped me in my first steps diving into the Eclipse Platform. I also have a debt with A O Van Emmenis and Chris Done for the discussions we had about IDEs and Haskell during the last CamHac and the pile of suggestions they gave me.

I hope you have enjoyed the show, and I'll be delighted of hearing how people used EclipseFP, and willing to implemented more features during the next months.

Quick Assist and new builders

This last week of GSoC has been really productive in terms of user interface additions. Apart from completion, which I showed a couple of days ago, EclipseFP now has quick assist support. Quick assist means that for some kinds of errors, a small light bulb is shown in the left side of the editor. When you click it, ways to correct the error are suggested, and if you click on it, automatically applied.

Most of these fixes were already implemented by JP Moresmau, like adding a package to the Cabal file, removing redundant imports or adding a Language pragma to the file. My work in those has been to make them more discoverable and available through the light bulb icon. Apart from those, you will get the ability to add an import for a function that is not found (it even works if you qualify the item, making the new import qualified).

The rest of the work I want to present today was done between CamHac and the end of the last week. I've always felt that Haskell programming was not only writing Haskell code, but also writing code in tools like Alex, Happy or the UU Attribute Grammar system. Those tools allow you to express some constructions better and more concisely, and I thought that it would be nice to have them in EclipseFP.
So now you have syntax higlighting and automatic building of those files.

Last year I was studying at Utrecht University and really liked their Attribute Grammar System. The tool has a lot of options, and now you can configure them inside EclipseFP. Even more, the configuration is saved in the same format that the one used in uuagc-cabal package.

This has been all for the summer. A new EclipseFP release with all the features should be available very soon :D

miércoles, 17 de agosto de 2011

Autocompletion and more

In the past week I've continued adding features to EclipseFP. For example, now you can edit Alex, Happy or UUAGC files directly in EclipseFP, and you will get syntax highlighting (taking into accounts which zones are Haskell code and which others are non-Haskell). Last weekend I've attend CamHac. That was a wonderful experience to know new people, and also to collect suggestions and improvements for the plug-in. Two of those suggestions have already been implemented.
The first one is a tighter integration with some of the web frameworks available in Haskell-land. In particular, you can create Snap and Yesod projects directly from the New Project wizard in Eclipse, provided the neccessary tools are installed. Also, I've linked some content-types to existing web editors, so you will get HTML editor for a Heist template, CSS editor for a Lucius template and so on.
The other feature that most of the people requested was autocompletion. I didn't implement that before because my knowledge of both Eclipse and Scion was lower, and didn't really know where to start. But after these 3 months I've been able to come to a solution to the problem, and I'm delighted to present the new revamped Haskell code assist for EclipseFP:

In the following days I plan to implement more of the suggestions in my TODO list :D

martes, 9 de agosto de 2011

EclipseFP build error on Ubuntu Oneiric

UPDATE: the bug has been solved in Oneiric, so this PPA is no longer needed. I leave this here only for reference.

If you try to install EclipseFP on a Ubuntu Oneiric (the next release which will have the number 11.10) you may get the following error when scion-browser is built:
ghc: panic! (the 'impossible' happened)
 (GHC version 7.0.3 for x86_64-unknown-linux):
       loadArchive "/usr/lib/ghc-7.0.3/ghc-7.0.3/libHSghc-7.0.3.a": failed
This is due to GHC 7.0.3 being packed in Debian with a stripped libHSghc. I don't know well what that means, but makes impossible to use have ghc as a dependency while using Template Haskell (something scion-browser does). In Debian unstable this has been fixed upgrading to a new GHC version, but in Ubuntu it seems that we will have to wait until the bug is fixed.
In the meanwhile, I've created a PPA archive with the GHC version in Debian (7.0.4-4) and rebuilt the haskell-platform package and its dependencies. This means that you can get a working Haskell Platform with a working version of GHC following the instructions about installing.
The downside is that the PPA only contains the core Haskell packages and the rest of libghc-* packages in Ubuntu are not compatible with these version. So you will have to use cabal install to get any other package in a system using the PPA, even if the library has been packaged in Ubuntu.

sábado, 23 de julio de 2011

SourceGraph on EclipseFP

Eclipse really makes some tasks very very easy. One of them is running a command through a popup menu. So, while I was looking at the list of development tools in the Haskell wiki, I read about SourceGraph, and decided to integrate it into EclipseFP. The idea was easy: to run SourceGraph on the corresponding Cabal file and show the output in the internal browser. Voilà!