lunes, 6 de junio de 2011

Week #2

This week I've been working in several independent tasks for the EclipseFP Browser, both in the Haskell backend and Eclipse frontend.

In the backend, I've tried to speed up a bit the creation of the databases. After some time looking for solutions and trying to build my own one using parallel package, I found the amazing parallel-io, which completely suited my needs. Now the user may use more than one thread for running Hackage and parsing the results back.

Although my initial thought was integrating the browser code directly inside Scion, it seems that library is in the middle of a process of rearchitecture. So my mentor suggested me to create a different executable for browsing tasks, and that was part of my work in the beginning of the week. Being used to the JSON libraries in the Java and Python world, aeson really alleviates a lot of work. The result is that now you can query an executable scion-browser for documentation about the installed packages in your system. The frontend is not very user-friendly, because it's oriented to be consumed by other tools such EclipseFP, but in any case you can consult the entire list of commands here.

The worst part this week has been my continuous fight against linking and Template Haskell-ing. For the console executable I started using editline, but when recompiling some file using Template Haskell, it made GHC crash. Fortunately, this is one of the times when Haskell has more than one library for the same task, and the problem was easily solvable using haskeline.

On the same line, when I was trying to integrate Hoogle, I got lots of problems about undefined references in Hoogle library. At first, they appeared in Template Haskell, so I decided to remove every use of that feature in my code. Thanks to the GHC option -ddump-splices, this was not as utterly boring at it seemed. However, when I finally got rid of that, the linker still showed me those kind of errors. It seems to be related to the fact that the hoogle package builds both a library and an executable and some object files are not correctly put in the archive. The solution for this problem was not using directly the library, but call the hoogle command for searches, and parse its output, which was easy as most of the parsing could be reused from the work in last week.

With all that, I felt it was time to start hacking in the Java side. Grasping all the concepts in Eclipse is taking some time, but I've been reading the great "Eclipse plug-ins" book and have more or less an idea on where to start hacking. Yesterday I used some time to create all the Java counterparts of module, package and declarations information, and the parsing and uparsing of JSON commands.

That's all. The next weeks I'll be working on the Browser in Eclipse. In the meantime, I'm also thinking about the best user interface for Cabal files editing, and I'm willing to hear any suggestion or comment in that topic :)

No hay comentarios:

Publicar un comentario