In this blog I talk about some of the personal work I do in programming. I mainly do Java and JavaScript, but I'm learning functional programming in Haskell too...

Friday, October 23, 2009

Releasing my code on the unsuspecting public (EclipseFP)

Today I've released a new version of EclipseFP (Haskell support in Eclipse). There are quite a few changes in it, and there are even some changes in the Scion library that I've made and that Nominolo integrated. So people can give it a try if they want: get the current Scion source code, build/install it, and get the 1.108 version of EclipseFP.Hopefully that's another step for me in getting more proficient in Haskell: interacting with other Haskell hackers, learning from them and their code, and releasing code that may actually been of use to somebody (or annoy them no end if it doesn't work) instead of only a little game as before. And of course working on an Haskell IDE, even in Java, gets me to learn new things about the language, the options for Cabal or GHC, etc...Anyway, I hope I'll get some feedback on the new EclipseFP, and that we can move that thing forward!

I've downloaded and installed everything as indicated and it's all working great. It's nice having one IDE for both my Haskell (EclipseFP) and Scala. I had been using emacs and leksah, but i think I will now just focus on eclipse. Thanks to everyone who has worked on EclipseFP.

Hello, I am using windows with eclipse at c:\expanded\eclipse, workspace at c:\dev and project root at c:\dev\etest2. After adding a module Main I get the error:"Description Resource Path Location Typefile C:\dev\etest2\src\Main.hs is not relative to project root C:\expanded\eclipse Main.hs /etest2/src line 1 Problem"which seems wrong to me. Anyone got any ideas?

At the very bottom of http://eclipsefp.sourceforge.net/ you will see the 0.108.0 archive. Download this and extract it to your eclipse directory in the corresponding features and plugin directories. Then use the eclipse update with option "from local" to install the above in eclipse. Update scion from the git repository as described.

No, unfortunately not. It was a test project created under 0.107.0.The error appeared after upgrading to 0.108.0, though new projects seem to have this as well.Have you tried a similar constellation yourself?

Well yes, since I started with 107 and slowly built 108 on top. There must be something in the Eclipse "Error Log" view, with hopefully a stack trace. Attach it to an incident on the eclipsefp sourceforge help forum, so we can track the issue better than through the blog. Even attach the zipped project directory if you want.

I tried to install Nominolo's scion from github. I downloaded it since I don't have an account. There are some missing libraries on hackage however such as ghc-uniplate. I downloaded that from his github once more and it then required derive 0.1.4... etc etc it's a long story but in the end I couldn't compile the latest version of scion. So I tried the version on hackage but it doesn't seem to work correctly or at least i am doing something wrong. Can you please help? Thanks I am really looking forward to using eclipseFP.

Rene, for some reason I had never seen your error but I realized that Scion expects to be running from the root of the project, and the eclipse code didn't enforce that. I fixed it and released it on github if you want to try it. I'm at a loss why it never caused an issue anywhere else.

Andrew, I don't recall any issue installing scion. What I would do is install the hackage version first through "cabal install scion" to get all the dependencies installed for me, then install the github version.

Andrew, when the project is built (automatically or via the build project command in eclipse), exes are generated in the .dist-scion folder. In the current version of Scion the name cannot be changed so since it starts with a dot by default you don't see it in Eclipse, but it's there.

Typechecking actual file contents failed. Typechecking will only be performed on the saved document. This is normal if your Haskell code contains preprocessor instructions. The error was: The requested method is not supported.

An exception stack trace is not available.

----------------------------------Thank you in advance, an sorry for being too verbose.

As indicated in http://www.haskell.org/ghc/docs/latest/html/Cabal/authors.html#buildinfo , the hs-source-dirs field must be in either an executable or library section. So your cabal file needs to be:Name: hs-provaVersion: 0.1

library hs-source-dirs: src

This maybe explains the error about the library component not having a cabal-file field. The other error is probably due to you using the hackage version of scion. To get the most of eclipsefp 1.108 you need to get scion from github and build it from source (http://github.com/nominolo/scion/tree/devel for example)

I am running latest scion (nominolo), and latest eclipsefp from http://github.com/JPMoresmau/Official 1.108 gives me the same error of rene (Main.hs is not relative to project root), so I upgraded to latest sources

at net.sf.eclipsefp.haskell.scion.internal.commands.ScionCommand.processResponseResult(ScionCommand.java:285) at net.sf.eclipsefp.haskell.scion.internal.commands.ScionCommand.processResponse(ScionCommand.java:273) at net.sf.eclipsefp.haskell.scion.internal.commands.ScionCommand.receiveResponse(ScionCommand.java:207) at net.sf.eclipsefp.haskell.scion.internal.client.ScionServer.runCommandSync(ScionServer.java:380) at net.sf.eclipsefp.haskell.scion.client.ScionInstance.runCommandSync(ScionInstance.java:202) at net.sf.eclipsefp.haskell.scion.internal.commands.ScionCommand.run(ScionCommand.java:136) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

at org.json.JSONObject.get(JSONObject.java:517) at org.json.JSONObject.getString(JSONObject.java:688) at net.sf.eclipsefp.haskell.scion.types.Component.[init](Component.java:41) at net.sf.eclipsefp.haskell.scion.internal.commands.ListCabalComponentsCommand.doProcessResult(ListCabalComponentsCommand.java:28) at net.sf.eclipsefp.haskell.scion.internal.commands.ScionCommand.processResponseResult(ScionCommand.java:283) ... 6 more

Pavel, thanks for your time. Yes, for the moment not everything is 100% consistent in EclipseFP. The GHC parameters in the preferences are not used at all. Now we're moving towards using the Cabal file for everything. Down the line, these options will probably be used for project defaults (ghc options written automatically in the Cabal file when creating a new project).